p910nd: cleanups

This commit is contained in:
Peter Hoeg 2021-06-18 17:39:18 +08:00
parent d210469dd7
commit fae17c4fe0

View file

@ -1,28 +1,29 @@
{ lib, stdenv, fetchurl }:
{ lib, stdenv, fetchFromGitHub, installShellFiles }:
stdenv.mkDerivation rec {
pname = "p910nd";
version = "0.97";
src = fetchurl {
sha256 = "0vy2qf386dif1nqznmy3j953mq7c4lk6j2hgyzkbmfi4msiq1jaa";
url = "mirror://sourceforge/p910nd/${pname}-${version}.tar.bz2";
src = fetchFromGitHub {
owner = "kenyapcomau";
repo = "p910nd";
rev = version;
hash = "sha256-MM4o7d3L3XIRYWJ/KPM2OltlVfVA/BgMuyhJMm/BS3c=";
};
postPatch = ''
substituteInPlace Makefile --replace "/usr" ""
substituteInPlace Makefile --replace "gcc" "${stdenv.cc.targetPrefix}cc"
'';
nativeBuildInputs = [ installShellFiles ];
makeFlags = [ "DESTDIR=$(out)" "BINDIR=/bin" ];
enableParallelBuilding = true;
postInstall = ''
# Match the man page:
mv $out/etc/init.d/p910nd{,.sh}
# instead of mucking around with the Makefile, just install the bits we need
installPhase = ''
runHook preInstall
# The legacy init script is useful only (and even then...) as an example:
mkdir -p $out/share/doc/examples
mv $out/etc $out/share/doc/examples
install -Dm555 -t $out/bin p910nd
install -Dm444 -t $out/share/doc/p910nd *.md
installManPage p910nd.?
runHook postInstall
'';
meta = with lib; {
@ -37,9 +38,9 @@ stdenv.mkDerivation rec {
the AppSocket protocol and has the scheme socket://. LPRng also supports
this protocol and the syntax is lp=remotehost%9100 in /etc/printcap.
'';
homepage = "http://p910nd.sourceforge.net/";
downloadPage = "https://sourceforge.net/projects/p910nd/";
license = licenses.gpl2;
homepage = "https://github.com/kenyapcomau/p910nd";
license = licenses.gpl2Only;
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.unix;
};
}