linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / tools / misc / ostree / default.nix
blob53966705c2d78aace9dafb8558fa5d3d1bf34ac5
1 { lib, stdenv
2 , fetchurl
3 , fetchpatch
4 , substituteAll
5 , pkg-config
6 , gtk-doc
7 , gobject-introspection
8 , gjs
9 , nixosTests
10 , glib
11 , systemd
12 , xz
13 , e2fsprogs
14 , libsoup
15 , gpgme
16 , which
17 , makeWrapper
18 , autoconf
19 , automake
20 , libtool
21 , fuse
22 , util-linuxMinimal
23 , libselinux
24 , libsodium
25 , libarchive
26 , libcap
27 , bzip2
28 , bison
29 , libxslt
30 , docbook-xsl-nons
31 , docbook_xml_dtd_42
32 , openssl
33 , python3
36 let
37   testPython = (python3.withPackages (p: with p; [
38     pyyaml
39   ]));
40 in stdenv.mkDerivation rec {
41   pname = "ostree";
42   version = "2020.8";
44   outputs = [ "out" "dev" "man" "installedTests" ];
46   src = fetchurl {
47     url = "https://github.com/ostreedev/ostree/releases/download/v${version}/libostree-${version}.tar.xz";
48     sha256 = "16v73v63h16ika73kgh2cvgm0v27r2d48m932mbj3xm6s295kapx";
49   };
51   patches = [
52     # Tests access the helper using relative path
53     # https://github.com/ostreedev/ostree/issues/1593
54     # Patch from https://github.com/ostreedev/ostree/pull/1633
55     ./01-Drop-ostree-trivial-httpd-CLI-move-to-tests-director.patch
57     # Workarounds for https://github.com/ostreedev/ostree/issues/1592
58     ./fix-1592.patch
60     # Hard-code paths in tests
61     (substituteAll {
62       src = ./fix-test-paths.patch;
63       python3 = testPython.interpreter;
64       openssl = "${openssl}/bin/openssl";
65     })
66   ];
68   nativeBuildInputs = [
69     autoconf
70     automake
71     libtool
72     pkg-config
73     gtk-doc
74     gobject-introspection
75     which
76     makeWrapper
77     bison
78     libxslt
79     docbook-xsl-nons
80     docbook_xml_dtd_42
81   ];
83   buildInputs = [
84     glib
85     systemd
86     e2fsprogs
87     libsoup
88     gpgme
89     fuse
90     libselinux
91     libsodium
92     libcap
93     libarchive
94     bzip2
95     xz
96     util-linuxMinimal # for libmount
98     # for installed tests
99     testPython
100     gjs
101   ];
103   enableParallelBuilding = true;
105   configureFlags = [
106     "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
107     "--with-systemdsystemgeneratordir=${placeholder "out"}/lib/systemd/system-generators"
108     "--enable-installed-tests"
109     "--with-ed25519-libsodium"
110   ];
112   makeFlags = [
113     "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/libostree"
114     "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/libostree"
115   ];
117   preConfigure = ''
118     env NOCONFIGURE=1 ./autogen.sh
119   '';
121   postFixup = let
122     typelibPath = lib.makeSearchPath "/lib/girepository-1.0" [
123       (placeholder "out")
124       gobject-introspection
125     ];
126   in ''
127     for test in $installedTests/libexec/installed-tests/libostree/*.js; do
128       wrapProgram "$test" --prefix GI_TYPELIB_PATH : "${typelibPath}"
129     done
130   '';
132   passthru = {
133     tests = {
134       installedTests = nixosTests.installed-tests.ostree;
135     };
136   };
138   meta = with lib; {
139     description = "Git for operating system binaries";
140     homepage = "https://ostree.readthedocs.io/en/latest/";
141     license = licenses.lgpl2Plus;
142     platforms = platforms.linux;
143     maintainers = with maintainers; [ copumpkin ];
144   };