From 99fccdc256c0eeced31b48b162971db8aec4de93 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sun, 6 Sep 2026 16:15:49 -0400 Subject: [PATCH] mod: upgrade sable-web from 1.14 to 1.21 --- pkgs/common/sable.nix | 119 ++++++++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 46 deletions(-) diff --git a/pkgs/common/sable.nix b/pkgs/common/sable.nix index 8f86f2f..962b564 100644 --- a/pkgs/common/sable.nix +++ b/pkgs/common/sable.nix @@ -7,54 +7,81 @@ nodejs_24, fetchFromGitHub, }: -buildNpmPackage (finalAttrs: -let - pnpm = pnpm_10.override { +buildNpmPackage ( + finalAttrs: + let + pnpm = pnpm_10.override { + nodejs = nodejs_24; + }; + matrixrtcSrc = fetchFromGitHub { + owner = "SableClient"; + repo = "matrix-rtc"; + rev = "519fe6b863cfac78700f4e2b1748649103bb8a8d"; + hash = "sha256-n5f7529RdRxY8/a43Xkgrhg4yRz5aNgfoZqWrB7kvak="; + }; + livekitMobileSrc = fetchFromGitHub { + owner = "SableClient"; + repo = "tauri-plugin-livekit-mobile"; + rev = "c6f0d02ab3da1174535bc1dc8e598a2e6873f977"; + hash = "sha256-ZPx6Ic+Gkvzg9LXYP9BaQALzOrvLCcQHOms8U3VfnU0="; + }; + in + { + pname = "sable-unwrapped"; + version = "1.21.0"; + + src = fetchFromGitHub { + owner = "SableClient"; + repo = "Sable"; + tag = "v${finalAttrs.version}"; + hash = "sha256-vYoKNflV4vdJpgYVxYCxAQhvqDh1Qf+7qgIFHxriTTU="; + }; + nodejs = nodejs_24; - }; -in { - pname = "sable-unwrapped"; - version = "1.14.0"; - src = fetchFromGitHub { - owner = "SableClient"; - repo = "Sable"; - tag = "v${finalAttrs.version}"; - hash = "sha256-zoGKs0pm9m42JrTNAdU33LP139JlVz3RZnkTyY0aiqY="; - }; + nativeBuildInputs = [ pnpm ]; + npmConfigHook = pnpmConfigHook; - nodejs = nodejs_24; + npmDeps = finalAttrs.pnpmDeps; + pnpmDeps = fetchPnpmDeps { + inherit (finalAttrs) pname version src; + inherit pnpm; + fetcherVersion = 3; + hash = "sha256-tzIU/5DQ4SpLABKOt6/Z2aD2d6nVt+MJvY7vHHnO4No="; + }; - nativeBuildInputs = [ pnpm ]; - npmConfigHook = pnpmConfigHook; - - npmDeps = finalAttrs.pnpmDeps; - pnpmDeps = fetchPnpmDeps { - inherit (finalAttrs) pname version src; - inherit pnpm; - fetcherVersion = 3; - hash = "sha256-2GwUz0jsuVKQZyeidM0F4rDzijm9AFcAxN7x/m/b3Is="; - }; - - npmInstallFlags = [ - "--ignore-scripts" - ]; - - installPhase = '' - runHook preInstall - - cp -r dist $out - - runHook postInstall - ''; - - meta = { - description = "An almost stable Matrix client"; - homepage = "https://app.sable.moe/"; - maintainers = with lib.maintainers; [ - wymillerlinux + npmInstallFlags = [ + "--ignore-scripts" ]; - license = lib.licenses.agpl3Only; - platforms = lib.platforms.all; - }; -}) + + preBuild = '' + cp -r --no-preserve=mode ${matrixrtcSrc}/. node_modules/@sableclient/matrixrtc/ + pnpm exec tsc -p node_modules/@sableclient/matrixrtc/tsconfig.build.json + cp -r --no-preserve=mode ${livekitMobileSrc}/. node_modules/@sableclient/tauri-plugin-livekit-mobile/ + pnpm exec tsc \ + -p node_modules/@sableclient/tauri-plugin-livekit-mobile/tsconfig.json \ + --noEmit false \ + --declaration \ + --rootDir node_modules/@sableclient/tauri-plugin-livekit-mobile/guest-js \ + --outDir node_modules/@sableclient/tauri-plugin-livekit-mobile/dist-js + ''; + + installPhase = '' + runHook preInstall + + cp -r dist $out + + runHook postInstall + ''; + + meta = { + description = "An almost stable Matrix client"; + homepage = "https://app.sable.moe/"; + maintainers = with lib.maintainers; [ + wymillerlinux + ]; + license = lib.licenses.agpl3Only; + platforms = lib.platforms.all; + }; + } +)