26 # needed for avoiding crash on file selector
27 , gsettings-desktop-schemas
36 binpath = lib.makeBinPath [
57 if stdenv.hostPlatform.system == "x86_64-linux" then "${stdenv.cc}/nix-support/dynamic-linker-m32"
58 else if stdenv.hostPlatform.system == "i686-linux" then "${stdenv.cc}/nix-support/dynamic-linker"
59 else throw "Unsupported platform for PlayOnLinux: ${stdenv.hostPlatform.system}";
60 ld64 = "${stdenv.cc}/nix-support/dynamic-linker";
61 libs = pkgs: lib.makeLibraryPath [ xorg.libX11 libGL ];
63 python = python3.withPackages(ps: with ps; [
69 in stdenv.mkDerivation {
70 pname = "playonlinux";
74 url = "https://www.playonlinux.com/script_files/PlayOnLinux/${version}/PlayOnLinux_${version}.tar.gz";
75 sha256 = "0n40927c8cnjackfns68zwl7h4d7dvhf7cyqdkazzwwx4k2xxvma";
79 ./0001-fix-locale.patch
82 nativeBuildInputs = [ makeWrapper wrapGAppsHook ];
85 makeFlagsArray+=(PYTHON="python -m py_compile")
93 gsettings-desktop-schemas
98 substituteAllInPlace python/lib/lng.py
99 patchShebangs python tests/python
100 sed -i "s/ %F//g" etc/PlayOnLinux.desktop
104 install -d $out/share/playonlinux
105 cp -r . $out/share/playonlinux/
107 install -D -m644 etc/PlayOnLinux.desktop $out/share/applications/playonlinux.desktop
109 makeWrapper $out/share/playonlinux/playonlinux{,-wrapper} \
110 --prefix PATH : ${binpath} \
111 --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/GConf
112 # steam-run is needed to run the downloaded wine executables
114 cat > $out/bin/playonlinux <<EOF
116 exec ${steam-run}/bin/steam-run $out/share/playonlinux/playonlinux-wrapper "\$@"
118 chmod a+x $out/bin/playonlinux
120 bunzip2 $out/share/playonlinux/bin/check_dd_x86.bz2
121 patchelf --set-interpreter $(cat ${ld32}) --set-rpath ${libs pkgsi686Linux} $out/share/playonlinux/bin/check_dd_x86
122 ${if stdenv.hostPlatform.system == "x86_64-linux" then ''
123 bunzip2 $out/share/playonlinux/bin/check_dd_amd64.bz2
124 patchelf --set-interpreter $(cat ${ld64}) --set-rpath ${libs pkgs} $out/share/playonlinux/bin/check_dd_amd64
126 rm $out/share/playonlinux/bin/check_dd_amd64.bz2
128 for f in $out/share/playonlinux/bin/*; do
133 dontWrapGApps = true;
135 makeWrapper $out/share/playonlinux/playonlinux{,-wrapped} \
136 --prefix PATH : ${binpath} \
137 ''${gappsWrapperArgs[@]}
138 makeWrapper ${steam-run}/bin/steam-run $out/bin/playonlinux \
139 --add-flags $out/share/playonlinux/playonlinux-wrapped
143 description = "GUI for managing Windows programs under linux";
144 homepage = "https://www.playonlinux.com/";
145 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
146 license = licenses.gpl3;
147 maintainers = [ maintainers.pasqui23 ];
148 platforms = [ "x86_64-linux" "i686-linux" ];