nixpkgs/pkgs/applications/misc/playonlinux/default.nix

114 lines
2.6 KiB
Nix
Raw Normal View History

2015-09-07 22:52:25 +01:00
{ stdenv
, makeWrapper
, fetchurl
, cabextract
, gettext
, glxinfo
, gnupg
2015-09-07 22:52:25 +01:00
, icoutils
, imagemagick
, netcat-gnu
2015-09-07 22:52:25 +01:00
, p7zip
2020-04-21 09:51:15 +01:00
, python2
2015-09-07 22:52:25 +01:00
, unzip
, wget
, wine
, xdg-user-dirs
, xterm
, pkgs
, pkgsi686Linux
, which
, curl
2019-02-25 19:37:23 +00:00
, jq
, xorg
, libGL
2015-09-07 22:52:25 +01:00
}:
let
2020-11-29 07:58:11 +00:00
version = "4.4";
2015-09-07 22:52:25 +01:00
2021-01-01 13:46:40 +00:00
binpath = stdenv.lib.makeBinPath [
2020-04-21 09:51:15 +01:00
cabextract
python
gettext
glxinfo
gnupg
icoutils
imagemagick
netcat-gnu
p7zip
unzip
wget
wine
xdg-user-dirs
xterm
which
curl
jq
];
2015-09-07 22:52:25 +01:00
ld32 =
if stdenv.hostPlatform.system == "x86_64-linux" then "${stdenv.cc}/nix-support/dynamic-linker-m32"
else if stdenv.hostPlatform.system == "i686-linux" then "${stdenv.cc}/nix-support/dynamic-linker"
else throw "Unsupported platform for PlayOnLinux: ${stdenv.hostPlatform.system}";
ld64 = "${stdenv.cc}/nix-support/dynamic-linker";
2019-03-06 22:53:24 +00:00
libs = pkgs: stdenv.lib.makeLibraryPath [ xorg.libX11 libGL ];
2020-04-21 09:51:15 +01:00
python = python2.withPackages(ps: with ps; [
wxPython
setuptools
]);
in stdenv.mkDerivation {
2019-08-13 22:52:01 +01:00
pname = "playonlinux";
inherit version;
src = fetchurl {
url = "https://www.playonlinux.com/script_files/PlayOnLinux/${version}/PlayOnLinux_${version}.tar.gz";
2020-11-29 07:58:11 +00:00
sha256 = "0n40927c8cnjackfns68zwl7h4d7dvhf7cyqdkazzwwx4k2xxvma";
};
nativeBuildInputs = [ makeWrapper ];
2021-01-01 13:46:40 +00:00
buildInputs = [
2020-04-21 09:51:15 +01:00
xorg.libX11
libGL
python
];
2020-04-21 09:51:15 +01:00
postPatch = ''
patchShebangs python tests/python
2015-09-07 22:52:25 +01:00
sed -i "s/ %F//g" etc/PlayOnLinux.desktop
'';
installPhase = ''
install -d $out/share/playonlinux
cp -r . $out/share/playonlinux/
install -D -m644 etc/PlayOnLinux.desktop $out/share/applications/playonlinux.desktop
makeWrapper $out/share/playonlinux/playonlinux $out/bin/playonlinux \
--prefix PATH : ${binpath}
2015-09-07 22:52:25 +01:00
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
${if stdenv.hostPlatform.system == "x86_64-linux" then ''
bunzip2 $out/share/playonlinux/bin/check_dd_amd64.bz2
patchelf --set-interpreter $(cat ${ld64}) --set-rpath ${libs pkgs} $out/share/playonlinux/bin/check_dd_amd64
'' else ''
rm $out/share/playonlinux/bin/check_dd_amd64.bz2
''}
2015-09-07 22:52:25 +01:00
for f in $out/share/playonlinux/bin/*; do
bzip2 $f
done
'';
meta = with stdenv.lib; {
description = "GUI for managing Windows programs under linux";
homepage = "https://www.playonlinux.com/";
2015-09-07 22:52:25 +01:00
license = licenses.gpl3;
maintainers = [ maintainers.a1russell ];
platforms = [ "x86_64-linux" "i686-linux" ];
2015-09-07 22:52:25 +01:00
};
}