nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 178 lines 4.0 kB view raw
1{ 2 lib, 3 stdenv_32bit, 4 makeWrapper, 5 fetchFromGitHub, 6 cabextract, 7 gettext, 8 gnupg, 9 icoutils, 10 imagemagick, 11 mesa-demos, 12 netcat-gnu, 13 p7zip, 14 python3, 15 unzip, 16 wget, 17 wine, 18 xdg-user-dirs, 19 xterm, 20 pkgs, 21 pkgsi686Linux, 22 which, 23 curl, 24 jq, 25 libx11, 26 libGL, 27 steam-run, 28 # needed for avoiding crash on file selector 29 gsettings-desktop-schemas, 30 glib, 31 wrapGAppsHook3, 32 hicolor-icon-theme, 33}: 34 35let 36 stdenv = stdenv_32bit; 37 38 binpath = lib.makeBinPath [ 39 cabextract 40 python 41 gettext 42 gnupg 43 icoutils 44 imagemagick 45 mesa-demos 46 netcat-gnu 47 p7zip 48 unzip 49 wget 50 wine 51 xdg-user-dirs 52 xterm 53 which 54 curl 55 jq 56 ]; 57 58 ld32 = 59 if stdenv.hostPlatform.system == "x86_64-linux" then 60 "${stdenv.cc}/nix-support/dynamic-linker-m32" 61 else if stdenv.hostPlatform.system == "i686-linux" then 62 "${stdenv.cc}/nix-support/dynamic-linker" 63 else 64 throw "Unsupported platform for PlayOnLinux: ${stdenv.hostPlatform.system}"; 65 ld64 = "${stdenv.cc}/nix-support/dynamic-linker"; 66 libs = 67 pkgs: 68 lib.makeLibraryPath [ 69 libx11 70 libGL 71 ]; 72 73 python = python3.withPackages ( 74 ps: with ps; [ 75 wxpython 76 setuptools 77 natsort 78 pyasyncore 79 ] 80 ); 81 82in 83stdenv.mkDerivation (finalAttrs: { 84 pname = "playonlinux"; 85 version = "4.4-unstable-2025-11-07"; 86 87 src = fetchFromGitHub { 88 owner = "PlayOnLinux"; 89 repo = "POL-POM-4"; 90 rev = "a91f598837b3d77ead6f418ec300fd4d284fdfa4"; 91 hash = "sha256-rFZ1+30aOgNH4G+i08lfy7dCoYmN7VFlG48zxHpXOQQ="; 92 }; 93 94 patches = [ 95 ./0001-fix-locale.patch 96 ]; 97 98 nativeBuildInputs = [ 99 makeWrapper 100 wrapGAppsHook3 101 ]; 102 103 preBuild = '' 104 makeFlagsArray+=(PYTHON="python -m py_compile") 105 ''; 106 107 buildInputs = [ 108 glib 109 libx11 110 libGL 111 python 112 gsettings-desktop-schemas 113 hicolor-icon-theme 114 ]; 115 116 postPatch = '' 117 substituteAllInPlace python/lib/lng.py 118 patchShebangs python tests/python 119 sed -i "s/ %F//g" etc/PlayOnLinux.desktop 120 ''; 121 122 installPhase = '' 123 install -d $out/share/playonlinux 124 cp -r . $out/share/playonlinux/ 125 126 install -D -m644 etc/PlayOnLinux.desktop $out/share/applications/playonlinux.desktop 127 128 makeWrapper $out/share/playonlinux/playonlinux{,-wrapper} \ 129 --prefix PATH : ${binpath} \ 130 --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/GConf 131 # steam-run is needed to run the downloaded wine executables 132 mkdir -p $out/bin 133 cat > $out/bin/playonlinux <<EOF 134 #!${stdenv.shell} -e 135 exec ${steam-run}/bin/steam-run $out/share/playonlinux/playonlinux-wrapper "\$@" 136 EOF 137 chmod a+x $out/bin/playonlinux 138 139 bunzip2 $out/share/playonlinux/bin/check_dd_x86.bz2 140 patchelf --set-interpreter $(cat ${ld32}) --set-rpath ${libs pkgsi686Linux} $out/share/playonlinux/bin/check_dd_x86 141 ${ 142 if stdenv.hostPlatform.system == "x86_64-linux" then 143 '' 144 bunzip2 $out/share/playonlinux/bin/check_dd_amd64.bz2 145 patchelf --set-interpreter $(cat ${ld64}) --set-rpath ${libs pkgs} $out/share/playonlinux/bin/check_dd_amd64 146 '' 147 else 148 '' 149 rm $out/share/playonlinux/bin/check_dd_amd64.bz2 150 '' 151 } 152 for f in $out/share/playonlinux/bin/*; do 153 bzip2 $f 154 done 155 ''; 156 157 dontWrapGApps = true; 158 postFixup = '' 159 makeWrapper $out/share/playonlinux/playonlinux{,-wrapped} \ 160 --prefix PATH : ${binpath} \ 161 ''${gappsWrapperArgs[@]} 162 makeWrapper ${steam-run}/bin/steam-run $out/bin/playonlinux \ 163 --add-flags $out/share/playonlinux/playonlinux-wrapped 164 ''; 165 166 meta = { 167 description = "GUI for managing Windows programs under linux"; 168 homepage = "https://www.playonlinux.com/"; 169 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 170 license = lib.licenses.gpl3; 171 maintainers = [ lib.maintainers.pasqui23 ]; 172 platforms = [ 173 "x86_64-linux" 174 "i686-linux" 175 ]; 176 mainProgram = "playonlinux"; 177 }; 178})