git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #41723 from flokli/udisks-2.7.6

udisks 2.1.6 -> 2.7.6

commit25398a90b170dfc2c1b73849464461630f1b3a07 authorxeji <36407913+xeji@users.noreply.github.com> dateMon 11 Jun 2018, 18:29 (8 years ago) parent69f832d41b140c
7 files changed+334−33
pkgs/development/libraries/libblockdev/default.nix+39 pkgs/development/libraries/libbytesize/default.nix+31 pkgs/development/libraries/libndctl/default.nix+40 pkgs/development/libraries/volume-key/default.nix+38 pkgs/os-specific/linux/udisks/2-default.nix+47−33 pkgs/os-specific/linux/udisks/fix-paths.patch+131 pkgs/top-level/all-packages.nix+8
pkgs/development/libraries/libblockdev/default.nixnew file+39
@@ -0,0 +1,39 @@
1+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, gtk-doc, libxslt, docbook_xsl
2+, docbook_xml_dtd_43, python3, gobjectIntrospection, glib, libudev, kmod, parted
3+, cryptsetup, devicemapper, dmraid, utillinux, libbytesize, libndctl, nss, volume_key
4+}:
5+
6+let
7+ version = "2.17";
8+in stdenv.mkDerivation rec {
9+ name = "libblockdev-${version}";
10+
11+ src = fetchFromGitHub {
12+ owner = "storaged-project";
13+ repo = "libblockdev";
14+ rev = "${version}-1";
15+ sha256 = "14f52cj2qcnm8i2zb57qfpdk3kij2gb3xgqkbvidmf6sjicq84z2";
16+ };
17+
18+ outputs = [ "out" "dev" "devdoc" ];
19+
20+ postPatch = ''
21+ patchShebangs scripts
22+ '';
23+
24+ nativeBuildInputs = [
25+ autoreconfHook pkgconfig gtk-doc libxslt docbook_xsl docbook_xml_dtd_43 python3 gobjectIntrospection
26+ ];
27+
28+ buildInputs = [
29+ glib libudev kmod parted cryptsetup devicemapper dmraid utillinux libbytesize libndctl nss volume_key
30+ ];
31+
32+ meta = with stdenv.lib; {
33+ description = "A library for manipulating block devices";
34+ homepage = http://storaged.org/libblockdev/;
35+ license = licenses.lgpl2Plus; # lgpl2Plus for the library, gpl2Plus for the utils
36+ maintainers = with maintainers; [];
37+ platforms = platforms.linux;
38+ };
39+}
pkgs/development/libraries/libbytesize/default.nixnew file+31
@@ -0,0 +1,31 @@
1+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, gettext
2+, gtk-doc, libxslt, docbook_xml_dtd_43, docbook_xsl
3+, python3, pcre, gmp, mpfr
4+}:
5+
6+let
7+ version = "1.3";
8+in stdenv.mkDerivation rec {
9+ name = "libbytesize-${version}";
10+
11+ src = fetchFromGitHub {
12+ owner = "storaged-project";
13+ repo = "libbytesize";
14+ rev = version;
15+ sha256 = "1ys5d8rya8x4q34gn1hr96z7797s9gdzah0y0d7g84x5x6k50p30";
16+ };
17+
18+ outputs = [ "out" "dev" "devdoc" ];
19+
20+ nativeBuildInputs = [ autoreconfHook pkgconfig gettext gtk-doc libxslt docbook_xml_dtd_43 docbook_xsl python3 ];
21+
22+ buildInputs = [ pcre gmp mpfr ];
23+
24+ meta = with stdenv.lib; {
25+ description = "A tiny library providing a C “class” for working with arbitrary big sizes in bytes";
26+ homepage = src.meta.homepage;
27+ license = licenses.lgpl2Plus;
28+ maintainers = with maintainers; [];
29+ platforms = platforms.linux;
30+ };
31+}
pkgs/development/libraries/libndctl/default.nixnew file+40
@@ -0,0 +1,40 @@
1+{ stdenv, fetchFromGitHub, autoreconfHook, autoconf, automake, asciidoc, docbook_xsl, docbook_xml_dtd_45, libxslt, xmlto, pkgconfig, json_c, kmod, which, systemd, utillinux
2+}:
3+
4+let
5+ version = "60.3";
6+in stdenv.mkDerivation rec {
7+ name = "libndctl-${version}";
8+
9+ src = fetchFromGitHub {
10+ owner = "pmem";
11+ repo = "ndctl";
12+ rev = "v${version}";
13+ sha256 = "0w19yh6f9skf5zy4bhdjlrn3wdx5xx9cq8j6h04cmw4nla6zj9ar";
14+ };
15+
16+ outputs = [ "out" "man" "dev" ];
17+
18+ nativeBuildInputs = [
19+ autoreconfHook asciidoc pkgconfig xmlto docbook_xml_dtd_45 docbook_xsl libxslt
20+ ];
21+
22+ buildInputs = [
23+ json_c kmod systemd utillinux
24+ ];
25+
26+ preAutoreconf = ''
27+ substituteInPlace configure.ac --replace "which" "${which}/bin/which"
28+ substituteInPlace git-version --replace /bin/bash ${stdenv.shell}
29+ substituteInPlace git-version-gen --replace /bin/sh ${stdenv.shell}
30+ echo "m4_define([GIT_VERSION], [${version}])" > version.m4;
31+ '';
32+
33+ meta = with stdenv.lib; {
34+ description = "Utility library for managing the libnvdimm (non-volatile memory device) sub-system in the Linux kernel";
35+ homepage = https://github.com/pmem/ndctl;
36+ license = licenses.lgpl21;
37+ maintainers = with maintainers; [];
38+ platforms = platforms.linux;
39+ };
40+}
pkgs/development/libraries/volume-key/default.nixnew file+38
@@ -0,0 +1,38 @@
1+{ stdenv, fetchgit, fetchpatch, autoreconfHook, pkgconfig, gettext, python2
2+, swig, glib, utillinux, cryptsetup, nss, gpgme
3+}:
4+
5+let
6+ version = "0.3.10";
7+in stdenv.mkDerivation rec {
8+ name = "volume_key-${version}";
9+
10+ src = fetchgit {
11+ url = https://pagure.io/volume_key.git;
12+ rev = "ece1ce305234da454e330905c615ec474d9781c5";
13+ sha256 = "16qdi5s6ycsh0iyc362gly7ggrwamky8i0zgbd4ajp3ymk9vqdva";
14+ };
15+
16+ outputs = [ "out" "man" "dev" ];
17+
18+ nativeBuildInputs = [ autoreconfHook pkgconfig gettext python2 swig ];
19+
20+ buildInputs = [ glib cryptsetup nss utillinux gpgme ];
21+
22+ patches = [
23+ # Use pkg-config for locating Python.h
24+ # https://pagure.io/volume_key/pull-request/12
25+ (fetchpatch {
26+ url = https://pagure.io/fork/cathay4t/volume_key/c/8eda66d3b734ea335e37cf9d7d173b9e8ebe2fd9.patch;
27+ sha256 = "01lr1zijk0imkk681zynm4w5ad3y6c9vdrmrzaib7w7ima75iczr";
28+ })
29+ ];
30+
31+ meta = with stdenv.lib; {
32+ description = "A library for manipulating storage volume encryption keys and storing them separately from volumes to handle forgotten passphrases, and the associated command-line tool";
33+ homepage = https://pagure.io/volume_key/;
34+ license = licenses.gpl2;
35+ maintainers = with maintainers; [];
36+ platforms = platforms.linux;
37+ };
38+}
pkgs/os-specific/linux/udisks/2-default.nix+47−33
@@ -1,43 +1,55 @@
1−{ stdenv, fetchurl, pkgconfig, intltool, gnused
2−, expat, acl, systemd, glib, libatasmart, polkit
3−, libxslt, docbook_xsl, utillinux, mdadm, libgudev
4−, gobjectIntrospection
1+{ stdenv, fetchFromGitHub, substituteAll, libtool, pkgconfig, intltool, gnused
2+, gnome3, gtk-doc, acl, systemd, glib, libatasmart, polkit, coreutils, bash
3+, expat, libxslt, docbook_xsl, utillinux, mdadm, libgudev, libblockdev, parted
4+, gobjectIntrospection, docbook_xml_dtd_412, docbook_xml_dtd_43
5+, libxfs, f2fs-tools, dosfstools, e2fsprogs, btrfs-progs, exfat, nilfs-utils, udftools, ntfs3g
56}:
67
7−stdenv.mkDerivation rec {
8− name = "udisks-2.1.8";
8+let
9+ version = "2.7.6";
10+in stdenv.mkDerivation rec {
11+ name = "udisks-${version}";
912
10− src = fetchurl {
11− url = "http://udisks.freedesktop.org/releases/${name}.tar.bz2";
12− sha256 = "1nkxhnqh39c9pzvm4zfj50rgv6apqawdx09bv3sfaxrah4a6jhfs";
13+ src = fetchFromGitHub {
14+ owner = "storaged-project";
15+ repo = "udisks";
16+ rev = name;
17+ sha256 = "16kf104vv2xbk8cdgaqygszcl69d7lz9gf3vmi7ggywn7nfbp2ks";
1318 };
1419
15− outputs = [ "out" "man" "dev" ];
20+ outputs = [ "out" "man" "dev" "devdoc" ];
1621
17− patches = [ ./force-path.patch ];
22+ patches = [
23+ (substituteAll {
24+ src = ./fix-paths.patch;
25+ bash = "${bash}/bin/bash";
26+ blkid = "${utillinux}/bin/blkid";
27+ false = "${coreutils}/bin/false";
28+ mdadm = "${mdadm}/bin/mdadm";
29+ sed = "${gnused}/bin/sed";
30+ sh = "${bash}/bin/sh";
31+ sleep = "${coreutils}/bin/sleep";
32+ true = "${coreutils}/bin/true";
33+ })
34+ (substituteAll {
35+ src = ./force-path.patch;
36+ path = stdenv.lib.makeBinPath [ btrfs-progs coreutils dosfstools e2fsprogs exfat f2fs-tools nilfs-utils libxfs ntfs3g parted utillinux ];
37+ })
38+ ];
1839
19− # FIXME remove /var/run/current-system/sw/* references
20− # FIXME add references to parted, cryptsetup, etc (see the sources)
21− postPatch =
22− ''
23− substituteInPlace src/main.c --replace \
24− "@path@" \
25− "${utillinux}/bin:${mdadm}/bin:/run/current-system/sw/bin"
26− substituteInPlace data/80-udisks2.rules \
27− --replace "/bin/sh" "${stdenv.shell}" \
28− --replace "/sbin/mdadm" "${mdadm}/bin/mdadm" \
29− --replace " sed " " ${gnused}/bin/sed "
30− '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
31− substituteInPlace udisks/udisksclient.c \
32− --replace 'defined( __GNUC_PREREQ)' 1 \
33− --replace '__GNUC_PREREQ(4,6)' 1
34− '';
40+ nativeBuildInputs = [
41+ pkgconfig gnome3.gnome-common libtool intltool gobjectIntrospection
42+ gtk-doc libxslt docbook_xml_dtd_412 docbook_xml_dtd_43 docbook_xsl
43+ ];
3544
36− nativeBuildInputs = [ pkgconfig intltool gobjectIntrospection ];
45+ buildInputs = [
46+ expat libgudev libblockdev acl systemd glib libatasmart polkit
47+ ];
3748
38− buildInputs = [ libxslt docbook_xsl libgudev expat acl systemd glib libatasmart polkit ];
49+ preConfigure = "./autogen.sh";
3950
4051 configureFlags = [
52+ "--enable-gtk-doc"
4153 "--localstatedir=/var"
4254 "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
4355 "--with-udevdir=$(out)/lib/udev"
@@ -50,9 +62,11 @@ stdenv.mkDerivation rec {
5062
5163 doCheck = false; # fails
5264
53− meta = {
54− homepage = http://www.freedesktop.org/wiki/Software/udisks;
55− description = "A daemon and command-line utility for querying and manipulating storage devices";
56− platforms = stdenv.lib.platforms.linux;
65+ meta = with stdenv.lib; {
66+ description = "A daemon, tools and libraries to access and manipulate disks, storage devices and technologies";
67+ homepage = https://www.freedesktop.org/wiki/Software/udisks/;
68+ license = licenses.gpl2Plus; # lgpl2Plus for the library, gpl2Plus for the tools & daemon
69+ maintainers = with maintainers; [];
70+ platforms = platforms.linux;
5771 };
5872}
pkgs/os-specific/linux/udisks/fix-paths.patchnew file+131
@@ -0,0 +1,131 @@
1+--- a/Makefile.am
2++++ b/Makefile.am
3+@@ -1,6 +1,6 @@
4+ ## Process this file with automake to produce Makefile.in
5+
6+-SHELL = /bin/bash
7++SHELL = @bash@
8+ .SHELLFLAGS = -o pipefail -c
9+
10+ PYTHON ?= python3
11+--- a/data/80-udisks2.rules
12++++ b/data/80-udisks2.rules
13+@@ -17,9 +17,9 @@
14+ #
15+ # TODO: file bug against mdadm(8) to have --export-prefix option that can be used with e.g. UDISKS_MD_MEMBER
16+ #
17+-SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="raid", ENV{ID_FS_TYPE}=="linux_raid_member", ENV{UDISKS_MD_MEMBER_LEVEL}=="", IMPORT{program}="/bin/sh -c '/sbin/mdadm --examine --export $tempnode | /bin/sed s/^MD_/UDISKS_MD_MEMBER_/g'"
18++SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="raid", ENV{ID_FS_TYPE}=="linux_raid_member", ENV{UDISKS_MD_MEMBER_LEVEL}=="", IMPORT{program}="@sh@ -c '@mdadm@ --examine --export $tempnode | @sed@ s/^MD_/UDISKS_MD_MEMBER_/g'"
19+
20+-SUBSYSTEM=="block", KERNEL=="md*", ENV{DEVTYPE}!="partition", IMPORT{program}="/bin/sh -c '/sbin/mdadm --detail --export $tempnode | /bin/sed s/^MD_/UDISKS_MD_/g'"
21++SUBSYSTEM=="block", KERNEL=="md*", ENV{DEVTYPE}!="partition", IMPORT{program}="@sh@ -c '@mdadm@ --detail --export $tempnode | @sed@ s/^MD_/UDISKS_MD_/g'"
22+
23+ LABEL="udisks_probe_end"
24+
25+--- a/modules/zram/udiskslinuxmanagerzram.c
26++++ b/modules/zram/udiskslinuxmanagerzram.c
27+@@ -250,7 +250,7 @@
28+
29+ g_snprintf (tmp, 255, "zram%" G_GUINT64_FORMAT, i);
30+ filename = g_build_filename (PACKAGE_ZRAMCONF_DIR, tmp, NULL);
31+- contents = g_strdup_printf ("#!/bin/bash\n\n"
32++ contents = g_strdup_printf ("#!@bash@\n\n"
33+ "ZRAM_NUM_STR=%" G_GUINT64_FORMAT "\n"
34+ "ZRAM_DEV_SIZE=%" G_GUINT64_FORMAT "\n"
35+ "SWAP=n\n",
36+--- a/src/tests/install-udisks/runtest.sh
37++++ b/src/tests/install-udisks/runtest.sh
38+@@ -1,4 +1,4 @@
39+-#!/bin/bash
40++#!@bash@
41+ # vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
42+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43+ #
44+--- a/src/tests/integration-test
45++++ b/src/tests/integration-test
46+@@ -414,7 +414,7 @@
47+ f.write('KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", '
48+ 'ATTRS{model}=="scsi_debug*", '
49+ 'ENV{ID_CDROM_MEDIA}=="?*", '
50+- 'IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"\n')
51++ 'IMPORT{program}="@blkid@ -o udev -p -u noraid $tempnode"\n')
52+ # reload udev
53+ subprocess.call('sync; pkill --signal HUP udevd || '
54+ 'pkill --signal HUP systemd-udevd',
55+@@ -1079,7 +1079,7 @@
56+ self.assertFalse(os.access(f, os.X_OK))
57+
58+ f = os.path.join(mount_point, 'simple.exe')
59+- shutil.copy('/bin/bash', f)
60++ shutil.copy('@bash@', f)
61+ self.assertTrue(os.access(f, os.R_OK))
62+ self.assertTrue(os.access(f, os.W_OK))
63+ self.assertTrue(os.access(f, os.X_OK))
64+@@ -1092,7 +1092,7 @@
65+ self.assertFalse(os.access(f, os.X_OK))
66+
67+ f = os.path.join(mount_point, 'subdir', 'subdir.exe')
68+- shutil.copy('/bin/bash', f)
69++ shutil.copy('@bash@', f)
70+ self.assertTrue(os.access(f, os.R_OK))
71+ self.assertTrue(os.access(f, os.W_OK))
72+ self.assertTrue(os.access(f, os.X_OK))
73+--- a/src/tests/storadectl/runtest.sh
74++++ b/src/tests/storadectl/runtest.sh
75+@@ -1,4 +1,4 @@
76+-#!/bin/bash
77++#!@bash@
78+ # vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
79+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80+ #
81+--- a/src/tests/test.c
82++++ b/src/tests/test.c
83+@@ -71,7 +71,7 @@
84+ {
85+ UDisksSpawnedJob *job;
86+
87+- job = udisks_spawned_job_new ("/bin/true", NULL, getuid (), geteuid (), NULL, NULL);
88++ job = udisks_spawned_job_new ("@true@", NULL, getuid (), geteuid (), NULL, NULL);
89+ udisks_spawned_job_start (job);
90+ _g_assert_signal_received (job, "completed", G_CALLBACK (on_completed_expect_success), NULL);
91+ g_object_unref (job);
92+@@ -84,10 +84,10 @@
93+ {
94+ UDisksSpawnedJob *job;
95+
96+- job = udisks_spawned_job_new ("/bin/false", NULL, getuid (), geteuid (), NULL, NULL);
97++ job = udisks_spawned_job_new ("@false@", NULL, getuid (), geteuid (), NULL, NULL);
98+ udisks_spawned_job_start (job);
99+ _g_assert_signal_received (job, "completed", G_CALLBACK (on_completed_expect_failure),
100+- (gpointer) "Command-line `/bin/false' exited with non-zero exit status 1: ");
101++ (gpointer) "Command-line `@false@' exited with non-zero exit status 1: ");
102+ g_object_unref (job);
103+ }
104+
105+@@ -119,7 +119,7 @@
106+
107+ cancellable = g_cancellable_new ();
108+ g_cancellable_cancel (cancellable);
109+- job = udisks_spawned_job_new ("/bin/true", NULL, getuid (), geteuid (), NULL, cancellable);
110++ job = udisks_spawned_job_new ("@true@", NULL, getuid (), geteuid (), NULL, cancellable);
111+ udisks_spawned_job_start (job);
112+ _g_assert_signal_received (job, "completed", G_CALLBACK (on_completed_expect_failure),
113+ (gpointer) "Operation was cancelled (g-io-error-quark, 19)");
114+@@ -145,7 +145,7 @@
115+ GCancellable *cancellable;
116+
117+ cancellable = g_cancellable_new ();
118+- job = udisks_spawned_job_new ("/bin/sleep 0.5", NULL, getuid (), geteuid (), NULL, cancellable);
119++ job = udisks_spawned_job_new ("@sleep@ 0.5", NULL, getuid (), geteuid (), NULL, cancellable);
120+ udisks_spawned_job_start (job);
121+ g_timeout_add (10, on_timeout, cancellable); /* 10 msec */
122+ g_main_loop_run (loop);
123+@@ -199,7 +199,7 @@
124+ {
125+ UDisksSpawnedJob *job;
126+
127+- job = udisks_spawned_job_new ("/bin/sleep 1000", NULL, getuid (), geteuid (), NULL, NULL /* GCancellable */);
128++ job = udisks_spawned_job_new ("@sleep@ 1000", NULL, getuid (), geteuid (), NULL, NULL /* GCancellable */);
129+ udisks_spawned_job_start (job);
130+ g_object_unref (job);
131+ }
pkgs/top-level/all-packages.nix+8
@@ -5516,6 +5516,8 @@ with pkgs;
55165516
55175517 vobsub2srt = callPackage ../tools/cd-dvd/vobsub2srt { };
55185518
5519+ volume_key = callPackage ../development/libraries/volume-key { };
5520+
55195521 vorbisgain = callPackage ../tools/misc/vorbisgain { };
55205522
55215523 vpnc = callPackage ../tools/networking/vpnc { };
@@ -9798,6 +9800,8 @@ with pkgs;
97989800
97999801 libbdplus = callPackage ../development/libraries/libbdplus { };
98009802
9803+ libblockdev = callPackage ../development/libraries/libblockdev { };
9804+
98019805 libblocksruntime = callPackage ../development/libraries/libblocksruntime { };
98029806
98039807 libbluray = callPackage ../development/libraries/libbluray { };
@@ -9808,6 +9812,8 @@ with pkgs;
98089812
98099813 libburn = callPackage ../development/libraries/libburn { };
98109814
9815+ libbytesize = callPackage ../development/libraries/libbytesize { };
9816+
98119817 libcaca = callPackage ../development/libraries/libcaca {
98129818 inherit (xorg) libX11 libXext;
98139819 };
@@ -10364,6 +10370,8 @@ with pkgs;
1036410370
1036510371 libmx = callPackage ../development/libraries/libmx { };
1036610372
10373+ libndctl = callPackage ../development/libraries/libndctl { };
10374+
1036710375 libnet = callPackage ../development/libraries/libnet { };
1036810376
1036910377 libnetfilter_conntrack = callPackage ../development/libraries/libnetfilter_conntrack { };