nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 onetbb,
6 libgit2,
7 curl,
8 fmt_11,
9 nlohmann_json,
10 pkg-config,
11}:
12
13let
14 toml11 = fetchFromGitHub rec {
15 owner = "ToruNiina";
16 repo = "toml11";
17 version = "4.2.0";
18 tag = "v${version}";
19 sha256 = "sha256-NUuEgTpq86rDcsQnpG0IsSmgLT0cXhd1y32gT57QPAw=";
20 };
21in
22stdenv.mkDerivation rec {
23 pname = "cabinpkg";
24 version = "0.11.1";
25
26 src = fetchFromGitHub {
27 owner = "cabinpkg";
28 repo = "cabin";
29 tag = version;
30 sha256 = "sha256-qMmfViu3ol8+Tpyy8hn0j5r+bql0SFeKPVVj/ox4AGQ=";
31 };
32
33 strictDeps = true;
34
35 nativeBuildInputs = [
36 pkg-config
37 ];
38
39 buildInputs = [
40 libgit2
41 fmt_11
42 onetbb
43 nlohmann_json
44 curl
45 ];
46
47 # Skip git cloning toml11
48 preConfigure = ''
49 substituteInPlace Makefile \
50 --replace-fail "git clone https://github.com/ToruNiina/toml11.git \$@" ":" \
51 --replace-fail "git -C \$@ reset --hard v4.2.0" ":"
52 '';
53
54 preBuild = ''
55 mkdir -p build/DEPS/
56 cp -rf ${toml11} build/DEPS/toml11
57 '';
58
59 makeFlags = [
60 "RELEASE=1"
61 "COMMIT_HASH="
62 "COMMIT_SHORT_HASH="
63 "COMMIT_DATE="
64 ];
65
66 installFlags = [ "PREFIX=${placeholder "out"}" ];
67
68 meta = {
69 broken = (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64);
70 homepage = "https://cabinpkg.com";
71 description = "Package manager and build system for C++";
72 license = lib.licenses.asl20;
73 maintainers = [ ];
74 platforms = lib.platforms.unix;
75 mainProgram = "cabin";
76 };
77}