Merge pull request #225238 from Luflosi/swapspace-improvements
swapspace: patch paths to binaries and install systemd unit file
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, fetchFromGitHub, autoreconfHook, installShellFiles }:
|
||||
{ lib, stdenv, fetchFromGitHub, autoreconfHook, installShellFiles, util-linux }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "swapspace";
|
||||
@@ -16,8 +16,23 @@ stdenv.mkDerivation rec {
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace 'swapspace.service' \
|
||||
--replace '/usr/local/sbin/' "$out/bin/"
|
||||
substituteInPlace 'src/support.c' \
|
||||
--replace '/sbin/swapon' '${lib.getBin util-linux}/bin/swapon' \
|
||||
--replace '/sbin/swapoff' '${lib.getBin util-linux}/bin/swapoff'
|
||||
substituteInPlace 'src/swaps.c' \
|
||||
--replace 'mkswap' '${lib.getBin util-linux}/bin/mkswap'
|
||||
|
||||
# Don't create empty directory $out/var/lib/swapspace
|
||||
substituteInPlace 'Makefile.am' \
|
||||
--replace 'install-data-local:' 'do-not-execute:'
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
installManPage doc/swapspace.8
|
||||
install --mode=444 -D 'swapspace.service' "$out/etc/systemd/system/swapspace.service"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
@@ -25,6 +40,6 @@ stdenv.mkDerivation rec {
|
||||
homepage = "https://github.com/Tookmund/Swapspace";
|
||||
license = licenses.gpl2Only;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ misuzu ];
|
||||
maintainers = with maintainers; [ misuzu Luflosi ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user