3
0
Fork 0
forked from mirrors/nixpkgs

* util-linux: added an option to build just mount/umount, and an

option to set the path to the mount helpers programs
  (mount.<fstype>) to something other than /sbin.  Needed in NixOS to
  get the mount command to work for NTFS-3G, CIFS, etc.

svn path=/nixpkgs/trunk/; revision=12514
This commit is contained in:
Eelco Dolstra 2008-08-06 15:27:50 +00:00
parent 63b9500b88
commit 0a884b25f9

View file

@ -1,7 +1,15 @@
{stdenv, fetchurl, ncurses ? null}:
{ stdenv, fetchurl, ncurses ? null
, # Build mount/umount only.
buildMountOnly ? false
, # A directory containing mount helpers programs
# (i.e. `mount.<fstype>') to be used instead of /sbin.
mountHelpers ? null
}:
stdenv.mkDerivation {
name = "util-linux-2.13-pre7";
name = (if buildMountOnly then "mount-" else "") + "util-linux-2.13-pre7";
src = fetchurl {
url = mirror://kernel/linux/utils/util-linux/testing/util-linux-2.13-pre7.tar.bz2;
@ -21,10 +29,28 @@ stdenv.mkDerivation {
buildInputs = stdenv.lib.optional (ncurses != null) ncurses;
preBuild = ''
inherit mountHelpers;
preConfigure = ''
makeFlagsArray=(usrbinexecdir=$out/bin usrsbinexecdir=$out/sbin datadir=$out/share exampledir=$out/share/getopt)
if test -n "$mountHelpers"; then
substituteInPlace mount/mount.c --replace /sbin/mount. $mountHelpers/mount.
substituteInPlace mount/umount.c --replace /sbin/umount. $mountHelpers/umount.
fi
'';
buildPhase =
if buildMountOnly then ''
make "''${makeFlagsArray[@]}" -C lib
make "''${makeFlagsArray[@]}" -C mount
'' else "";
installPhase =
if buildMountOnly then ''
make "''${makeFlagsArray[@]}" -C lib install
make "''${makeFlagsArray[@]}" -C mount install
'' else "";
# Hack to get static builds to work.
NIX_CFLAGS_COMPILE = "-DHAVE___PROGNAME=1";
}