2022-04-15 01:41:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, substituteAll, pkg-config, gnused, autoreconfHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, gtk-doc, acl, systemd, glib, libatasmart, polkit, coreutils, bash, which
|
2020-11-24 20:58:05 +00:00
|
|
|
, expat, libxslt, docbook_xsl, util-linux, mdadm, libgudev, libblockdev, parted
|
2022-04-15 01:41:22 +00:00
|
|
|
, gobject-introspection, docbook_xml_dtd_412, docbook_xml_dtd_43
|
2020-04-24 23:36:52 +00:00
|
|
|
, xfsprogs, f2fs-tools, dosfstools, e2fsprogs, btrfs-progs, exfat, nilfs-utils, ntfs3g
|
2022-04-15 01:41:22 +00:00
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "udisks";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "2.9.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "storaged-project";
|
|
|
|
repo = "udisks";
|
|
|
|
rev = "${pname}-${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-MYQztzIyp5kh9t1bCIlj08/gaOmZfuu/ZOwo3F+rZiw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
outputs = [ "out" "man" "dev" ] ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "devdoc";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-paths.patch;
|
|
|
|
bash = "${bash}/bin/bash";
|
2020-11-24 20:58:05 +00:00
|
|
|
blkid = "${util-linux}/bin/blkid";
|
2020-04-24 23:36:52 +00:00
|
|
|
false = "${coreutils}/bin/false";
|
|
|
|
mdadm = "${mdadm}/bin/mdadm";
|
2022-03-30 09:31:56 +00:00
|
|
|
mkswap = "${util-linux}/bin/mkswap";
|
2020-04-24 23:36:52 +00:00
|
|
|
sed = "${gnused}/bin/sed";
|
|
|
|
sh = "${bash}/bin/sh";
|
|
|
|
sleep = "${coreutils}/bin/sleep";
|
2022-03-30 09:31:56 +00:00
|
|
|
swapon = "${util-linux}/bin/swapon";
|
2020-04-24 23:36:52 +00:00
|
|
|
true = "${coreutils}/bin/true";
|
|
|
|
})
|
|
|
|
(substituteAll {
|
|
|
|
src = ./force-path.patch;
|
2021-02-05 17:12:51 +00:00
|
|
|
path = lib.makeBinPath [
|
2020-04-24 23:36:52 +00:00
|
|
|
btrfs-progs coreutils dosfstools e2fsprogs exfat f2fs-tools nilfs-utils
|
2020-11-24 20:58:05 +00:00
|
|
|
xfsprogs ntfs3g parted util-linux
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
strictDeps = true;
|
|
|
|
# pkg-config had to be in both to find gtk-doc and gobject-introspection
|
|
|
|
depsBuildBuild = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
2022-04-15 01:41:22 +00:00
|
|
|
autoreconfHook which gobject-introspection pkg-config
|
2022-01-23 02:10:13 +00:00
|
|
|
gtk-doc libxslt docbook_xml_dtd_412 docbook_xml_dtd_43 docbook_xsl
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace udisks/udisksclient.c \
|
|
|
|
--replace 'defined( __GNUC_PREREQ)' 1 \
|
|
|
|
--replace '__GNUC_PREREQ(4,6)' 1
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [
|
2022-01-23 02:10:13 +00:00
|
|
|
expat libgudev libblockdev acl systemd glib libatasmart polkit util-linux
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = "NOCONFIGURE=1 ./autogen.sh";
|
|
|
|
|
|
|
|
configureFlags = [
|
2021-02-05 17:12:51 +00:00
|
|
|
(lib.enableFeature (stdenv.buildPlatform == stdenv.hostPlatform) "gtk-doc")
|
2022-04-15 01:41:22 +00:00
|
|
|
"--sysconfdir=/etc"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--localstatedir=/var"
|
|
|
|
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
|
|
|
|
"--with-udevdir=$(out)/lib/udev"
|
|
|
|
"--with-tmpfilesdir=no"
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"INTROSPECTION_GIRDIR=$(dev)/share/gir-1.0"
|
|
|
|
"INTROSPECTION_TYPELIBDIR=$(out)/lib/girepository-1.0"
|
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
installFlags = [
|
|
|
|
"sysconfdir=${placeholder "out"}/etc"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
passthru.tests.vm = nixosTests.udisks2;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A daemon, tools and libraries to access and manipulate disks, storage devices and technologies";
|
|
|
|
homepage = "https://www.freedesktop.org/wiki/Software/udisks/";
|
|
|
|
license = with licenses; [ lgpl2Plus gpl2Plus ]; # lgpl2Plus for the library, gpl2Plus for the tools & daemon
|
2022-03-30 09:31:56 +00:00
|
|
|
maintainers = teams.freedesktop.members ++ (with maintainers; [ johnazoidberg ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|