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>
This commit is contained in:
pasqui23 2021-02-25 00:34:19 +01:00 committed by GitHub
parent e69517f1e2
commit ae1f9d3820
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 6 deletions

View file

@ -0,0 +1,17 @@
diff --git a/python/lib/lng.py b/python/lib/lng.py
index a390d920..00c3527e 100755
--- a/python/lib/lng.py
+++ b/python/lib/lng.py
@@ -12,11 +12,7 @@ class Lang(object):
class iLang(object):
def __init__(self):
- if(os.environ["DEBIAN_PACKAGE"] == "TRUE"):
- languages = os.listdir('/usr/share/locale')
- else:
- languages = os.listdir(Variables.playonlinux_env+'/lang/locale')
-
+ languages = os.listdir('@out@/share/playonlinux/lang/locale')
if(os.environ["POL_OS"] == "Mac"):
wxLocale = wx.Locale().FindLanguageInfo(os.environ["RLANG"])

View file

@ -9,7 +9,7 @@
, imagemagick
, netcat-gnu
, p7zip
, python2
, python3
, unzip
, wget
, wine
@ -22,6 +22,9 @@
, jq
, xorg
, libGL
, steam-run-native
# needed for avoiding crash on file selector
, gsettings-desktop-schemas
}:
let
@ -54,9 +57,10 @@ let
ld64 = "${stdenv.cc}/nix-support/dynamic-linker";
libs = pkgs: lib.makeLibraryPath [ xorg.libX11 libGL ];
python = python2.withPackages(ps: with ps; [
wxPython
python = python3.withPackages(ps: with ps; [
wxPython_4_1
setuptools
natsort
]);
in stdenv.mkDerivation {
@ -68,8 +72,16 @@ in stdenv.mkDerivation {
sha256 = "0n40927c8cnjackfns68zwl7h4d7dvhf7cyqdkazzwwx4k2xxvma";
};
patches = [
./0001-fix-locale.patch
];
nativeBuildInputs = [ makeWrapper ];
preBuild = ''
makeFlagsArray+=(PYTHON="python -m py_compile")
'';
buildInputs = [
xorg.libX11
libGL
@ -77,6 +89,7 @@ in stdenv.mkDerivation {
];
postPatch = ''
substituteAllInPlace python/lib/lng.py
patchShebangs python tests/python
sed -i "s/ %F//g" etc/PlayOnLinux.desktop
'';
@ -87,8 +100,16 @@ in stdenv.mkDerivation {
install -D -m644 etc/PlayOnLinux.desktop $out/share/applications/playonlinux.desktop
makeWrapper $out/share/playonlinux/playonlinux $out/bin/playonlinux \
--prefix PATH : ${binpath}
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
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
@ -107,7 +128,7 @@ in stdenv.mkDerivation {
description = "GUI for managing Windows programs under linux";
homepage = "https://www.playonlinux.com/";
license = licenses.gpl3;
maintainers = [ maintainers.a1russell ];
maintainers = [ maintainers.pasqui23 ];
platforms = [ "x86_64-linux" "i686-linux" ];
};
}