2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
2022-03-30 09:31:56 +00:00
|
|
|
, imagemagick
|
2021-02-05 17:12:51 +00:00
|
|
|
, libXpm
|
|
|
|
, libXmu
|
|
|
|
, libXi
|
|
|
|
, libXp
|
|
|
|
, Xaw3d
|
|
|
|
, libXaw
|
2023-10-09 19:29:22 +00:00
|
|
|
, libXft
|
2021-02-05 17:12:51 +00:00
|
|
|
, fig2dev
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "xfig";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "3.2.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/mcj/xfig-${version}.tar.xz";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-E+2dBNG7wt7AnafvSc7sJ4OC0pD2zZJkdMLy0Bb+wvc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [ imagemagick makeWrapper ];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libXpm
|
|
|
|
libXmu
|
|
|
|
libXi
|
|
|
|
libXp
|
|
|
|
Xaw3d
|
|
|
|
libXaw
|
2023-10-09 19:29:22 +00:00
|
|
|
libXft
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
substituteInPlace src/main.c --replace '"fig2dev"' '"${fig2dev}/bin/fig2dev"'
|
|
|
|
substituteInPlace xfig.desktop --replace "/usr/bin/" "$out/bin/"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/X11/app-defaults
|
|
|
|
cp app-defaults/* $out/share/X11/app-defaults
|
|
|
|
|
|
|
|
wrapProgram $out/bin/xfig \
|
|
|
|
--set XAPPLRESDIR $out/share/X11/app-defaults
|
2022-03-30 09:31:56 +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
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://sourceforge.net/p/mcj/xfig/ci/${version}/tree/CHANGES";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Interactive drawing tool for X11";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "xfig";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
Note that you need to have the <literal>netpbm</literal> tools
|
|
|
|
in your path to export bitmaps.
|
|
|
|
'';
|
2021-02-05 17:12:51 +00:00
|
|
|
inherit (fig2dev.meta) license homepage platforms maintainers;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|