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