mirror of
https://codeberg.org/spire/nix.git
synced 2026-11-30 03:20:47 +01:00
70 lines
1.6 KiB
Nix
70 lines
1.6 KiB
Nix
{
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
ambuild,
|
|
git,
|
|
fetchpatch2,
|
|
symlinkJoin,
|
|
nix-update-script,
|
|
}: sdks: let
|
|
inherit (builtins) attrNames concatStringsSep attrValues;
|
|
sdkNames = concatStringsSep "," (attrNames sdks);
|
|
combinedSdks = symlinkJoin {
|
|
name = "hl2sdk-${concatStringsSep "-" (attrNames sdks)}";
|
|
paths = attrValues sdks;
|
|
};
|
|
in
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "metamod-source";
|
|
version = "1.12.0.1224";
|
|
|
|
outputs = ["out" "dev"];
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation -Wno-error=ignored-attributes -Wno-error=template-id-cdtor";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "alliedmodders";
|
|
repo = finalAttrs.pname;
|
|
rev = finalAttrs.version;
|
|
sha256 = "sha256-zH1ww22D0Ksthl7aTVbegrO/dnLCyV7mz1CQ9SeyOBY=";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
patches = [
|
|
(fetchpatch2 {
|
|
url = "https://github.com/alliedmodders/metamod-source/commit/144fbb52c48f7b0b8ba6ad4c92f55c3f2ff20456.patch";
|
|
sha256 = "sha256-7Atz5n9nSkX+qw546t2IosA9mdgkg67kuyXcdnUc2Uc=";
|
|
})
|
|
];
|
|
|
|
buildInputs = [
|
|
ambuild
|
|
git
|
|
];
|
|
|
|
hardeningDisable = ["all"];
|
|
|
|
buildPhase = ''
|
|
mkdir build
|
|
cd build
|
|
python ../configure.py --sdks=${sdkNames} --hl2sdk-root=${combinedSdks} --disable-auto-versioning
|
|
ambuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
mv package $out
|
|
|
|
mkdir $dev
|
|
cp -r $src/public $dev/public
|
|
ln -s $dev/public $dev/include
|
|
'';
|
|
|
|
passthru = {
|
|
updateScript = nix-update-script {
|
|
extraArgs = [
|
|
"--flake"
|
|
"--use-github-releases"
|
|
];
|
|
};
|
|
};
|
|
})
|