1 { lib, stdenv, fetchFromGitHub, substituteAll, pkg-config, gnused, autoreconfHook
2 , gtk-doc, acl, systemd, glib, libatasmart, polkit, coreutils, bash, which
3 , expat, libxslt, docbook_xsl, util-linux, mdadm, libgudev, libblockdev, parted
4 , gobject-introspection, docbook_xml_dtd_412, docbook_xml_dtd_43
5 , xfsprogs, f2fs-tools, dosfstools, e2fsprogs, btrfs-progs, exfat, nilfs-utils, ntfs3g
9 stdenv.mkDerivation rec {
13 src = fetchFromGitHub {
14 owner = "storaged-project";
16 rev = "${pname}-${version}";
17 sha256 = "sha256-L8jr1+SJWsCizkPXC8VKDy2eVa7/FpqdB8SkBYq6vwc=";
20 outputs = [ "out" "man" "dev" ] ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "devdoc";
24 src = ./fix-paths.patch;
25 bash = "${bash}/bin/bash";
26 false = "${coreutils}/bin/false";
27 mdadm = "${mdadm}/bin/mdadm";
28 mkswap = "${util-linux}/bin/mkswap";
29 sed = "${gnused}/bin/sed";
30 sh = "${bash}/bin/sh";
31 sleep = "${coreutils}/bin/sleep";
32 swapon = "${util-linux}/bin/swapon";
33 true = "${coreutils}/bin/true";
36 src = ./force-path.patch;
37 path = lib.makeBinPath [
38 btrfs-progs coreutils dosfstools e2fsprogs exfat f2fs-tools nilfs-utils
39 xfsprogs ntfs3g parted util-linux
45 # pkg-config had to be in both to find gtk-doc and gobject-introspection
46 depsBuildBuild = [ pkg-config ];
48 autoreconfHook which gobject-introspection pkg-config
49 gtk-doc libxslt docbook_xml_dtd_412 docbook_xml_dtd_43 docbook_xsl
52 postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
53 substituteInPlace udisks/udisksclient.c \
54 --replace 'defined( __GNUC_PREREQ)' 1 \
55 --replace '__GNUC_PREREQ(4,6)' 1
59 expat libgudev libblockdev acl systemd glib libatasmart polkit util-linux
62 preConfigure = "NOCONFIGURE=1 ./autogen.sh";
65 (lib.enableFeature (stdenv.buildPlatform == stdenv.hostPlatform) "gtk-doc")
67 "--localstatedir=/var"
68 "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
69 "--with-udevdir=$(out)/lib/udev"
70 "--with-tmpfilesdir=no"
74 "INTROSPECTION_GIRDIR=$(dev)/share/gir-1.0"
75 "INTROSPECTION_TYPELIBDIR=$(out)/lib/girepository-1.0"
79 "sysconfdir=${placeholder "out"}/etc"
82 enableParallelBuilding = true;
88 tests.vm = nixosTests.udisks2;
92 description = "Daemon, tools and libraries to access and manipulate disks, storage devices and technologies";
93 homepage = "https://www.freedesktop.org/wiki/Software/udisks/";
94 license = with licenses; [ lgpl2Plus gpl2Plus ]; # lgpl2Plus for the library, gpl2Plus for the tools & daemon
95 maintainers = teams.freedesktop.members ++ (with maintainers; [ johnazoidberg ]);
96 platforms = platforms.linux;