update script for ambuild

This commit is contained in:
Robin Appelman 2026-07-08 22:49:35 +02:00
commit f90c30a761
2 changed files with 19 additions and 9 deletions

View file

@ -3,16 +3,17 @@
buildPythonPackage,
fetchFromGitHub,
setuptools,
nix-update-script,
}:
buildPythonPackage rec {
pname = "ambuild";
version = "2.2.3-dev";
version = "2.2-unstable-2026-06-06";
src = fetchFromGitHub {
owner = "alliedmodders";
repo = pname;
rev = "341e8be03aad91b7b81774fdcd7ffa1f34452552";
hash = "sha256-ZDDeFzWvVSnovr6rDZOk+7BdzyUGe+7yEwE0cecsNps=";
rev = "d89ec91a7ac2607da07b50bb62346f9a10e9a998";
hash = "sha256-AO9n+YaVaV9h2JNeaNKlLLPdXyA6HwQpcHCt0UCVIII=";
};
pyproject = true;
@ -20,6 +21,14 @@ buildPythonPackage rec {
doCheck = false;
passthru = {
updateScript = nix-update-script {
extraArgs = [
"--flake"
];
};
};
meta = with lib; {
homepage = "https://github.com/alliedmodders/ambuild";
description = "AMBuild is a lightweight build system designed for performance and accuracy";

View file

@ -1,9 +1,13 @@
#! /usr/bin/env nu
def main [] {
update_metamod
nix-update --flake --version=branch --build ambuild
nix-update --flake --version=$"(get_metamod_version)" metamod-source
nom build .#metamods.x86_64-linux.tf2
nix-update --flake --use-update-script sourcemod
nom build .#sourcemods.x86_64-linux.tf2
let sdks = open nix/sourcemod/hl2sdks.json | columns
$sdks | each {|sdk| update_sdk $sdk}
@ -20,12 +24,9 @@ def update_sdk [sdk: string] {
nix build .#sourcemods.x86_64-linux.tf2
}
def update_metamod [] {
def get_metamod_version [] {
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
$"($branch).0.($build)"
}