pencil: 2.0.21 -> 3.0.4

+87 -19
+87 -19
pkgs/applications/graphics/pencil/default.nix
··· 1 - { stdenv, fetchurl, makeWrapper, xulrunner }: 1 + { stdenv, fetchurl, lib, makeWrapper, 2 + # build dependencies 3 + alsaLib, atk, cairo, cups, dbus, expat, fontconfig, 4 + freetype, gdk_pixbuf, glib, gnome2, nspr, nss, xlibs, 5 + glibc, udev 6 + }: 2 7 3 8 stdenv.mkDerivation rec { 4 - version = "2.0.21"; 9 + version = "3.0.4"; 5 10 name = "pencil-${version}"; 6 11 7 12 src = fetchurl { 8 - url = "https://github.com/prikhi/pencil/releases/download/v${version}/Pencil-${version}-linux-pkg.tar.gz"; 9 - sha256 = "0xq3gczqy7gzf1997qxdql5z7qqk1vabr0rzgakmsi4dq2q4d3kq"; 13 + url = "http://pencil.evolus.vn/dl/V${version}/Pencil_${version}_amd64.deb"; 14 + sha256 = "58e2b794c615ea8715d8374f177e19c87f7071e359826ec34a59836d537a62fd"; 10 15 }; 11 16 12 - buildPhase = ""; 17 + sourceRoot = "."; 18 + 19 + unpackCmd = '' 20 + ar p "$src" data.tar.xz | tar xJ 21 + ''; 22 + 23 + buildPhase = ":"; 13 24 14 - buildInputs = [ makeWrapper ]; 25 + nativeBuildInputs = [ makeWrapper ]; 15 26 16 27 installPhase = '' 17 - mkdir -p "$out" 18 - cp -r usr/* "$out" 19 - sed -e "s|/usr/share/evolus-pencil|$out/share/evolus-pencil|" \ 20 - -i "$out/bin/pencil" 21 - sed -e "s|/usr/bin/pencil|$out/bin/pencil|" \ 22 - -e "s|Icon=.*|Icon=$out/share/evolus-pencil/skin/classic/icon.svg|" \ 23 - -i "$out/share/applications/pencil.desktop" 28 + mkdir -p $out/bin 29 + cp -R usr/share opt $out/ 30 + 31 + # fix the path in the desktop file 32 + substituteInPlace \ 33 + $out/share/applications/pencil.desktop \ 34 + --replace /opt/ $out/opt/ 24 35 25 - wrapProgram $out/bin/pencil \ 26 - --prefix PATH ":" ${xulrunner}/bin 36 + # symlink the binary to bin/ 37 + ln -s $out/opt/Pencil/pencil $out/bin/pencil 38 + ''; 39 + 40 + 41 + preFixup = let 42 + packages = [ 43 + alsaLib 44 + atk 45 + cairo 46 + cups 47 + dbus 48 + expat 49 + fontconfig 50 + freetype 51 + gdk_pixbuf 52 + glib 53 + gnome2.GConf 54 + gnome2.gtk 55 + gnome2.pango 56 + nspr 57 + nss 58 + xlibs.libX11 59 + xlibs.libXScrnSaver 60 + xlibs.libXcomposite 61 + xlibs.libXcursor 62 + xlibs.libXdamage 63 + xlibs.libXext 64 + xlibs.libXfixes 65 + xlibs.libXi 66 + xlibs.libXrandr 67 + xlibs.libXrender 68 + xlibs.libXtst 69 + stdenv.cc.cc.lib 70 + stdenv.cc.cc 71 + glibc 72 + ]; 73 + libPathNative = lib.makeLibraryPath packages; 74 + libPath64 = lib.makeSearchPathOutput "lib" "lib64" packages; 75 + libPath = "${libPathNative}:${libPath64}"; 76 + in '' 77 + # patch executable 78 + patchelf \ 79 + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 80 + --set-rpath "${libPath}:$out/opt/Pencil" \ 81 + $out/opt/Pencil/pencil 82 + 83 + # patch libnode 84 + patchelf \ 85 + --set-rpath "${libPath}" \ 86 + $out/opt/Pencil/libnode.so 87 + 88 + # libffmpeg is for some reason not executable 89 + chmod a+x $out/opt/Pencil/libffmpeg.so 90 + 91 + # fix missing libudev 92 + ln -s ${udev}/lib/systemd/libsystemd-shared.so $out/opt/Pencil/libudev.so.1 93 + wrapProgram $out/opt/Pencil/pencil \ 94 + --prefix LD_LIBRARY_PATH : $out/opt/Pencil 27 95 ''; 28 96 29 97 meta = with stdenv.lib; { 30 98 description = "GUI prototyping/mockup tool"; 31 - homepage = https://github.com/prikhi/pencil; 32 - license = licenses.gpl2; # Commercial license is also available 33 - maintainers = with maintainers; [ bjornfor prikhi ]; 34 - platforms = platforms.linux; 99 + homepage = "https://pencil.evolus.vn/"; 100 + license = licenses.gpl2; # Commercial license is also available 101 + maintainers = with maintainers; [ bjornfor prikhi mrVanDalo ]; 102 + platforms = platforms.linux; 35 103 }; 36 104 }