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; [
70 in stdenv.mkDerivation {
71 pname = "playonlinux";
75 url = "https://www.playonlinux.com/script_files/PlayOnLinux/${version}/PlayOnLinux_${version}.tar.gz";
76 sha256 = "0n40927c8cnjackfns68zwl7h4d7dvhf7cyqdkazzwwx4k2xxvma";
80 ./0001-fix-locale.patch
83 nativeBuildInputs = [ makeWrapper wrapGAppsHook3 ];
86 makeFlagsArray+=(PYTHON="python -m py_compile")
94 gsettings-desktop-schemas
99 substituteAllInPlace python/lib/lng.py
100 patchShebangs python tests/python
101 sed -i "s/ %F//g" etc/PlayOnLinux.desktop
105 install -d $out/share/playonlinux
106 cp -r . $out/share/playonlinux/
108 install -D -m644 etc/PlayOnLinux.desktop $out/share/applications/playonlinux.desktop
110 makeWrapper $out/share/playonlinux/playonlinux{,-wrapper} \
111 --prefix PATH : ${binpath} \
112 --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/GConf
113 # steam-run is needed to run the downloaded wine executables
115 cat > $out/bin/playonlinux <<EOF
117 exec ${steam-run}/bin/steam-run $out/share/playonlinux/playonlinux-wrapper "\$@"
119 chmod a+x $out/bin/playonlinux
121 bunzip2 $out/share/playonlinux/bin/check_dd_x86.bz2
122 patchelf --set-interpreter $(cat ${ld32}) --set-rpath ${libs pkgsi686Linux} $out/share/playonlinux/bin/check_dd_x86
123 ${if stdenv.hostPlatform.system == "x86_64-linux" then ''
124 bunzip2 $out/share/playonlinux/bin/check_dd_amd64.bz2
125 patchelf --set-interpreter $(cat ${ld64}) --set-rpath ${libs pkgs} $out/share/playonlinux/bin/check_dd_amd64
127 rm $out/share/playonlinux/bin/check_dd_amd64.bz2
129 for f in $out/share/playonlinux/bin/*; do
134 dontWrapGApps = true;
136 makeWrapper $out/share/playonlinux/playonlinux{,-wrapped} \
137 --prefix PATH : ${binpath} \
138 ''${gappsWrapperArgs[@]}
139 makeWrapper ${steam-run}/bin/steam-run $out/bin/playonlinux \
140 --add-flags $out/share/playonlinux/playonlinux-wrapped
144 description = "GUI for managing Windows programs under linux";
145 homepage = "https://www.playonlinux.com/";
146 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
147 license = licenses.gpl3;
148 maintainers = [ maintainers.pasqui23 ];
149 platforms = [ "x86_64-linux" "i686-linux" ];
150 mainProgram = "playonlinux";