2024-04-26 22:24:03 +02:00
|
|
|
{ stdenv, fetchurl, lib, makeWrapper, wrapGAppsHook3,
|
2017-12-21 03:40:34 +01:00
|
|
|
# build dependencies
|
2021-06-10 04:57:09 +02:00
|
|
|
alsa-lib, atk, at-spi2-atk, at-spi2-core, cairo, cups, dbus, expat, fontconfig,
|
2020-01-12 14:58:25 +01:00
|
|
|
freetype, gdk-pixbuf, glib, glibc, gtk3, libuuid, nspr, nss, pango,
|
|
|
|
xorg, systemd
|
2017-12-21 03:40:34 +01:00
|
|
|
}:
|
2020-01-12 14:58:25 +01:00
|
|
|
let
|
2013-11-30 16:27:42 +01:00
|
|
|
|
2020-01-12 14:58:25 +01:00
|
|
|
deps = [
|
2021-06-10 04:57:09 +02:00
|
|
|
alsa-lib
|
2020-01-12 14:58:25 +01:00
|
|
|
atk
|
|
|
|
at-spi2-atk
|
|
|
|
at-spi2-core
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
|
|
|
glibc
|
|
|
|
gtk3
|
|
|
|
libuuid
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
pango
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libxcb
|
|
|
|
xorg.libXScrnSaver
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXtst
|
|
|
|
stdenv.cc.cc.lib
|
|
|
|
stdenv.cc.cc
|
|
|
|
];
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
version = "3.1.0";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "pencil";
|
2013-11-30 16:27:42 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-01-12 14:58:25 +01:00
|
|
|
url = "http://pencil.evolus.vn/dl/V${version}.ga/pencil_${version}.ga_amd64.deb";
|
|
|
|
sha256 = "01ae54b1a1351b909eb2366c6ec00816e1deba370e58f35601cf7368f10aaba3";
|
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 = ''
|
2020-01-12 14:58:25 +01:00
|
|
|
ar p "$src" data.tar.gz | tar xz
|
2017-12-21 03:40:34 +01:00
|
|
|
'';
|
|
|
|
|
2018-06-18 22:27:07 +02:00
|
|
|
dontBuild = true;
|
2017-12-21 03:40:34 +01:00
|
|
|
|
2024-04-26 22:24:03 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper wrapGAppsHook3 ];
|
2020-01-12 14:58:25 +01:00
|
|
|
|
|
|
|
buildInputs = deps;
|
2015-06-29 17:03:33 +02:00
|
|
|
|
2013-11-30 16:27:42 +01:00
|
|
|
installPhase = ''
|
2020-01-12 14:58:25 +01:00
|
|
|
mkdir -p $out/bin $out/opt $out/share/applications
|
|
|
|
cp -R usr/share $out/
|
|
|
|
cp -R opt/pencil*/ $out/opt/pencil
|
|
|
|
cp $out/opt/pencil/pencil.desktop $out/share/applications/
|
2017-12-21 03:40:34 +01:00
|
|
|
|
|
|
|
# fix the path in the desktop file
|
|
|
|
substituteInPlace \
|
|
|
|
$out/share/applications/pencil.desktop \
|
|
|
|
--replace /opt/ $out/opt/
|
|
|
|
|
|
|
|
# symlink the binary to bin/
|
2020-01-12 14:58:25 +01:00
|
|
|
ln -s $out/opt/pencil/pencil $out/bin/pencil
|
2017-12-21 03:40:34 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
preFixup = let
|
2020-01-12 14:58:25 +01:00
|
|
|
packages = deps;
|
2017-12-21 03:40:34 +01:00
|
|
|
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)" \
|
2020-01-12 14:58:25 +01:00
|
|
|
--set-rpath "${libPath}:$out/opt/pencil" \
|
|
|
|
$out/opt/pencil/pencil
|
2017-12-21 03:40:34 +01:00
|
|
|
|
|
|
|
# fix missing libudev
|
2020-08-12 20:10:53 +02:00
|
|
|
ln -s ${lib.getLib systemd}/lib/libudev.so.1 $out/opt/pencil/libudev.so.1
|
2020-01-12 14:58:25 +01:00
|
|
|
wrapProgram $out/opt/pencil/pencil \
|
|
|
|
--prefix LD_LIBRARY_PATH : $out/opt/pencil
|
2013-11-30 16:27:42 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2013-11-30 16:27:42 +01:00
|
|
|
description = "GUI prototyping/mockup tool";
|
2024-03-19 03:14:51 +01:00
|
|
|
mainProgram = "pencil";
|
2017-12-21 03:40:34 +01:00
|
|
|
homepage = "https://pencil.evolus.vn/";
|
2022-06-05 00:19:25 +02:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2017-12-21 03:40:34 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|