Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 build2,
5 fetchurl,
6 git,
7 libbpkg,
8 libbutl,
9 libodb,
10 libodb-sqlite,
11 openssl,
12 enableShared ? !stdenv.hostPlatform.isStatic,
13 enableStatic ? !enableShared,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "bpkg";
18 version = "0.17.0";
19
20 outputs = [
21 "out"
22 "doc"
23 "man"
24 ];
25
26 src = fetchurl {
27 url = "https://pkg.cppget.org/1/alpha/build2/bpkg-${version}.tar.gz";
28 hash = "sha256-Yw6wvTqO+VfCo91B2BUT0A8OIN0MVhGK1USYM7hgGMs=";
29 };
30
31 strictDeps = true;
32 nativeBuildInputs = [
33 build2
34 ];
35 buildInputs = [
36 build2
37 libbpkg
38 libbutl
39 libodb
40 libodb-sqlite
41 ];
42 nativeCheckInputs = [
43 git
44 openssl
45 ];
46
47 doCheck = !stdenv.hostPlatform.isDarwin; # tests hang
48
49 # Failing test
50 postPatch = ''
51 rm tests/rep-create.testscript
52 '';
53
54 build2ConfigureFlags = [
55 "config.bin.lib=${build2.configSharedStatic enableShared enableStatic}"
56 ];
57
58 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
59 install_name_tool -add_rpath '${lib.getLib build2}/lib' "''${!outputBin}/bin/bpkg"
60 '';
61
62 meta = with lib; {
63 description = "Build2 package dependency manager";
64 mainProgram = "bpkg";
65 # https://build2.org/bpkg/doc/bpkg.xhtml
66 longDescription = ''
67 The build2 package dependency manager is used to manipulate build
68 configurations, packages, and repositories.
69 '';
70 homepage = "https://build2.org/";
71 changelog = "https://git.build2.org/cgit/bpkg/tree/NEWS";
72 license = licenses.mit;
73 maintainers = with maintainers; [ r-burns ];
74 platforms = platforms.all;
75 };
76}