4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
114 lines
2.6 KiB
Nix
114 lines
2.6 KiB
Nix
{ lib, stdenv
|
|
, makeWrapper
|
|
, fetchurl
|
|
, cabextract
|
|
, gettext
|
|
, glxinfo
|
|
, gnupg
|
|
, icoutils
|
|
, imagemagick
|
|
, netcat-gnu
|
|
, p7zip
|
|
, python2
|
|
, unzip
|
|
, wget
|
|
, wine
|
|
, xdg-user-dirs
|
|
, xterm
|
|
, pkgs
|
|
, pkgsi686Linux
|
|
, which
|
|
, curl
|
|
, jq
|
|
, xorg
|
|
, libGL
|
|
}:
|
|
|
|
let
|
|
version = "4.4";
|
|
|
|
binpath = stdenv.lib.makeBinPath [
|
|
cabextract
|
|
python
|
|
gettext
|
|
glxinfo
|
|
gnupg
|
|
icoutils
|
|
imagemagick
|
|
netcat-gnu
|
|
p7zip
|
|
unzip
|
|
wget
|
|
wine
|
|
xdg-user-dirs
|
|
xterm
|
|
which
|
|
curl
|
|
jq
|
|
];
|
|
|
|
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";
|
|
libs = pkgs: stdenv.lib.makeLibraryPath [ xorg.libX11 libGL ];
|
|
|
|
python = python2.withPackages(ps: with ps; [
|
|
wxPython
|
|
setuptools
|
|
]);
|
|
|
|
in stdenv.mkDerivation {
|
|
pname = "playonlinux";
|
|
inherit version;
|
|
|
|
src = fetchurl {
|
|
url = "https://www.playonlinux.com/script_files/PlayOnLinux/${version}/PlayOnLinux_${version}.tar.gz";
|
|
sha256 = "0n40927c8cnjackfns68zwl7h4d7dvhf7cyqdkazzwwx4k2xxvma";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [
|
|
xorg.libX11
|
|
libGL
|
|
python
|
|
];
|
|
|
|
postPatch = ''
|
|
patchShebangs python tests/python
|
|
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}
|
|
|
|
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
|
|
''}
|
|
for f in $out/share/playonlinux/bin/*; do
|
|
bzip2 $f
|
|
done
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "GUI for managing Windows programs under linux";
|
|
homepage = "https://www.playonlinux.com/";
|
|
license = licenses.gpl3;
|
|
maintainers = [ maintainers.a1russell ];
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
};
|
|
}
|