1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
{ stdenv
, makeWrapper
, fetchurl
, cabextract
, gettext
, glxinfo
, gnupg1compat
, icoutils
, imagemagick
, netcat
, p7zip
, python2Packages
, unzip
, wget
, wine
, xdg-user-dirs
, xterm
, pkgs
, pkgsi686Linux
, which
, curl
}:
assert stdenv.isLinux;
let
version = "4.2.9";
binpath = stdenv.lib.makeSearchPath "bin"
[ cabextract
python2Packages.python
gettext
glxinfo
gnupg1compat
icoutils
imagemagick
netcat
p7zip
unzip
wget
wine
xdg-user-dirs
xterm
which
curl
];
ld32 =
if stdenv.system == "x86_64-linux" then "${stdenv.cc}/nix-support/dynamic-linker-m32"
else if stdenv.system == "i686-linux" then "${stdenv.cc}/nix-support/dynamic-linker"
else abort "Unsupported platform for PlayOnLinux: ${stdenv.system}";
ld64 = "${stdenv.cc}/nix-support/dynamic-linker";
libs = pkgs: stdenv.lib.makeLibraryPath [ pkgs.xlibs.libX11 ];
in stdenv.mkDerivation {
name = "playonlinux-${version}";
src = fetchurl {
url = "https://www.playonlinux.com/script_files/PlayOnLinux/${version}/PlayOnLinux_${version}.tar.gz";
sha256 = "89bb0fd7cce8cf598ebf38cad716b8587eaca5b916d54386fb24b3ff66b48624";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs =
[ python2Packages.python
python2Packages.wxPython
python2Packages.setuptools
];
patchPhase = ''
patchShebangs python tests/python
sed -i "s/ %F//g" etc/PlayOnLinux.desktop
'';
installPhase = ''
install -d $out/share/playonlinux
cp -r . $out/share/playonlinux/
install -D -m644 etc/PlayOnLinux.desktop $out/share/applications/playonlinux.desktop
makeWrapper $out/share/playonlinux/playonlinux $out/bin/playonlinux \
--prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath "$out") \
--prefix PATH : ${binpath}
bunzip2 $out/share/playonlinux/bin/check_dd_x86.bz2
patchelf --set-interpreter $(cat ${ld32}) --set-rpath ${libs pkgsi686Linux} $out/share/playonlinux/bin/check_dd_x86
${if stdenv.system == "x86_64-linux" then ''
bunzip2 $out/share/playonlinux/bin/check_dd_amd64.bz2
patchelf --set-interpreter $(cat ${ld64}) --set-rpath ${libs pkgs} $out/share/playonlinux/bin/check_dd_amd64
'' else ''
rm $out/share/playonlinux/bin/check_dd_amd64.bz2
''}
for f in $out/share/playonlinux/bin/*; do
bzip2 $f
done
'';
meta = with stdenv.lib; {
description = "GUI for managing Windows programs under linux";
homepage = https://www.playonlinux.com/;
license = licenses.gpl3;
maintainers = [ maintainers.a1russell ];
platforms = [ "x86_64-linux" "i686-linux" ];
};
}
|