2017-12-21 03:40:34 +01:00
|
|
|
{ stdenv, fetchurl, lib, makeWrapper,
|
|
|
|
# build dependencies
|
|
|
|
alsaLib, atk, cairo, cups, dbus, expat, fontconfig,
|
2019-05-22 13:03:39 +02:00
|
|
|
freetype, gdk-pixbuf, glib, gnome2, nspr, nss, xorg,
|
2018-06-18 22:27:07 +02:00
|
|
|
glibc, systemd
|
2017-12-21 03:40:34 +01:00
|
|
|
}:
|
2013-11-30 16:27:42 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-12-21 03:40:34 +01:00
|
|
|
version = "3.0.4";
|
2015-03-31 04:59:04 +02:00
|
|
|
name = "pencil-${version}";
|
2013-11-30 16:27:42 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-12-21 03:40:34 +01:00
|
|
|
url = "http://pencil.evolus.vn/dl/V${version}/Pencil_${version}_amd64.deb";
|
|
|
|
sha256 = "58e2b794c615ea8715d8374f177e19c87f7071e359826ec34a59836d537a62fd";
|
2013-11-30 16:27:42 +01:00
|
|
|
};
|
|
|
|
|
2017-12-21 03:40:34 +01:00
|
|
|
sourceRoot = ".";
|
2013-11-30 16:27:42 +01:00
|
|
|
|
2017-12-21 03:40:34 +01:00
|
|
|
unpackCmd = ''
|
|
|
|
ar p "$src" data.tar.xz | tar xJ
|
|
|
|
'';
|
|
|
|
|
2018-06-18 22:27:07 +02:00
|
|
|
dontBuild = true;
|
2017-12-21 03:40:34 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2015-06-29 17:03:33 +02:00
|
|
|
|
2013-11-30 16:27:42 +01:00
|
|
|
installPhase = ''
|
2017-12-21 03:40:34 +01:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -R usr/share opt $out/
|
|
|
|
|
|
|
|
# fix the path in the desktop file
|
|
|
|
substituteInPlace \
|
|
|
|
$out/share/applications/pencil.desktop \
|
|
|
|
--replace /opt/ $out/opt/
|
|
|
|
|
|
|
|
# symlink the binary to bin/
|
|
|
|
ln -s $out/opt/Pencil/pencil $out/bin/pencil
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
preFixup = let
|
|
|
|
packages = [
|
|
|
|
alsaLib
|
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2019-05-22 13:03:39 +02:00
|
|
|
gdk-pixbuf
|
2017-12-21 03:40:34 +01:00
|
|
|
glib
|
|
|
|
gnome2.GConf
|
|
|
|
gnome2.gtk
|
|
|
|
gnome2.pango
|
|
|
|
nspr
|
|
|
|
nss
|
2018-03-13 11:16:03 +01:00
|
|
|
xorg.libX11
|
|
|
|
xorg.libXScrnSaver
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXtst
|
2017-12-21 03:40:34 +01:00
|
|
|
stdenv.cc.cc.lib
|
|
|
|
stdenv.cc.cc
|
|
|
|
glibc
|
|
|
|
];
|
|
|
|
libPathNative = lib.makeLibraryPath packages;
|
|
|
|
libPath64 = lib.makeSearchPathOutput "lib" "lib64" packages;
|
|
|
|
libPath = "${libPathNative}:${libPath64}";
|
|
|
|
in ''
|
|
|
|
# patch executable
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${libPath}:$out/opt/Pencil" \
|
|
|
|
$out/opt/Pencil/pencil
|
|
|
|
|
|
|
|
# patch libnode
|
|
|
|
patchelf \
|
|
|
|
--set-rpath "${libPath}" \
|
|
|
|
$out/opt/Pencil/libnode.so
|
|
|
|
|
|
|
|
# libffmpeg is for some reason not executable
|
|
|
|
chmod a+x $out/opt/Pencil/libffmpeg.so
|
|
|
|
|
|
|
|
# fix missing libudev
|
2018-06-18 22:27:07 +02:00
|
|
|
ln -s ${systemd.lib}/lib/libudev.so.1 $out/opt/Pencil/libudev.so.1
|
2017-12-21 03:40:34 +01:00
|
|
|
wrapProgram $out/opt/Pencil/pencil \
|
|
|
|
--prefix LD_LIBRARY_PATH : $out/opt/Pencil
|
2013-11-30 16:27:42 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "GUI prototyping/mockup tool";
|
2017-12-21 03:40:34 +01:00
|
|
|
homepage = "https://pencil.evolus.vn/";
|
|
|
|
license = licenses.gpl2; # Commercial license is also available
|
|
|
|
maintainers = with maintainers; [ bjornfor prikhi mrVanDalo ];
|
|
|
|
platforms = platforms.linux;
|
2013-11-30 16:27:42 +01:00
|
|
|
};
|
|
|
|
}
|