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 9 , imagemagick 10 10 , netcat-gnu 11 11 , p7zip 12 - , python2 12 + , python3 13 13 , unzip 14 14 , wget 15 15 , wine ··· 22 22 , jq 23 23 , xorg 24 24 , libGL 25 + , steam-run-native 26 + # needed for avoiding crash on file selector 27 + , gsettings-desktop-schemas 25 28 }: 26 29 27 30 let ··· 54 57 ld64 = "${stdenv.cc}/nix-support/dynamic-linker"; 55 58 libs = pkgs: lib.makeLibraryPath [ xorg.libX11 libGL ]; 56 59 57 - python = python2.withPackages(ps: with ps; [ 58 - wxPython 60 + python = python3.withPackages(ps: with ps; [ 61 + wxPython_4_1 59 62 setuptools 63 + natsort 60 64 ]); 61 65 62 66 in stdenv.mkDerivation { ··· 68 72 sha256 = "0n40927c8cnjackfns68zwl7h4d7dvhf7cyqdkazzwwx4k2xxvma"; 69 73 }; 70 74 75 + patches = [ 76 + ./0001-fix-locale.patch 77 + ]; 78 + 71 79 nativeBuildInputs = [ makeWrapper ]; 72 80 81 + preBuild = '' 82 + makeFlagsArray+=(PYTHON="python -m py_compile") 83 + ''; 84 + 73 85 buildInputs = [ 74 86 xorg.libX11 75 87 libGL ··· 77 89 ]; 78 90 79 91 postPatch = '' 92 + substituteAllInPlace python/lib/lng.py 80 93 patchShebangs python tests/python 81 94 sed -i "s/ %F//g" etc/PlayOnLinux.desktop 82 95 ''; ··· 87 100 88 101 install -D -m644 etc/PlayOnLinux.desktop $out/share/applications/playonlinux.desktop 89 102 90 - makeWrapper $out/share/playonlinux/playonlinux $out/bin/playonlinux \ 91 - --prefix PATH : ${binpath} 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 92 113 93 114 bunzip2 $out/share/playonlinux/bin/check_dd_x86.bz2 94 115 patchelf --set-interpreter $(cat ${ld32}) --set-rpath ${libs pkgsi686Linux} $out/share/playonlinux/bin/check_dd_x86 ··· 107 128 description = "GUI for managing Windows programs under linux"; 108 129 homepage = "https://www.playonlinux.com/"; 109 130 license = licenses.gpl3; 110 - maintainers = [ maintainers.a1russell ]; 131 + maintainers = [ maintainers.pasqui23 ]; 111 132 platforms = [ "x86_64-linux" "i686-linux" ]; 112 133 }; 113 134 }