gcs: 5.28.1 -> 5.36.1, add updateScript

This commit is contained in:
TomaSajt
2025-07-08 15:28:22 +02:00
parent 761b86aa44
commit fa9bcd1205
+6 -40
View File
@@ -2,10 +2,8 @@
lib,
stdenv,
buildGoModule,
buildNpmPackage,
fetchFromGitHub,
cacert,
unzip,
nix-update-script,
pkg-config,
libGL,
libX11,
@@ -21,28 +19,13 @@
buildGoModule rec {
pname = "gcs";
version = "5.28.1";
version = "5.36.1";
src = fetchFromGitHub {
owner = "richardwilkes";
repo = "gcs";
tag = "v${version}";
nativeBuildInputs = [
cacert
unzip
];
# also fetch pdf.js files
# note: the version is locked in the file
postFetch = ''
cd $out/server/pdf
substituteInPlace refresh-pdf.js.sh \
--replace-fail '/bin/rm' 'rm'
. refresh-pdf.js.sh
'';
hash = "sha256-ArJ+GveG2Y1PYeCuIFJoQ3eVyqvAi4HEeAEd4X03yu4=";
hash = "sha256-bU/VoX/wb7DJGQLFVg0+bR48TXhHAE8yhqX2mbxSyGo=";
};
modPostBuild = ''
@@ -50,26 +33,7 @@ buildGoModule rec {
sed -i 's|-lmupdf[^ ]* |-lmupdf |g' vendor/github.com/richardwilkes/pdf/pdf.go
'';
vendorHash = "sha256-EmAGkQ+GHzVbSq/nPu0awL79jRmZuMHheBWwanfEgGI=";
frontend = buildNpmPackage {
name = "${pname}-${version}-frontend";
inherit src;
sourceRoot = "${src.name}/server/frontend";
npmDepsHash = "sha256-LqOH3jhp4Mx7JGYSjF29kVUny3xNn7oX0qCYi79SH4w=";
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r dist $out/dist
runHook postInstall
'';
};
postPatch = ''
cp -r ${frontend}/dist server/frontend/dist
'';
vendorHash = "sha256-hFgcTreiE2PwIwOG1zwLyF7ZbB+p9uCNVJcqHbQjJjE=";
nativeBuildInputs = [ pkg-config ];
@@ -103,6 +67,8 @@ buildGoModule rec {
runHook postInstall
'';
passthru.updateScript = nix-update-script { };
meta = {
changelog = "https://github.com/richardwilkes/gcs/releases/tag/v${version}";
description = "Stand-alone, interactive, character sheet editor for the GURPS 4th Edition roleplaying game system";