Merge pull request #45354 from markuskowa/xfig-pr

xfig: 3.2.5b -> 3.2.7a
This commit is contained in:
Michael Raskin 2018-08-20 05:22:46 +00:00 committed by GitHub
commit bc9082bf35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 63 deletions

View File

@ -654,6 +654,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
fullName = "wxWindows Library Licence, Version 3.1";
};
xfig = {
fullName = "xfig";
url = "http://mcj.sourceforge.net/authors.html#xfig";
};
zlib = spdx {
spdxId = "Zlib";
fullName = "zlib License";

View File

@ -0,0 +1,25 @@
{ stdenv, fetchurl, ghostscript, libpng } :
let
version = "3.2.7a";
in stdenv.mkDerivation {
name = "fig2dev-${version}";
src = fetchurl {
url = "mirror://sourceforge/mcj/fig2dev-${version}.tar.xz";
sha256 = "0a7vkfl38fvkhg3na5gr9c4fskas9wbs84y9djg85nzwbshik8mx";
};
buildInputs = [ libpng ];
GSEXE="${ghostscript}/bin/gs";
meta = with stdenv.lib; {
description = "Tool to convert Xfig files to other formats";
homepage = http://mcj.sourceforge.net/;
license = licenses.xfig;
platforms = platforms.linux;
};
}

View File

@ -1,28 +0,0 @@
source $stdenv/setup
makeFlags="XAWLIB=-lXaw3d BINDIR=$out/bin XAPPLOADDIR=$out/etc/X11/app-defaults LIBDIR=$out/lib/X11 XFIGDOCDIR=$out/share/doc/xfig MANPATH=$out/man"
# We need chmod +wx on dirs, not just chmod +w
dontMakeSourcesWritable=1
postUnpack() {
find . -type d -exec chmod +x '{}' \;
}
preBuild() {
echo "#define XAW3D" >> Imakefile.tmp
echo "#define XAW3D1_5E" >> Imakefile.tmp
cat Imakefile >> Imakefile.tmp
mv Imakefile.tmp Imakefile
xmkmf
sed -e 's@[$][$]m@-- &@g' -i Makefile
}
installPhase() {
make install.all $makeFlags
wrapProgram $out/bin/xfig \
--set XAPPLRESDIR $out/etc/X11/app-defaults
}
genericBuild

View File

@ -1,50 +1,42 @@
{ stdenv, fetchurl, makeWrapper, imake
, xlibsWrapper, libXpm, libXmu, libXi, libXp, Xaw3d, libpng, libjpeg}:
{ stdenv, fetchurl, xlibsWrapper, makeWrapper, libXpm
, libXmu, libXi, libXp, Xaw3d, fig2dev
}:
let version = "3.2.5b"; in
stdenv.mkDerivation {
let
version = "3.2.7a";
in stdenv.mkDerivation {
name = "xfig-${version}";
src = fetchurl {
url = "mirror://sourceforge/mcj/xfig.${version}.full.tar.gz";
sha256 = "1hl5x49sgc0vap411whhcq6qhvh4xbjg7jggv7ih9pplg5nwy0aw";
url = "mirror://sourceforge/mcj/xfig-${version}.tar.xz";
sha256 = "096zgp0bqnxhgxbrv2jjylrjz3pr4da0xxznlk2z7ffxr5pri2fa";
};
builder = ./builder.sh;
postPatch = ''
sed -i 's:"fig2dev":"${fig2dev}/bin/fig2dev":' src/main.c
'';
buildInputs = [xlibsWrapper libXpm libXmu libXi libXp Xaw3d libpng libjpeg];
postInstall = ''
mkdir -p $out/share/X11/app-defaults
cp app-defaults/* $out/share/X11/app-defaults
nativeBuildInputs = [ imake makeWrapper ];
wrapProgram $out/bin/xfig \
--set XAPPLRESDIR $out/share/X11/app-defaults
'';
hardeningDisable = [ "format" ];
enableParallelBuilding = true;
NIX_CFLAGS_COMPILE = "-I${libXpm.dev}/include/X11";
nativeBuildInputs = [ makeWrapper ];
patches =
let
debPrefix = "http://patch-tracker.debian.org/patch/series/dl/xfig/1:3.2.5.b-3";
in
[
(fetchurl {
url = "${debPrefix}/35_CVE-2010-4262.patch";
sha256 = "1pj669sz49wzjvvm96gwbnani7wqi0ijh21imqdzqw47qxdv7zp5";
})
(fetchurl {
url = "${debPrefix}/13_remove_extra_libs.patch";
sha256 = "1qb14ay0c8xrjzhi21jl7sl8mdzxardldzpnflkzml774bbpn8av";
})
(fetchurl {
url = "${debPrefix}/36_libpng15.patch";
sha256 = "0jd5bqj7sj9bbnxg2d0y6zmv4ka4qif2x4zc84ngdqga5433anvn";
})
];
buildInputs = [ xlibsWrapper libXpm libXmu libXi libXp Xaw3d ];
meta = {
meta = with stdenv.lib; {
description = "An interactive drawing tool for X11";
homepage = http://mcj.sourceforge.net/;
license = {
url = "http://mcj.sourceforge.net/authors.html#xfig";
};
platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux; # arbitrary choice
longDescription = ''
Note that you need to have the <literal>netpbm</literal> tools
in your path to export bitmaps.
'';
inherit (fig2dev.meta) license homepage platforms;
};
}

View File

@ -16166,6 +16166,8 @@ with pkgs;
fetchmail = callPackage ../applications/misc/fetchmail { };
fig2dev = callPackage ../applications/graphics/fig2dev { };
flacon = callPackage ../applications/audio/flacon { };
flexget = callPackage ../applications/networking/flexget { };