2021-02-03 04:05:49 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, xlibsWrapper
|
|
|
|
, makeWrapper
|
2022-03-22 16:13:41 +00:00
|
|
|
, imagemagick
|
2021-02-03 04:05:49 +00:00
|
|
|
, libXpm
|
|
|
|
, libXmu
|
|
|
|
, libXi
|
|
|
|
, libXp
|
|
|
|
, Xaw3d
|
|
|
|
, libXaw
|
|
|
|
, fig2dev
|
2018-08-18 22:00:04 +00:00
|
|
|
}:
|
2006-12-08 01:17:21 +00:00
|
|
|
|
2021-01-20 21:29:43 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "xfig";
|
2021-09-01 11:19:09 +00:00
|
|
|
version = "3.2.8b";
|
2006-12-08 01:17:21 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-08-18 22:00:04 +00:00
|
|
|
url = "mirror://sourceforge/mcj/xfig-${version}.tar.xz";
|
2021-09-01 11:19:09 +00:00
|
|
|
sha256 = "0fndgbm1mkqb1sn2v2kj3nx9mxj70jbp31y2bjvzcmmkry0q3k5j";
|
2006-12-08 01:17:21 +00:00
|
|
|
};
|
|
|
|
|
2022-03-22 16:13:41 +00:00
|
|
|
nativeBuildInputs = [ imagemagick makeWrapper ];
|
2021-02-03 04:05:49 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
xlibsWrapper
|
|
|
|
libXpm
|
|
|
|
libXmu
|
|
|
|
libXi
|
|
|
|
libXp
|
|
|
|
Xaw3d
|
|
|
|
libXaw
|
|
|
|
];
|
|
|
|
|
2018-08-18 22:00:04 +00:00
|
|
|
postPatch = ''
|
2022-03-22 16:13:41 +00:00
|
|
|
substituteInPlace src/main.c --replace '"fig2dev"' '"${fig2dev}/bin/fig2dev"'
|
|
|
|
substituteInPlace xfig.desktop --replace "/usr/bin/" "$out/bin/"
|
2018-08-18 22:00:04 +00:00
|
|
|
'';
|
2006-12-08 01:17:21 +00:00
|
|
|
|
2018-08-18 22:00:04 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/X11/app-defaults
|
|
|
|
cp app-defaults/* $out/share/X11/app-defaults
|
2012-01-02 15:29:14 +00:00
|
|
|
|
2018-08-18 22:00:04 +00:00
|
|
|
wrapProgram $out/bin/xfig \
|
|
|
|
--set XAPPLRESDIR $out/share/X11/app-defaults
|
2022-03-22 16:13:41 +00:00
|
|
|
|
|
|
|
mkdir -p $out/share/icons/hicolor/{16x16,22x22,48x48,64x64}/apps
|
|
|
|
|
|
|
|
for dimension in 16x16 22x22 48x48; do
|
|
|
|
convert doc/html/images/xfig-logo.png -geometry $dimension\
|
|
|
|
$out/share/icons/hicolor/16x16/apps/xfig.png
|
|
|
|
done
|
|
|
|
install doc/html/images/xfig-logo.png \
|
|
|
|
$out/share/icons/hicolor/64x64/apps/xfig.png
|
2018-08-18 22:00:04 +00:00
|
|
|
'';
|
2006-12-08 01:17:21 +00:00
|
|
|
|
2018-08-18 22:00:04 +00:00
|
|
|
enableParallelBuilding = true;
|
2016-02-20 22:00:56 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2006-12-08 01:17:21 +00:00
|
|
|
description = "An interactive drawing tool for X11";
|
2018-08-18 22:00:04 +00:00
|
|
|
longDescription = ''
|
|
|
|
Note that you need to have the <literal>netpbm</literal> tools
|
|
|
|
in your path to export bitmaps.
|
|
|
|
'';
|
2021-01-20 21:29:43 +00:00
|
|
|
inherit (fig2dev.meta) license homepage platforms maintainers;
|
2006-12-08 01:17:21 +00:00
|
|
|
};
|
|
|
|
}
|