2013-11-10 13:30:01 +00:00
|
|
|
{ stdenv, fetchgit, udev, utillinux, mountPath ? "/media/" }:
|
|
|
|
|
|
|
|
assert mountPath != "";
|
|
|
|
|
|
|
|
let
|
2014-08-12 12:52:48 +01:00
|
|
|
version = "0.5";
|
2014-03-04 11:44:15 +00:00
|
|
|
git = https://github.com/LemonBoy/ldm.git;
|
2013-11-10 13:30:01 +00:00
|
|
|
in
|
2014-03-04 11:44:15 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ldm-${version}";
|
2013-11-10 13:30:01 +00: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 11:44:15 +00:00
|
|
|
url = meta.repositories.git;
|
2014-08-12 12:52:48 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
2016-06-02 12:26:44 +01:00
|
|
|
sha256 = "0lxfypnbamfx6p9ar5k9wra20gvwn665l4pp2j4vsx4yi5q7rw2n";
|
2013-11-10 13:30:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ udev utillinux ];
|
|
|
|
|
2016-02-22 00:21:26 +00:00
|
|
|
postPatch = ''
|
2013-11-10 13:30:01 +00:00
|
|
|
substituteInPlace ldm.c \
|
|
|
|
--replace "/mnt/" "${mountPath}"
|
2016-03-20 15:46:50 +00:00
|
|
|
sed '16i#include <sys/stat.h>' -i ldm.c
|
2013-11-10 13:30:01 +00:00
|
|
|
'';
|
|
|
|
|
2016-02-22 00:21:26 +00:00
|
|
|
buildFlags = "ldm";
|
2014-08-12 12:52:48 +01:00
|
|
|
|
2013-11-10 13:30:01 +00: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 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.mit;
|
2013-11-10 13:30:01 +00:00
|
|
|
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.the-kenny ];
|
2014-03-04 11:44:15 +00:00
|
|
|
repositories.git = git;
|
2013-11-10 13:30:01 +00:00
|
|
|
};
|
|
|
|
}
|