2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2015-09-07 21:52:25 +00:00
|
|
|
, makeWrapper
|
|
|
|
, fetchurl
|
|
|
|
, cabextract
|
|
|
|
, gettext
|
|
|
|
, glxinfo
|
2019-03-20 18:23:30 +00:00
|
|
|
, gnupg
|
2015-09-07 21:52:25 +00:00
|
|
|
, icoutils
|
|
|
|
, imagemagick
|
2016-10-30 00:52:47 +00:00
|
|
|
, netcat-gnu
|
2015-09-07 21:52:25 +00:00
|
|
|
, p7zip
|
2021-02-24 23:34:19 +00:00
|
|
|
, python3
|
2015-09-07 21:52:25 +00:00
|
|
|
, unzip
|
|
|
|
, wget
|
|
|
|
, wine
|
|
|
|
, xdg-user-dirs
|
|
|
|
, xterm
|
2015-12-09 20:28:31 +00:00
|
|
|
, pkgs
|
|
|
|
, pkgsi686Linux
|
2015-12-27 04:01:58 +00:00
|
|
|
, which
|
|
|
|
, curl
|
2019-02-25 19:37:23 +00:00
|
|
|
, jq
|
2019-03-06 22:39:21 +00:00
|
|
|
, xorg
|
|
|
|
, libGL
|
2021-02-24 23:34:19 +00:00
|
|
|
, steam-run-native
|
|
|
|
# needed for avoiding crash on file selector
|
|
|
|
, gsettings-desktop-schemas
|
2015-09-07 21:52:25 +00:00
|
|
|
}:
|
|
|
|
|
2015-12-09 20:28:31 +00:00
|
|
|
let
|
2020-11-29 07:58:11 +00:00
|
|
|
version = "4.4";
|
2015-09-07 21:52:25 +00:00
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
binpath = lib.makeBinPath [
|
2020-04-21 08:51:15 +00:00
|
|
|
cabextract
|
|
|
|
python
|
|
|
|
gettext
|
|
|
|
glxinfo
|
|
|
|
gnupg
|
|
|
|
icoutils
|
|
|
|
imagemagick
|
|
|
|
netcat-gnu
|
|
|
|
p7zip
|
|
|
|
unzip
|
|
|
|
wget
|
|
|
|
wine
|
|
|
|
xdg-user-dirs
|
|
|
|
xterm
|
|
|
|
which
|
|
|
|
curl
|
|
|
|
jq
|
|
|
|
];
|
2015-09-07 21:52:25 +00:00
|
|
|
|
2015-12-09 20:28:31 +00:00
|
|
|
ld32 =
|
2018-08-20 19:11:29 +00:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then "${stdenv.cc}/nix-support/dynamic-linker-m32"
|
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then "${stdenv.cc}/nix-support/dynamic-linker"
|
|
|
|
else throw "Unsupported platform for PlayOnLinux: ${stdenv.hostPlatform.system}";
|
2015-12-09 20:28:31 +00:00
|
|
|
ld64 = "${stdenv.cc}/nix-support/dynamic-linker";
|
2021-01-15 05:42:41 +00:00
|
|
|
libs = pkgs: lib.makeLibraryPath [ xorg.libX11 libGL ];
|
2015-12-09 20:28:31 +00:00
|
|
|
|
2021-02-24 23:34:19 +00:00
|
|
|
python = python3.withPackages(ps: with ps; [
|
|
|
|
wxPython_4_1
|
2020-04-21 08:51:15 +00:00
|
|
|
setuptools
|
2021-02-24 23:34:19 +00:00
|
|
|
natsort
|
2020-04-21 08:51:15 +00:00
|
|
|
]);
|
|
|
|
|
2015-12-09 20:28:31 +00:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "playonlinux";
|
|
|
|
inherit version;
|
2015-12-09 20:28:31 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.playonlinux.com/script_files/PlayOnLinux/${version}/PlayOnLinux_${version}.tar.gz";
|
2020-11-29 07:58:11 +00:00
|
|
|
sha256 = "0n40927c8cnjackfns68zwl7h4d7dvhf7cyqdkazzwwx4k2xxvma";
|
2015-12-09 20:28:31 +00:00
|
|
|
};
|
|
|
|
|
2021-02-24 23:34:19 +00:00
|
|
|
patches = [
|
|
|
|
./0001-fix-locale.patch
|
|
|
|
];
|
|
|
|
|
2015-12-09 20:28:31 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2021-02-24 23:34:19 +00:00
|
|
|
preBuild = ''
|
|
|
|
makeFlagsArray+=(PYTHON="python -m py_compile")
|
|
|
|
'';
|
|
|
|
|
2021-01-01 13:46:40 +00:00
|
|
|
buildInputs = [
|
2020-04-21 08:51:15 +00:00
|
|
|
xorg.libX11
|
|
|
|
libGL
|
|
|
|
python
|
|
|
|
];
|
2015-12-09 20:28:31 +00:00
|
|
|
|
2020-04-21 08:51:15 +00:00
|
|
|
postPatch = ''
|
2021-02-24 23:34:19 +00:00
|
|
|
substituteAllInPlace python/lib/lng.py
|
2015-12-09 20:28:31 +00:00
|
|
|
patchShebangs python tests/python
|
2015-09-07 21:52:25 +00:00
|
|
|
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
|
|
|
|
|
2021-02-24 23:34:19 +00:00
|
|
|
makeWrapper $out/share/playonlinux/playonlinux{,-wrapper} \
|
|
|
|
--prefix PATH : ${binpath} \
|
|
|
|
--prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/GConf
|
|
|
|
# steam-run is needed to run the downloaded wine executables
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cat > $out/bin/playonlinux <<EOF
|
|
|
|
#!${stdenv.shell} -e
|
|
|
|
exec ${steam-run-native}/bin/steam-run $out/share/playonlinux/playonlinux-wrapper "\$@"
|
|
|
|
EOF
|
|
|
|
chmod a+x $out/bin/playonlinux
|
2015-09-07 21:52:25 +00:00
|
|
|
|
2015-12-09 20:28:31 +00:00
|
|
|
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
|
2018-08-20 19:11:29 +00:00
|
|
|
${if stdenv.hostPlatform.system == "x86_64-linux" then ''
|
2015-12-09 20:28:31 +00:00
|
|
|
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
|
|
|
|
''}
|
2015-09-07 21:52:25 +00:00
|
|
|
for f in $out/share/playonlinux/bin/*; do
|
|
|
|
bzip2 $f
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-09-07 21:52:25 +00:00
|
|
|
description = "GUI for managing Windows programs under linux";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.playonlinux.com/";
|
2015-09-07 21:52:25 +00:00
|
|
|
license = licenses.gpl3;
|
2021-02-24 23:34:19 +00:00
|
|
|
maintainers = [ maintainers.pasqui23 ];
|
2015-12-11 14:24:31 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2015-09-07 21:52:25 +00:00
|
|
|
};
|
|
|
|
}
|