aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/libraries/libcork/default.nix
blob: 3875ff91185afe1c162b5485d4136a2f7ae50f48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ stdenv
, fetchFromGitHub
, cmake
, lib
, pkg-config
, check
}:
stdenv.mkDerivation rec {
  pname = "libcork";
  version = "1.0.0--rc3";

  src = fetchFromGitHub {
    owner = "dcreager";
    repo = pname;
    rev = version;
    sha256 = "152gqnmr6wfmflf5l6447am4clmg3p69pvy3iw7yhaawjqa797sk";
  };

  # N.B. We need to create this file, otherwise it tries to use git to
  # determine the package version, which we do not want.
  #
  # N.B. We disable tests by force, since their build is broken.
  postPatch = ''
    echo "${version}" > .version-stamp
    echo "${version}" > .commit-stamp
    sed -i '/add_subdirectory(tests)/d' ./CMakeLists.txt
  '';

  nativeBuildInputs = [ cmake pkg-config ];
  buildInputs = [ check ];

  doCheck = false;

  postInstall = ''
    ln -s $out/lib/libcork.so $out/lib/libcork.so.1
  '';

  meta = with lib; {
    homepage = "https://github.com/dcreager/libcork";
    description = "A simple, easily embeddable cross-platform C library";
    license = licenses.bsd3;
    platforms = platforms.unix;
    maintainers = with maintainers; [ lovesegfault ];
  };
}