nixpkgs/pkgs/by-name/le/left4gore-bin/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

49 lines
1.1 KiB
Nix

{ stdenvNoCC, lib, fetchurl, buildFHSEnv }:
let
version = "2.3";
# Unwrapped package, for putting into the FHS env
left4gore-unwrapped = stdenvNoCC.mkDerivation {
pname = "left4gore-unwrapped";
inherit version;
src = fetchurl {
url = "http://www.left4gore.com/dist/left4gore-${version}-linux.tar.gz";
sha256 = "1n57nh32ybn6kirn8djh0nsjx6m84c0jfi1x8r4w2qr0qky3z7p0";
};
installPhase = ''
mkdir -p $out/bin
cp left4gore $out/bin
'';
};
# FHS env, as patchelf will not work
env = buildFHSEnv {
name = "left4gore-env-${version}";
targetPkgs = _: [ left4gore-unwrapped ];
runScript = "left4gore";
};
in stdenvNoCC.mkDerivation {
pname = "left4gore";
inherit version;
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
ln -s ${env}/bin/* $out/bin/left4gore
'';
meta = with lib; {
homepage = "http://www.left4gore.com";
description = "Memory patcher which adds the gore back into Left 4 Dead 2";
license = licenses.unfree; # Probably the best choice
maintainers = with maintainers; [ das_j ];
};
}