2013-11-10 14:30:01 +01:00
|
|
|
{ stdenv, fetchgit, udev, utillinux, mountPath ? "/media/" }:
|
|
|
|
|
|
|
|
assert mountPath != "";
|
|
|
|
|
|
|
|
let
|
2014-08-12 13:52:48 +02:00
|
|
|
version = "0.5";
|
2014-03-04 12:44:15 +01:00
|
|
|
git = https://github.com/LemonBoy/ldm.git;
|
2013-11-10 14:30:01 +01:00
|
|
|
in
|
2014-03-04 12:44:15 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ldm-${version}";
|
2013-11-10 14:30:01 +01:00
|
|
|
|
|
|
|
# There is a stable release, but we'll use the lvm branch, which
|
|
|
|
# contains important fixes for LVM setups.
|
|
|
|
src = fetchgit {
|
2014-03-04 12:44:15 +01:00
|
|
|
url = meta.repositories.git;
|
2014-08-12 13:52:48 +02:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "0kkby3a0xgh1lmkbzpsi4am2rqjv3ccgdpic99aw1c76y0ca837y";
|
2013-11-10 14:30:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ udev utillinux ];
|
|
|
|
|
2016-02-22 01:21:26 +01:00
|
|
|
postPatch = ''
|
|
|
|
sed -i '1i#include <sys/stat.h>' ldm.c
|
2013-11-10 14:30:01 +01:00
|
|
|
substituteInPlace ldm.c \
|
|
|
|
--replace "/mnt/" "${mountPath}"
|
|
|
|
'';
|
|
|
|
|
2016-02-22 01:21:26 +01:00
|
|
|
buildFlags = "ldm";
|
2014-08-12 13:52:48 +02:00
|
|
|
|
2013-11-10 14:30:01 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -v ldm $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A lightweight device mounter, with libudev as only dependency";
|
2014-06-19 06:19:00 +02:00
|
|
|
license = stdenv.lib.licenses.mit;
|
2013-11-10 14:30:01 +01:00
|
|
|
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.the-kenny ];
|
2014-03-04 12:44:15 +01:00
|
|
|
repositories.git = git;
|
2013-11-10 14:30:01 +01:00
|
|
|
};
|
|
|
|
}
|