1{ stdenv, fetchFromGitHub, fetchpatch, pkgconfig, gtk-doc, gobjectIntrospection, gnome3
2, glib, systemd, xz, e2fsprogs, libsoup, gpgme, which, autoconf, automake, libtool, fuse, utillinuxMinimal, libselinux
3, libarchive, libcap, bzip2, yacc, libxslt, docbook_xsl, docbook_xml_dtd_42, python3
4}:
5
6let
7 version = "2018.6";
8
9 libglnx-src = fetchFromGitHub {
10 owner = "GNOME";
11 repo = "libglnx";
12 rev = "e1a78cf2f5351d5394ccfb79f3f5a7b4917f73f3";
13 sha256 = "10kzyjbrmr98i65hlz8jc1v5bijyqwwfp6qqjbd5g3y0n520iaxc";
14 };
15
16 bsdiff-src = fetchFromGitHub {
17 owner = "mendsley";
18 repo = "bsdiff";
19 rev = "1edf9f656850c0c64dae260960fabd8249ea9c60";
20 sha256 = "1h71d2h2d3anp4msvpaff445rnzdxii3id2yglqk7af9i43kdsn1";
21 };
22in stdenv.mkDerivation {
23 name = "ostree-${version}";
24
25 outputs = [ "out" "dev" "man" "installedTests" ];
26
27 src = fetchFromGitHub {
28 rev = "v${version}";
29 owner = "ostreedev";
30 repo = "ostree";
31 sha256 = "0kk04pznk6m6fqdz609m2zcnkalcw9q8fsx8wm42k6dhf6cw7l3g";
32 };
33
34 patches = [
35 # Tests access the helper using relative path
36 # https://github.com/ostreedev/ostree/issues/1593
37 (fetchpatch {
38 url = https://github.com/ostreedev/ostree/pull/1633.patch;
39 sha256 = "07xiw1dr7j4yw3w92qhw37f9crlglibflcqj2kf0v5gfrl9i6g4j";
40 })
41 ];
42
43 nativeBuildInputs = [
44 autoconf automake libtool pkgconfig gtk-doc gobjectIntrospection which yacc
45 libxslt docbook_xsl docbook_xml_dtd_42
46 ];
47
48 buildInputs = [
49 glib systemd e2fsprogs libsoup gpgme fuse libselinux libcap
50 libarchive bzip2 xz
51 utillinuxMinimal # for libmount
52 (python3.withPackages (p: with p; [ pyyaml ])) gnome3.gjs # for tests
53 ];
54
55 prePatch = ''
56 rmdir libglnx bsdiff
57 cp --no-preserve=mode -r ${libglnx-src} libglnx
58 cp --no-preserve=mode -r ${bsdiff-src} bsdiff
59 '';
60
61 preConfigure = ''
62 env NOCONFIGURE=1 ./autogen.sh
63 '';
64
65 configureFlags = [
66 "--with-systemdsystemunitdir=$(out)/lib/systemd/system"
67 "--with-systemdsystemgeneratordir=$(out)/lib/systemd/system-generators"
68 "--enable-installed-tests"
69 ];
70
71 makeFlags = [
72 "installed_testdir=$(installedTests)/libexec/installed-tests/libostree"
73 "installed_test_metadir=$(installedTests)/share/installed-tests/libostree"
74 ];
75
76 meta = with stdenv.lib; {
77 description = "Git for operating system binaries";
78 homepage = https://ostree.readthedocs.io/en/latest/;
79 license = licenses.lgpl2Plus;
80 platforms = platforms.linux;
81 maintainers = with maintainers; [ copumpkin ];
82 };
83}