Unverified Commit 09a722cd authored by jopejoe1's avatar jopejoe1 Committed by GitHub
Browse files

gomuks-web: 0.4.0-unstable-2025-04-22 -> 0.2025.11-unstable-2025-11-01 (#459895)

parents 012524ff 47b8be7f
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -5417,12 +5417,6 @@
    githubId = 202474;
    name = "Jens Reimann";
  };
  ctucx = {
    email = "katja@ctu.cx";
    github = "katjakwast";
    githubId = 176372446;
    name = "Katja Kwast";
  };
  cupcakearmy = {
    name = "Niccolo Borgioli";
    email = "nix@nicco.io";
@@ -29007,6 +29001,12 @@
    githubId = 450885;
    name = "Francesco Zanini";
  };
  zaphyra = {
    email = "katja@zaphyra.eu";
    github = "katjakwast";
    githubId = 176372446;
    name = "Katja Kwast";
  };
  zareix = {
    email = "contact@raphael-catarino.fr";
    github = "zareix";
+73 −52
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  fetchNpmDeps,
  buildGoModule,
  buildNpmPackage,
  stdenv,
  olm,
  nodejs,
  npmHooks,
  unstableGitUpdater,
  withGoolm ? false,
}:

buildGoModule (
  finalAttrs:
  let
  cppStdLib = if stdenv.hostPlatform.isDarwin then "-lc++" else "-lstdc++";
    ver = "0.2025.11";
    revDate = "2025-11-01";
    rev = "be0d4487871c196d0c47bb1b6ac7ce9252d424de";
    srcHash = "sha256-x7M7d8obnt8mpH1ZRev8c39PE5ZlgssgusGvrLaF/vg=";
    vendorHash = "sha256-TDvTZ0n324pNPAPMZMhWq0LdDUqFrzBXNVNdfMlxqeQ=";
    npmDepsHash = "sha256-4Ir4uq9Hg6Hwj21P/H7xWdVPzYrDrXiouEtjnLJj4Ko=";

  in
buildGoModule (finalAttrs: {
  {
    pname = "gomuks-web";
  version = "0.4.0-unstable-2025-04-22";
    version = "${ver}-unstable-${revDate}";

    inherit vendorHash;

    src = fetchFromGitHub {
    owner = "tulir";
      owner = "gomuks";
      repo = "gomuks";
    rev = "fd257ed74c9df42e5b6d14d3c6a283f557f61666";
    hash = "sha256-jMDLfiwkUme2bxE+ZEtUoNMwZ7GuGGzCV2dH1V87YtQ=";
      hash = srcHash;
      inherit rev;
    };

  frontend = buildNpmPackage {
    name = "${finalAttrs.pname}_${finalAttrs.version}-frontend";
    src = "${finalAttrs.src}/web";
    inherit (finalAttrs) version;

    npmDepsHash = "sha256-Mt2gJ1lLT3oQ3RKr3XTVFXkS/Xmjy0gahbdaxxrO+6g=";
    nativeBuildInputs = [
      nodejs
      npmHooks.npmConfigHook
    ];

    installPhase = ''
      cp -r dist $out
    '';
    env = {
      npmRoot = "web";
      npmDeps = fetchNpmDeps {
        src = "${finalAttrs.src}/web";
        hash = npmDepsHash;
      };
    };

  vendorHash = "sha256-qeSxxd9ml2ENAYSPkdd1OWqy2DULnwLUVkKje47uT/I=";
    postPatch = ''
      substituteInPlace ./web/build-wasm.sh \
        --replace-fail 'go.mau.fi/gomuks/version.Tag=$(git describe --exact-match --tags 2>/dev/null)' "go.mau.fi/gomuks/version.Tag=v${ver}" \
        --replace-fail 'go.mau.fi/gomuks/version.Commit=$(git rev-parse HEAD)' "go.mau.fi/gomuks/version.Commit=${rev}"
    '';

  buildInputs = [
    (if withGoolm then stdenv.cc.cc.lib else olm)
  ];
    doCheck = false;

  CGO_LDFLAGS = lib.optional withGoolm cppStdLib;
    tags = [ "goolm" ];

  tags = lib.optional withGoolm "goolm";
    ldflags = [
      "-X 'go.mau.fi/gomuks/version.Tag=v${ver}'"
      "-X 'go.mau.fi/gomuks/version.Commit=${rev}'"
      "-X \"go.mau.fi/gomuks/version.BuildTime=$(date -Iseconds)\""
      "-X \"maunium.net/go/mautrix.GoModVersion=$(cat go.mod | grep 'maunium.net/go/mautrix ' | head -n1 | awk '{ print $2 })\""
    ];

  subPackages = [ "cmd/gomuks" ];
    subPackages = [
      "cmd/gomuks"
      "cmd/gomuks-terminal"
      "cmd/archivemuks"
    ];

    preBuild = ''
    cp -r ${finalAttrs.frontend} ./web/dist
      CGO_ENABLED=0 go generate ./web
    '';

    postInstall = ''
@@ -68,7 +88,8 @@ buildGoModule (finalAttrs: {
      description = "Matrix client written in Go";
      homepage = "https://github.com/tulir/gomuks";
      license = lib.licenses.agpl3Only;
    maintainers = with lib.maintainers; [ ctucx ];
      maintainers = [ lib.maintainers.zaphyra ];
      platforms = lib.platforms.unix;
    };
})
  }
)