udevil: refactor and fix #35650
This commit is contained in:
parent
5ef8322daa
commit
ec5c081715
|
@ -1,12 +1,20 @@
|
||||||
{ lib, stdenv, fetchurl, intltool, glib, pkg-config, udev, util-linux, acl }:
|
{ lib, stdenv, fetchFromGitHub, intltool, glib, pkg-config, udev, util-linux, acl }:
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "udevil-0.4.4";
|
stdenv.mkDerivation rec {
|
||||||
src = fetchurl {
|
pname = "udevil";
|
||||||
url = "https://github.com/IgnorantGuru/udevil/archive/0.4.4.tar.gz";
|
version = "0.4.4";
|
||||||
sha256 = "0z1bhaayambrcn7bgnrqk445k50ifabmw8q4i9qj49nnbcvxhbxd";
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "IgnorantGuru";
|
||||||
|
repo = "udevil";
|
||||||
|
rev = version;
|
||||||
|
sha256 = "0nd44r8rbxifx4x4m24z5aji1c6k1fhw8cmf5s43wd5qys0bcdad";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
nativeBuildInputs = [ pkg-config ];
|
||||||
|
|
||||||
buildInputs = [ intltool glib udev ];
|
buildInputs = [ intltool glib udev ];
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
substituteInPlace src/Makefile.in --replace "-o root -g root" ""
|
substituteInPlace src/Makefile.in --replace "-o root -g root" ""
|
||||||
# do not set setuid bit in nix store
|
# do not set setuid bit in nix store
|
||||||
|
@ -19,11 +27,18 @@ stdenv.mkDerivation {
|
||||||
--with-setfacl-prog=${acl.bin}/bin/setfacl \
|
--with-setfacl-prog=${acl.bin}/bin/setfacl \
|
||||||
--sysconfdir=$prefix/etc
|
--sysconfdir=$prefix/etc
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
substituteInPlace $out/lib/systemd/system/devmon@.service \
|
||||||
|
--replace /usr/bin/devmon "$out/bin/devmon"
|
||||||
|
'';
|
||||||
|
|
||||||
patches = [ ./device-info-sys-stat.patch ];
|
patches = [ ./device-info-sys-stat.patch ];
|
||||||
meta = {
|
|
||||||
|
meta = with lib; {
|
||||||
description = "A command line Linux program which mounts and unmounts removable devices without a password, shows device info, and monitors device changes";
|
description = "A command line Linux program which mounts and unmounts removable devices without a password, shows device info, and monitors device changes";
|
||||||
homepage = "https://ignorantguru.github.io/udevil/";
|
homepage = "https://ignorantguru.github.io/udevil/";
|
||||||
platforms = lib.platforms.linux;
|
platforms = platforms.linux;
|
||||||
license = lib.licenses.gpl3;
|
license = licenses.gpl3Plus;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue