unscii: fix Darwin build

This commit is contained in:
OPNA2608 2021-06-14 02:23:25 +01:00 committed by matthewcroughan
parent fb41ef3aaf
commit 27ad6c8f2d

View file

@ -2,6 +2,11 @@
, fontforge, SDL, SDL_image, mkfontscale
}:
let
perlenv = perl.withPackages (p: with p; [
TextCharWidth
]);
in
stdenv.mkDerivation rec {
pname = "unscii";
version = "1.1";
@ -12,11 +17,23 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs =
[ (perl.withPackages (p: [ p.TextCharWidth ]))
[ perlenv
bdftopcf fontforge SDL SDL_image
mkfontscale
];
# Fixes shebang -> wrapper problem on Darwin
postPatch = ''
for perltool in *.pl; do
substituteInPlace Makefile \
--replace "./$perltool" "${perlenv}/bin/perl ./$perltool"
done
'';
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
];
preConfigure = ''
patchShebangs .
'';