Commit cb0bdca8 authored by Weijia Wang's avatar Weijia Wang
Browse files

galene-stt: drop

parent 421c5819
Loading
Loading
Loading
Loading
+0 −91
Original line number Diff line number Diff line
{
  lib,
  buildGoModule,
  fetchFromGitHub,
  gitUpdater,
  writeShellApplication,
  _experimental-update-script-combinators,
  galene,
  libopus,
  nix,
  pkg-config,
  sd,
  whisper-cpp,
}:

buildGoModule (finalAttrs: {
  pname = "galene-stt";
  version = "0.1";

  src = fetchFromGitHub {
    owner = "jech";
    repo = "galene-stt";
    tag = "galene-stt-${finalAttrs.version}";
    hash = "sha256-uW1b5T+p7KGvqt+PlR9d7bo62V+URHniS45sZP/VuLQ=";
  };

  vendorHash = "sha256-UFOxo8jq+gxN1dkM2A/BQqtT9ggIp7qovFRLv3Q6Io0=";

  # Not necessary, but feels cleaner to pull it in like that
  postPatch = ''
    substituteInPlace whisper.go \
      --replace-fail 'cgo LDFLAGS: -lwhisper' 'cgo pkg-config: whisper'
  '';

  strictDeps = true;

  nativeBuildInputs = [
    pkg-config
  ];

  buildInputs = [
    libopus
    whisper-cpp
  ];

  ldflags = [
    "-s"
    "-w"
  ];

  passthru = {
    updateScriptSrc = gitUpdater {
      rev-prefix = "galene-stt-";
    };
    updateScriptVendor = writeShellApplication {
      name = "update-galene-stt-vendorHash";
      runtimeInputs = [
        nix
        sd
      ];
      text = ''
        export UPDATE_NIX_ATTR_PATH="''${UPDATE_NIX_ATTR_PATH:-galene-stt}"

        oldhash="$(nix-instantiate . --eval --strict -A "$UPDATE_NIX_ATTR_PATH.goModules.drvAttrs.outputHash" | cut -d'"' -f2)"
        newhash="$(nix-build -A "$UPDATE_NIX_ATTR_PATH.goModules" --no-out-link 2>&1 | tail -n3 | grep 'got:' | cut -d: -f2- | xargs echo || true)"

        if [ "$newhash" == "" ]; then
          echo "No new vendorHash."
          exit 0
        fi

        fname="$(nix-instantiate --eval -E "with import ./. {}; (builtins.unsafeGetAttrPos \"version\" $UPDATE_NIX_ATTR_PATH).file" | cut -d'"' -f2)"

        ${sd.meta.mainProgram} --string-mode "$oldhash" "$newhash" "$fname"
      '';
    };
    updateScript = _experimental-update-script-combinators.sequence [
      finalAttrs.passthru.updateScriptSrc.command
      (lib.getExe finalAttrs.passthru.updateScriptVendor)
    ];
  };

  meta = {
    description = "Speech-to-text support for Galene";
    homepage = "https://github.com/jech/galene-stt";
    changelog = "https://github.com/jech/galene-stt/raw/${finalAttrs.src.rev}/CHANGES";
    license = lib.licenses.mit;
    platforms = lib.platforms.linux;
    inherit (galene.meta) maintainers;
  };
})
+0 −1
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@
    "firefoxpwa",
    "freecad",
    "frigate",
    "galene-stt",
    "gdcm",
    "getdp",
    "git-sim",
+1 −0
Original line number Diff line number Diff line
@@ -705,6 +705,7 @@ mapAliases {
  fx_cast_bridge = throw "'fx_cast_bridge' has been renamed to/replaced by 'fx-cast-bridge'"; # Converted to throw 2025-10-27
  fzf-zsh = throw "'fzf-zsh' has been removed because it was superseed by its builtin equivalent and archived upstream."; # Added 2026-01-17
  g4music = throw "'g4music' has been renamed to/replaced by 'gapless'"; # Converted to throw 2025-10-27
  galene-stt = throw "'galene-stt' has been removed as it is unmaintained and broken"; # Added 2026-01-27
  gamecube-tools = throw "gamecube-tools was removed due to numerous vulnerabilities in freeimage"; # Added 2025-10-23
  gandi-cli = throw "'gandi-cli' has been removed as it is unmaintained upstream"; # Added 2026-01-11
  garage_0_8 = throw "'garage_0_8' has been removed as it is unmaintained upstream"; # Added 2025-06-23