playonlinux: making it work at runtime (#112093)

playonlinux: GSettings schemas necessary to avoid crash on file dialog
playonlinux: adding steam-run to exec downloaded wine

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

authored by

pasqui23
Sandro
and committed by
GitHub
ae1f9d38 e69517f1

+44 -6
+17
pkgs/applications/misc/playonlinux/0001-fix-locale.patch
···
··· 1 + diff --git a/python/lib/lng.py b/python/lib/lng.py 2 + index a390d920..00c3527e 100755 3 + --- a/python/lib/lng.py 4 + +++ b/python/lib/lng.py 5 + @@ -12,11 +12,7 @@ class Lang(object): 6 + 7 + class iLang(object): 8 + def __init__(self): 9 + - if(os.environ["DEBIAN_PACKAGE"] == "TRUE"): 10 + - languages = os.listdir('/usr/share/locale') 11 + - else: 12 + - languages = os.listdir(Variables.playonlinux_env+'/lang/locale') 13 + - 14 + + languages = os.listdir('@out@/share/playonlinux/lang/locale') 15 + if(os.environ["POL_OS"] == "Mac"): 16 + wxLocale = wx.Locale().FindLanguageInfo(os.environ["RLANG"]) 17 +
+27 -6
pkgs/applications/misc/playonlinux/default.nix
··· 9 , imagemagick 10 , netcat-gnu 11 , p7zip 12 - , python2 13 , unzip 14 , wget 15 , wine ··· 22 , jq 23 , xorg 24 , libGL 25 }: 26 27 let ··· 54 ld64 = "${stdenv.cc}/nix-support/dynamic-linker"; 55 libs = pkgs: lib.makeLibraryPath [ xorg.libX11 libGL ]; 56 57 - python = python2.withPackages(ps: with ps; [ 58 - wxPython 59 setuptools 60 ]); 61 62 in stdenv.mkDerivation { ··· 68 sha256 = "0n40927c8cnjackfns68zwl7h4d7dvhf7cyqdkazzwwx4k2xxvma"; 69 }; 70 71 nativeBuildInputs = [ makeWrapper ]; 72 73 buildInputs = [ 74 xorg.libX11 75 libGL ··· 77 ]; 78 79 postPatch = '' 80 patchShebangs python tests/python 81 sed -i "s/ %F//g" etc/PlayOnLinux.desktop 82 ''; ··· 87 88 install -D -m644 etc/PlayOnLinux.desktop $out/share/applications/playonlinux.desktop 89 90 - makeWrapper $out/share/playonlinux/playonlinux $out/bin/playonlinux \ 91 - --prefix PATH : ${binpath} 92 93 bunzip2 $out/share/playonlinux/bin/check_dd_x86.bz2 94 patchelf --set-interpreter $(cat ${ld32}) --set-rpath ${libs pkgsi686Linux} $out/share/playonlinux/bin/check_dd_x86 ··· 107 description = "GUI for managing Windows programs under linux"; 108 homepage = "https://www.playonlinux.com/"; 109 license = licenses.gpl3; 110 - maintainers = [ maintainers.a1russell ]; 111 platforms = [ "x86_64-linux" "i686-linux" ]; 112 }; 113 }
··· 9 , imagemagick 10 , netcat-gnu 11 , p7zip 12 + , python3 13 , unzip 14 , wget 15 , wine ··· 22 , jq 23 , xorg 24 , libGL 25 + , steam-run-native 26 + # needed for avoiding crash on file selector 27 + , gsettings-desktop-schemas 28 }: 29 30 let ··· 57 ld64 = "${stdenv.cc}/nix-support/dynamic-linker"; 58 libs = pkgs: lib.makeLibraryPath [ xorg.libX11 libGL ]; 59 60 + python = python3.withPackages(ps: with ps; [ 61 + wxPython_4_1 62 setuptools 63 + natsort 64 ]); 65 66 in stdenv.mkDerivation { ··· 72 sha256 = "0n40927c8cnjackfns68zwl7h4d7dvhf7cyqdkazzwwx4k2xxvma"; 73 }; 74 75 + patches = [ 76 + ./0001-fix-locale.patch 77 + ]; 78 + 79 nativeBuildInputs = [ makeWrapper ]; 80 81 + preBuild = '' 82 + makeFlagsArray+=(PYTHON="python -m py_compile") 83 + ''; 84 + 85 buildInputs = [ 86 xorg.libX11 87 libGL ··· 89 ]; 90 91 postPatch = '' 92 + substituteAllInPlace python/lib/lng.py 93 patchShebangs python tests/python 94 sed -i "s/ %F//g" etc/PlayOnLinux.desktop 95 ''; ··· 100 101 install -D -m644 etc/PlayOnLinux.desktop $out/share/applications/playonlinux.desktop 102 103 + makeWrapper $out/share/playonlinux/playonlinux{,-wrapper} \ 104 + --prefix PATH : ${binpath} \ 105 + --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/GConf 106 + # steam-run is needed to run the downloaded wine executables 107 + mkdir -p $out/bin 108 + cat > $out/bin/playonlinux <<EOF 109 + #!${stdenv.shell} -e 110 + exec ${steam-run-native}/bin/steam-run $out/share/playonlinux/playonlinux-wrapper "\$@" 111 + EOF 112 + chmod a+x $out/bin/playonlinux 113 114 bunzip2 $out/share/playonlinux/bin/check_dd_x86.bz2 115 patchelf --set-interpreter $(cat ${ld32}) --set-rpath ${libs pkgsi686Linux} $out/share/playonlinux/bin/check_dd_x86 ··· 128 description = "GUI for managing Windows programs under linux"; 129 homepage = "https://www.playonlinux.com/"; 130 license = licenses.gpl3; 131 + maintainers = [ maintainers.pasqui23 ]; 132 platforms = [ "x86_64-linux" "i686-linux" ]; 133 }; 134 }