pencil: 3.0.4 -> 3.1.0

This commit is contained in:
Flakebi 2020-01-12 14:58:25 +01:00 committed by Bjørn Forsman
parent 078f33b33b
commit 2ac5fab264

View file

@ -1,32 +1,72 @@
{ stdenv, fetchurl, lib, makeWrapper, { stdenv, fetchurl, lib, makeWrapper, wrapGAppsHook,
# build dependencies # build dependencies
alsaLib, atk, cairo, cups, dbus, expat, fontconfig, alsaLib, atk, at-spi2-atk, at-spi2-core, cairo, cups, dbus, expat, fontconfig,
freetype, gdk-pixbuf, glib, gnome2, nspr, nss, xorg, freetype, gdk-pixbuf, glib, glibc, gtk3, libuuid, nspr, nss, pango,
glibc, systemd xorg, systemd
}: }:
let
stdenv.mkDerivation rec { deps = [
version = "3.0.4"; alsaLib
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";
pname = "pencil"; pname = "pencil";
src = fetchurl { src = fetchurl {
url = "http://pencil.evolus.vn/dl/V${version}/Pencil_${version}_amd64.deb"; url = "http://pencil.evolus.vn/dl/V${version}.ga/pencil_${version}.ga_amd64.deb";
sha256 = "58e2b794c615ea8715d8374f177e19c87f7071e359826ec34a59836d537a62fd"; sha256 = "01ae54b1a1351b909eb2366c6ec00816e1deba370e58f35601cf7368f10aaba3";
}; };
sourceRoot = "."; sourceRoot = ".";
unpackCmd = '' unpackCmd = ''
ar p "$src" data.tar.xz | tar xJ ar p "$src" data.tar.gz | tar xz
''; '';
dontBuild = true; dontBuild = true;
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper wrapGAppsHook ];
buildInputs = deps;
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin $out/opt $out/share/applications
cp -R usr/share opt $out/ cp -R usr/share $out/
cp -R opt/pencil*/ $out/opt/pencil
cp $out/opt/pencil/pencil.desktop $out/share/applications/
# fix the path in the desktop file # fix the path in the desktop file
substituteInPlace \ substituteInPlace \
@ -34,42 +74,12 @@ stdenv.mkDerivation rec {
--replace /opt/ $out/opt/ --replace /opt/ $out/opt/
# symlink the binary to bin/ # symlink the binary to bin/
ln -s $out/opt/Pencil/pencil $out/bin/pencil ln -s $out/opt/pencil/pencil $out/bin/pencil
''; '';
preFixup = let preFixup = let
packages = [ packages = deps;
alsaLib
atk
cairo
cups
dbus
expat
fontconfig
freetype
gdk-pixbuf
glib
gnome2.GConf
gnome2.gtk
gnome2.pango
nspr
nss
xorg.libX11
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
glibc
];
libPathNative = lib.makeLibraryPath packages; libPathNative = lib.makeLibraryPath packages;
libPath64 = lib.makeSearchPathOutput "lib" "lib64" packages; libPath64 = lib.makeSearchPathOutput "lib" "lib64" packages;
libPath = "${libPathNative}:${libPath64}"; libPath = "${libPathNative}:${libPath64}";
@ -77,21 +87,13 @@ stdenv.mkDerivation rec {
# patch executable # patch executable
patchelf \ patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${libPath}:$out/opt/Pencil" \ --set-rpath "${libPath}:$out/opt/pencil" \
$out/opt/Pencil/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 # fix missing libudev
ln -s ${systemd.lib}/lib/libudev.so.1 $out/opt/Pencil/libudev.so.1 ln -s ${systemd.lib}/lib/libudev.so.1 $out/opt/pencil/libudev.so.1
wrapProgram $out/opt/Pencil/pencil \ wrapProgram $out/opt/pencil/pencil \
--prefix LD_LIBRARY_PATH : $out/opt/Pencil --prefix LD_LIBRARY_PATH : $out/opt/pencil
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {