This commit is contained in:
Shelvacu
2025-05-10 20:37:46 -07:00
committed by Shelvacu on fw
parent 4fcbf4a688
commit 37f83a205e
2 changed files with 42 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
diff --git i/build/build.ts w/build/build.ts
index 1ae3f65..c1109ab 100644
--- i/build/build.ts
+++ w/build/build.ts
@@ -139,21 +139,7 @@ function generateSymbol(id: string, svgStr: string): string {
}
async function getBuildMetadata(): Promise<string> {
- const date = new Date().toISOString().slice(2, 10).replaceAll("-", "");
-
- const [commit, diff, newFiles] = await Promise.all([
- execAsync("git rev-parse HEAD"),
- execAsync("git diff HEAD"),
- execAsync("git ls-files --others --exclude-standard"),
- ]).then((res) => res.map((r) => r.stdout.trim()));
-
- if (!diff && !newFiles) return date + commit.slice(0, 4);
-
- const hash = createHash("md5");
- hash.update(commit).update(diff).update(newFiles);
- for (const file of newFiles.split("\n").filter((f) => f))
- hash.update(await fsAsync.readFile(file));
- return date + hash.digest("hex").slice(0, 4);
+ return "nix";
}
async function init(): Promise<void> {

View File

@@ -3,6 +3,8 @@
buildNpmPackage,
fetchFromGitHub,
makeWrapper,
}:
buildNpmPackage (finalAttrs: {
pname = "genieacs";
@@ -15,13 +17,23 @@ buildNpmPackage (finalAttrs: {
hash = "sha256-VQbqRcR5xHbADY8PxNJhlO1hcd6Y9/n5k6iEWqXz/F0=";
};
patches = [ ./build-metadata.patch ];
nativeBuildInputs = [ makeWrapper ];
npmDepsHash = "sha256-9vFVBY9GtIOztId80oS7XimpNqsqC4VoO5o161OdkSQ=";
postPatch = ''
cp npm-shrinkwrap.json package-lock.json
'';
npmDepsHash = "sha256-9vFVBY9GtIOztId80oS7XimpNqsqC4VoO5o161OdkSQ=";
doCheck = true;
preFixup = ''
rm $out/bin/*
cp dist/bin/* $out/bin
for binFile in $out/bin/*; do
wrapProgram $binFile --prefix NODE_PATH : $out/lib/node_modules/genieacs/node_modules
done
'';
meta = {
description = "An Automatic Configuration Server implementing the TR-069 protocol";