nixpkgs-suyu/pkgs/tools/graphics/transfig/default.nix

62 lines
1.4 KiB
Nix
Raw Normal View History

2021-01-15 10:19:50 +01:00
{ lib, stdenv, fetchurl, zlib, libjpeg, libpng, imake, gccmakedep }:
2019-08-13 23:52:01 +02:00
stdenv.mkDerivation {
name = "transfig-3.2.4";
src = fetchurl {
url = "ftp://ftp.tex.ac.uk/pub/archive/graphics/transfig/transfig.3.2.4.tar.gz";
sha256 = "0429snhp5acbz61pvblwlrwv8nxr6gf12p37f9xxwrkqv4ir7dd4";
};
2018-11-28 04:40:57 +01:00
nativeBuildInputs = [ imake gccmakedep ];
buildInputs = [ zlib libjpeg libpng ];
2017-09-22 00:23:39 +02:00
patches = [
2020-05-26 06:50:37 +02:00
./patch-fig2dev-dev-Imakefile.patch
./patch-fig2dev-Imakefile.patch
./patch-transfig-Imakefile.patch
./patch-fig2dev-fig2dev.h.patch
./patch-fig2dev-dev-gensvg.c.patch
2017-09-22 00:23:39 +02:00
];
patchPhase = ''
runHook prePatch
configureImakefiles() {
local sedcmd=$1
sed "$sedcmd" fig2dev/Imakefile > tmpsed
cp tmpsed fig2dev/Imakefile
2015-12-23 02:59:47 +01:00
2017-09-22 00:23:39 +02:00
sed "$sedcmd" fig2dev/dev/Imakefile > tmpsed
cp tmpsed fig2dev/dev/Imakefile
2017-09-22 00:23:39 +02:00
sed "$sedcmd" transfig/Imakefile > tmpsed
cp tmpsed transfig/Imakefile
}
2017-09-22 00:23:39 +02:00
for i in $patches; do
header "applying patch $i" 3
patch -p0 < $i
stopNest
done
2017-09-22 00:23:39 +02:00
configureImakefiles "s:__PREFIX_PNG:${libpng}:"
configureImakefiles "s:__PREFIX:$out:"
2017-09-22 00:23:39 +02:00
runHook postPatch
'';
2018-11-28 04:40:57 +01:00
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
2017-09-22 00:23:39 +02:00
preInstall = ''
mkdir -p $out
mkdir -p $out/lib
'';
hardeningDisable = [ "format" ];
meta = {
2021-01-15 10:19:50 +01:00
platforms = lib.platforms.unix;
};
}