summary refs log tree commit diff
path: root/pkgs/tools/misc
diff options
context:
space:
mode:
authorxeji <36407913+xeji@users.noreply.github.com>2018-05-31 22:15:47 +0200
committerGitHub <noreply@github.com>2018-05-31 22:15:47 +0200
commitf7a96aea20e2596c77679eaa116ec1fd69d1b0c9 (patch)
treec1b97ba37cddd199f889c2105923de3422ff1d42 /pkgs/tools/misc
parent0b6dd07980975cf0db8573241fca5933ec4dc0d5 (diff)
parentb8ea160bf374a8208278aaf627d539ff1de1ce76 (diff)
downloadnixlib-f7a96aea20e2596c77679eaa116ec1fd69d1b0c9.tar
nixlib-f7a96aea20e2596c77679eaa116ec1fd69d1b0c9.tar.gz
nixlib-f7a96aea20e2596c77679eaa116ec1fd69d1b0c9.tar.bz2
nixlib-f7a96aea20e2596c77679eaa116ec1fd69d1b0c9.tar.lz
nixlib-f7a96aea20e2596c77679eaa116ec1fd69d1b0c9.tar.xz
nixlib-f7a96aea20e2596c77679eaa116ec1fd69d1b0c9.tar.zst
nixlib-f7a96aea20e2596c77679eaa116ec1fd69d1b0c9.zip
Merge pull request #41133 from symphorien/os-prober
os-prober: fix dependencies for version >= 1.75
Diffstat (limited to 'pkgs/tools/misc')
-rw-r--r--pkgs/tools/misc/grub/2.0x.nix6
-rw-r--r--pkgs/tools/misc/os-prober/default.nix46
2 files changed, 21 insertions, 31 deletions
diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix
index 96ce38ea9e85..84c06a49f843 100644
--- a/pkgs/tools/misc/grub/2.0x.nix
+++ b/pkgs/tools/misc/grub/2.0x.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, fetchFromSavannah, autogen, flex, bison, python, autoconf, automake
 , gettext, ncurses, libusb, freetype, qemu, devicemapper, unifont, pkgconfig
+, fuse # only needed for grub-mount
 , zfs ? null
 , efiSupport ? false
 , zfsSupport ? true
@@ -47,7 +48,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ bison flex python pkgconfig ];
-  buildInputs = [ ncurses libusb freetype gettext devicemapper ]
+  buildInputs = [ ncurses libusb freetype gettext devicemapper fuse ]
     ++ optional doCheck qemu
     ++ optional zfsSupport zfs;
 
@@ -83,7 +84,8 @@ stdenv.mkDerivation rec {
 
   patches = [ ./fix-bash-completion.patch ];
 
-  configureFlags = optional zfsSupport "--enable-libzfs"
+  configureFlags = [ "--enable-grub-mount" ] # dep of os-prober
+    ++ optional zfsSupport "--enable-libzfs"
     ++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystemsBuild.${stdenv.system}.target}" "--program-prefix=" ]
     ++ optionals xenSupport [ "--with-platform=xen" "--target=${efiSystemsBuild.${stdenv.system}.target}"];
 
diff --git a/pkgs/tools/misc/os-prober/default.nix b/pkgs/tools/misc/os-prober/default.nix
index b879f621e142..c4a304e0d284 100644
--- a/pkgs/tools/misc/os-prober/default.nix
+++ b/pkgs/tools/misc/os-prober/default.nix
@@ -1,32 +1,27 @@
 { stdenv, fetchurl, makeWrapper,
-systemd, # udevadm
-busybox,
-coreutils, # os-prober desn't seem to work with pure busybox
-devicemapper, # lvs
-# optional dependencies
-cryptsetup ? null,
-libuuid ? null, # blkid and blockdev
-dmraid ? null,
-ntfs3g ? null
+# optional dependencies, the command(s) they provide
+coreutils,  # mktemp
+grub2,      # grub-mount and grub-probe
+cryptsetup, # cryptsetup
+libuuid,    # blkid and blockdev
+libudev,    # udevadm udevinfo
+ntfs3g      # ntfs3g
 }:
 
 stdenv.mkDerivation rec {
   version = "1.76";
   name = "os-prober-${version}";
   src = fetchurl {
-    url = "mirror://debian/pool/main/o/os-prober/os-prober_${version}.tar.xz";
-    sha256 = "1vb45i76bqivlghrq7m3n07qfmmq4wxrkplqx8gywj011rhq19fk";
+    url = "https://salsa.debian.org/philh/os-prober/-/archive/${version}/os-prober-${version}.tar.bz2";
+    sha256 = "07rw3092pckh21vx6y4hzqcn3wn4cqmwxaaiq100lncnhmszg11g";
   };
 
   buildInputs = [ makeWrapper ];
   installPhase = ''
     # executables
-    mkdir -p $out/bin
-    mkdir -p $out/lib
-    mkdir -p $out/share
-    cp os-prober linux-boot-prober $out/bin
-    cp newns $out/lib
-    cp common.sh $out/share
+    install -Dt $out/bin os-prober linux-boot-prober
+    install -Dt $out/lib newns
+    install -Dt $out/share common.sh
 
     # probes
     case "${stdenv.system}" in
@@ -36,8 +31,7 @@ stdenv.mkDerivation rec {
         *) ARCH=other;;
     esac;
     for probes in os-probes os-probes/mounted os-probes/init linux-boot-probes linux-boot-probes/mounted; do
-      mkdir -p $out/lib/$probes;
-      cp $probes/common/* $out/lib/$probes;
+      install -Dt $out/lib/$probes $probes/common/*;
       if [ -e "$probes/$ARCH" ]; then
         mkdir -p $out/lib/$probes
         cp -r $probes/$ARCH/* $out/lib/$probes;
@@ -57,21 +51,15 @@ stdenv.mkDerivation rec {
     done;
     for file in $out/bin/*; do
       wrapProgram $file \
-        --set LVM_SYSTEM_DIR ${devicemapper} \
-        --suffix PATH : "$out/bin${builtins.foldl' (x: y: x + ":" + y) "" (
-          map (x: (toString x) + "/bin") (
-            builtins.filter (x: x!=null)
-              [ devicemapper systemd coreutils cryptsetup libuuid dmraid ntfs3g busybox ]
-            )
-          )
-        }" \
+        --suffix PATH : ${stdenv.lib.makeBinPath [ grub2 libudev coreutils cryptsetup libuuid ntfs3g ]} \
         --run "[ -d /var/lib/os-prober ] || mkdir /var/lib/os-prober"
     done;
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Utility to detect other OSs on a set of drives";
     homepage = http://packages.debian.org/source/sid/os-prober;
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ symphorien ];
   };
 }