stuff
This commit is contained in:
27
packages/genieacs/build-metadata.patch
Normal file
27
packages/genieacs/build-metadata.patch
Normal 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> {
|
@@ -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";
|
||||
|
Reference in New Issue
Block a user