mirror of
https://codeberg.org/spire/nix.git
synced 2026-08-02 12:25:00 +02:00
update script for metamod-source
This commit is contained in:
parent
d6b69b4566
commit
1db5e3a001
4 changed files with 21 additions and 9 deletions
|
|
@ -40,10 +40,10 @@
|
||||||
|
|
||||||
perSystem = pkgs: {
|
perSystem = pkgs: {
|
||||||
sourcemods = pkgs.lib.mapAttrs (name: sdk: pkgs.sourcemod.override {sdks = {${name} = sdk;};}) pkgs.hl2sdk;
|
sourcemods = pkgs.lib.mapAttrs (name: sdk: pkgs.sourcemod.override {sdks = {${name} = sdk;};}) pkgs.hl2sdk;
|
||||||
metamods = pkgs.lib.mapAttrs (name: sdk: pkgs.metamod-source.override {sdks = {${name} = sdk;};}) pkgs.hl2sdk;
|
metamods = pkgs.lib.mapAttrs (name: sdk: pkgs.metamod-source-builder {${name} = sdk;}) pkgs.hl2sdk;
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = inheritPkgs ["ambuild" "hl2sdk" "sourcepawn" "sourcemod-includes" "sourcemod-include-library" "srcds-tf2"];
|
packages = inheritPkgs ["ambuild" "hl2sdk" "sourcepawn" "metamod-source" "sourcemod" "sourcemod-includes" "sourcemod-include-library" "srcds-tf2"];
|
||||||
|
|
||||||
checks = {
|
checks = {
|
||||||
buildTestScript = {pkgs, ...}:
|
buildTestScript = {pkgs, ...}:
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,9 @@
|
||||||
git,
|
git,
|
||||||
fetchpatch2,
|
fetchpatch2,
|
||||||
symlinkJoin,
|
symlinkJoin,
|
||||||
sdks ? {},
|
}: sdks: let
|
||||||
}: let
|
|
||||||
inherit (builtins) attrNames concatStringsSep attrValues;
|
inherit (builtins) attrNames concatStringsSep attrValues;
|
||||||
sdkNames = attrNames sdks;
|
sdkNames = concatStringsSep "," (attrNames sdks);
|
||||||
combinedSdks = symlinkJoin {
|
combinedSdks = symlinkJoin {
|
||||||
name = "hl2sdk-${concatStringsSep "-" (attrNames sdks)}";
|
name = "hl2sdk-${concatStringsSep "-" (attrNames sdks)}";
|
||||||
paths = attrValues sdks;
|
paths = attrValues sdks;
|
||||||
|
|
@ -45,7 +44,7 @@ in
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
python ../configure.py --sdks ${concatStringsSep "," sdkNames} --hl2sdk-root=${combinedSdks} --disable-auto-versioning
|
python ../configure.py --sdks=${sdkNames} --hl2sdk-root=${combinedSdks} --disable-auto-versioning
|
||||||
ambuild
|
ambuild
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ final: prev: {
|
||||||
inherit (final.stdenvNoCC) mkDerivation;
|
inherit (final.stdenvNoCC) mkDerivation;
|
||||||
};
|
};
|
||||||
ambuild = final.python3Packages.callPackage ./ambuild.nix {};
|
ambuild = final.python3Packages.callPackage ./ambuild.nix {};
|
||||||
metamod-source = final.callPackage ./metamod-source.nix {};
|
metamod-source = final.callPackage ./metamod-source.nix {} {};
|
||||||
|
metamod-source-builder = final.callPackage ./metamod-source.nix {};
|
||||||
sourcemod = final.callPackage ./sourcemod.nix {};
|
sourcemod = final.callPackage ./sourcemod.nix {};
|
||||||
sourcepawn = final.callPackage ./sourcepawn.nix {};
|
sourcepawn = final.callPackage ./sourcepawn.nix {};
|
||||||
sourcemod-includes = final.callPackage ./includes/sourcemod-includes.nix {};
|
sourcemod-includes = final.callPackage ./includes/sourcemod-includes.nix {};
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
#! /usr/bin/env nu
|
#! /usr/bin/env nu
|
||||||
|
|
||||||
def main [] {
|
def main [] {
|
||||||
let sdks = open nix/sourcemod/hl2sdks.json | columns
|
update_metamod
|
||||||
$sdks | each {|sdk| update_sdk $sdk}
|
|
||||||
|
# let sdks = open nix/sourcemod/hl2sdks.json | columns
|
||||||
|
# $sdks | each {|sdk| update_sdk $sdk}
|
||||||
}
|
}
|
||||||
|
|
||||||
def update_sdk [sdk: string] {
|
def update_sdk [sdk: string] {
|
||||||
|
|
@ -15,3 +17,13 @@ def update_sdk [sdk: string] {
|
||||||
nix-update --flake --use-update-script $"hl2sdk.($sdk)"
|
nix-update --flake --use-update-script $"hl2sdk.($sdk)"
|
||||||
nix build .#sourcemods.x86_64-linux.tf2
|
nix build .#sourcemods.x86_64-linux.tf2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def update_metamod [] {
|
||||||
|
let html = http get https://www.metamodsource.net/downloads.php/?branch=stable
|
||||||
|
let branch = $html | query web --query h3 | first | first | parse --regex "from (?P<branch>[0-9.]+) Branch" | get branch | first
|
||||||
|
let build = $html | query web --as-table [Build] | get Build | first
|
||||||
|
print $"Updating metamod-source to ($branch).0.($build)"
|
||||||
|
nix-update --flake --version=$"($branch).0.($build)" metamod-source
|
||||||
|
|
||||||
|
nom build .#metamods.x86_64-linux.tf2
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue