mirror of
https://codeberg.org/spire/nix.git
synced 2026-11-30 11:30:45 +01:00
move sourcemod stuff to it's own directory
This commit is contained in:
parent
602c5b60bd
commit
46ff4c570f
12 changed files with 18 additions and 14 deletions
57
nix/sourcemod/metamod-source.nix
Normal file
57
nix/sourcemod/metamod-source.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
multiStdenv,
|
||||
fetchFromGitHub,
|
||||
ambuild,
|
||||
git,
|
||||
fetchpatch2,
|
||||
symlinkJoin,
|
||||
sdks ? {},
|
||||
}: let
|
||||
inherit (builtins) attrNames concatStringsSep attrValues;
|
||||
sdkNames = attrNames sdks;
|
||||
combinedSdks = symlinkJoin {
|
||||
name = "hl2sdk-${concatStringsSep "-" (attrNames sdks)}";
|
||||
paths = attrValues sdks;
|
||||
};
|
||||
in
|
||||
multiStdenv.mkDerivation (finalAttrs: {
|
||||
pname = "metamod-source";
|
||||
version = "1.12.0.1224";
|
||||
|
||||
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 ${concatStringsSep "," sdkNames} --hl2sdk-root=${combinedSdks} --disable-auto-versioning
|
||||
ambuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
mv package $out/share
|
||||
cp -r $src $out/include
|
||||
'';
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue