Merge pull request #150536 from OPNA2608/fix/fbcat/fbgrep

fbcat: small refactor, fix fbgrab dependencies
This commit is contained in:
Bobby Rong 2021-12-18 18:48:18 +08:00 committed by GitHub
commit 3829b5fe51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,8 @@
{ lib, stdenv, fetchFromGitHub } :
{ lib
, stdenv
, fetchFromGitHub
, netpbm
}:
stdenv.mkDerivation rec {
pname = "fbcat";
@ -11,17 +15,16 @@ stdenv.mkDerivation rec {
sha256 = "sha256-ORzcd8XGy2BfwuPK5UX+K5Z+FYkb+tdg/gHl3zHjvbk=";
};
# hardcoded because makefile target "install" depends on libxslt dependencies from network
# that are just too hard to monkeypatch here
# so this is the simple fix.
installPhase = ''
mkdir -p $out
install -d $out/bin
install -m755 fbcat $out/bin/
install -m755 fbgrab $out/bin/
install -d $out/share/man/man1
postPatch = ''
substituteInPlace fbgrab \
--replace 'pnmtopng' '${netpbm}/bin/pnmtopng' \
--replace 'fbcat' "$out/bin/fbcat"
'';
installFlags = [
"PREFIX=${placeholder "out"}"
];
meta = with lib; {
homepage = "http://jwilk.net/software/fbcat";
description = "Framebuffer screenshot tool";