commit 3c5fbbb5cb9c4cc4698216a566bc4db62d0ecdfc
parent eef9ad6e18a4259866ac293944a6ca00234f9725
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Sat, 8 Nov 2025 23:15:16 +0100
parent eef9ad6e18a4259866ac293944a6ca00234f9725
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Sat, 8 Nov 2025 23:15:16 +0100
package/gomuks-web: update version
1 file changed, 111 insertions(+), 86 deletions(-)
M
|
197
++++++++++++++++++++++++++++++++++++++++++++-----------------------------------
diff --git a/packages/gomuks-web/package.nix b/packages/gomuks-web/package.nix @@ -5,50 +5,86 @@ applyPatches, buildGoModule, buildNpmPackage, + go, unstableGitUpdater, extraPatches ? [ ], }: -buildGoModule (finalAttrs: { - pname = "gomuks-web"; - version = "0.4.0-unstable-2025-08-26"; - rev = "a881807f7ae63cf3ce4359ad7f72c81c0ac7bc39"; - - srcHash = "sha256-vi4aGgZnRJYtZfz2WU7ojXv1vKma69Vk35XjHch0wzY="; - npmDepsHash = "sha256-E2hCrEEsx9VvM2ypomn7EPv+ggLNrrirrqGl2oxeu+Y="; - vendorHash = "sha256-IQUIq9ZIihUNL03AOdyQinmTGdzruoR23AB7UQM0O9s="; - - src = applyPatches { - src = fetchFromGitHub { - owner = "tulir"; - repo = "gomuks"; - hash = finalAttrs.srcHash; - inherit (finalAttrs) rev; +buildGoModule ( + finalAttrs: + let + ver = "0.2025.11"; + + in + { + pname = "gomuks-web"; + version = "${ver}-unstable-2025-11-01"; + rev = "be0d4487871c196d0c47bb1b6ac7ce9252d424de"; + + srcHash = "sha256-x7M7d8obnt8mpH1ZRev8c39PE5ZlgssgusGvrLaF/vg="; + npmDepsHash = "sha256-4Ir4uq9Hg6Hwj21P/H7xWdVPzYrDrXiouEtjnLJj4Ko="; + vendorHash = "sha256-TDvTZ0n324pNPAPMZMhWq0LdDUqFrzBXNVNdfMlxqeQ="; + src = applyPatches { + src = fetchFromGitHub { + owner = "tulir"; + repo = "gomuks"; + hash = finalAttrs.srcHash; + inherit (finalAttrs) rev; + }; + patches = [ + ./0001-web-remove-underscore-from-gomuks.wasm.patch + ] + ++ extraPatches; }; - patches = [ - ./0001-web-remove-underscore-from-gomuks.wasm.patch - ./0001-cmd-gmuks-add-flag-to-disable-auth.patch - ] - ++ extraPatches; - }; - frontend = buildNpmPackage (frontendFinalAttrs: { - name = "${finalAttrs.pname}_${finalAttrs.version}-frontend"; - src = "${finalAttrs.src}/web"; - inherit (finalAttrs) version npmDepsHash; + frontend = buildNpmPackage (frontendFinalAttrs: { + name = "${finalAttrs.pname}_${finalAttrs.version}-frontend"; + src = finalAttrs.src; + inherit (finalAttrs) version npmDepsHash; - wasmuks = buildGoModule { - name = "${finalAttrs.pname}_${finalAttrs.version}-wasm"; - inherit (finalAttrs) src vendorHash; + goStuff = buildGoModule { + name = "${finalAttrs.pname}_${finalAttrs.version}-wasm"; + inherit (finalAttrs) src vendorHash; - env.CGO_ENABLED = 0; + env.CGO_ENABLED = 0; - doCheck = false; + doCheck = false; + + buildPhase = '' + runHook preBuild + + GOOS=js GOARCH=wasm go build -tags goolm -ldflags "${lib.concatStringsSep " " finalAttrs.ldflags}" -o ./gomuks.wasm ./cmd/wasmuks + go build -o ./print ./pkg/hicli/cmdspec/print + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp gomuks.wasm $out + cp print $out + + runHook postInstall + ''; + }; + + postPatch = '' + cp ${frontendFinalAttrs.goStuff}/gomuks.wasm web/src/api/wasm/gomuks.wasm + ${frontendFinalAttrs.goStuff}/print web/src/api/types/stdcommands.json web/src/api/types/stdcommands.d.ts + cp web/{package.json,package-lock.json} ./ + ''; buildPhase = '' runHook preBuild - GOOS=js GOARCH=wasm go build -tags goolm -ldflags "${lib.concatStringsSep " " finalAttrs.ldflags}" -o ./gomuks.wasm ./cmd/wasmuks + cd ./web + + npm install + + ../node_modules/typescript/bin/tsc -b + ../node_modules/vite/bin/vite.js build runHook postBuild ''; @@ -56,70 +92,59 @@ buildGoModule (finalAttrs: { installPhase = '' runHook preInstall - mkdir -p $out - cp gomuks.wasm $out + cp -r ./dist $out runHook postInstall ''; - }; + }); + + # these flags have to be set, otherwise a dev-build will be created, which is missing features + ldflags = [ + "-X 'go.mau.fi/gomuks/version.Tag=v${ver}'" + "-X 'go.mau.fi/gomuks/version.Commit=${finalAttrs.rev}'" + "-X 'go.mau.fi/gomuks/version.BuildTime=2000-01-01T00:00:01+00:00'" + (lib.concatStrings [ + "-X 'maunium.net/go/mautrix.GoModVersion=" + (lib.pipe (builtins.readFile "${finalAttrs.src}/go.mod") [ + (builtins.match "^.*maunium.net/go/mautrix ([a-z0-9\.-]+).*$") + lib.last + ]) + "'" + ]) + ]; - preBuildPhases = [ "preBuildPhase" ]; + doCheck = false; - preBuildPhase = '' - cp ${frontendFinalAttrs.wasmuks}/gomuks.wasm src/api/wasm/gomuks.wasm - ''; + tags = [ "goolm" ]; - installPhase = '' - runHook preInstall + subPackages = [ + "cmd/gomuks" + "cmd/gomuks-terminal" + "cmd/archivemuks" + ]; - cp -r dist $out - - runHook postInstall + preBuild = '' + cp -rf ${finalAttrs.frontend} ./web/dist ''; - }); - - # these flags have to be set, otherwise a dev-build will be created, which is missing features - ldflags = [ - "-X 'go.mau.fi/gomuks/version.Tag=v0.4.0'" - "-X 'go.mau.fi/gomuks/version.Commit=${finalAttrs.rev}'" - "-X 'go.mau.fi/gomuks/version.BuildTime=2000-01-01T00:00:01+00:00'" - (lib.concatStrings [ - "-X 'maunium.net/go/mautrix.GoModVersion=" - (lib.pipe (builtins.readFile "${finalAttrs.src}/go.mod") [ - (builtins.match "^.*maunium.net/go/mautrix ([a-z0-9\.-]+).*$") - lib.last - ]) - "'" - ]) - ]; - doCheck = false; - - tags = [ "goolm" ]; - - subPackages = [ "cmd/gomuks" ]; - - preBuild = '' - cp -rf ${finalAttrs.frontend} ./web/dist - ''; + postInstall = '' + mv $out/bin/gomuks $out/bin/gomuks-web + ''; - postInstall = '' - mv $out/bin/gomuks $out/bin/gomuks-web - ''; + passthru.updateScript = { + inherit (finalAttrs) frontend; + updateScript = unstableGitUpdater { + branch = "main"; + }; + }; - passthru.updateScript = { - inherit (finalAttrs) frontend; - updateScript = unstableGitUpdater { - branch = "main"; + meta = { + mainProgram = "gomuks-web"; + description = "Matrix client written in Go"; + homepage = "https://github.com/tulir/gomuks"; + license = lib.licenses.agpl3Only; + maintainers = [ tgcMaintainers.zaphyra ]; + platforms = lib.platforms.unix; }; - }; - - meta = { - mainProgram = "gomuks-web"; - description = "Matrix client written in Go"; - homepage = "https://github.com/tulir/gomuks"; - license = lib.licenses.agpl3Only; - maintainers = [ tgcMaintainers.zaphyra ]; - platforms = lib.platforms.unix; - }; -}) + } +)