From 67ebf03c9ff8b36e7c76da49a9561637cc92ed9f Mon Sep 17 00:00:00 2001 From: Oleksii Filonenko Date: Sun, 28 Jun 2026 20:46:50 +0100 Subject: [PATCH] ente-desktop: 1.7.22 -> 1.7.24 Assisted-By: pi coding agent with kimi-k2.7-code --- pkgs/by-name/en/ente-desktop/package.nix | 84 ++++++++++++++++-------- 1 file changed, 55 insertions(+), 29 deletions(-) diff --git a/pkgs/by-name/en/ente-desktop/package.nix b/pkgs/by-name/en/ente-desktop/package.nix index e803b56b463f..d579610bf834 100644 --- a/pkgs/by-name/en/ente-desktop/package.nix +++ b/pkgs/by-name/en/ente-desktop/package.nix @@ -17,16 +17,22 @@ rustPlatform, cargo, rustc, - wasm-bindgen-cli_0_2_108, + wasm-bindgen-cli_0_2_121, binaryen, }: let electron = electron_41; + + resourcesDir = + if stdenv.hostPlatform.isDarwin then + "$out/Applications/ente.app/Contents/Resources" + else + "$out/share/ente-desktop/resources"; in stdenv.mkDerivation (finalAttrs: { pname = "ente-desktop"; - version = "1.7.22"; + version = "1.7.24"; src = fetchFromGitHub { owner = "ente-io"; @@ -38,11 +44,11 @@ stdenv.mkDerivation (finalAttrs: { "rust" ]; tag = "photosd-v${finalAttrs.version}"; - hash = "sha256-iEPUlWe1dmXm0dkl12faKbfqffu8LCm8JTa+uVIBwrA="; + hash = "sha256-/dO9qLJKbqR5h/GEJW9rLO1jNTa5GkqnJ9ORPSf5R8o="; }; sourceRoot = "${finalAttrs.src.name}/desktop"; - cargoRoot = "../web/packages/wasm"; + cargoRoot = "../rust"; cargoDeps = rustPlatform.fetchCargoVendor { inherit (finalAttrs) @@ -52,26 +58,24 @@ stdenv.mkDerivation (finalAttrs: { sourceRoot cargoRoot ; - hash = "sha256-/FkAxi9KpW/Z6sdo7gfxvCmaAe0JzjubScrcGjbLD88="; + hash = "sha256-F+g/6mcMnplOkTlR/vedS3MhimFAbXFZi6CTJ/cqoU0="; }; offlineCache = fetchYarnDeps { name = "ente-desktop-${finalAttrs.version}-offline-cache"; inherit (finalAttrs) src sourceRoot; - hash = "sha256-OnqrowsT0Yion563QD4RA5whN///q4RbkgMDWXs9icg="; + hash = "sha256-ne3gyI6psDpYzCPpepIIWao0yBiiv9qXQ+Iri3ELK/U="; }; webOfflineCache = fetchYarnDeps { name = "ente-desktop-${finalAttrs.version}-web-offline-cache"; inherit (finalAttrs) src; sourceRoot = "${finalAttrs.src.name}/web"; - hash = "sha256-bWOwIa7SD0z2StoUg9HlQGTBq2xXltLgQ2ft8umjg/Y="; + hash = "sha256-MqsmOHVyPz+YiwNmrs447wrQ/Nk+t5TrLMsbDITM8p0="; }; nativeBuildInputs = [ nodejs yarnConfigHook makeWrapper - autoPatchelfHook # for onnxruntime - copyDesktopItems imagemagick wasm-pack @@ -79,8 +83,12 @@ stdenv.mkDerivation (finalAttrs: { cargo rustc rustc.llvmPackages.lld - wasm-bindgen-cli_0_2_108 + wasm-bindgen-cli_0_2_121 binaryen + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook # for onnxruntime + copyDesktopItems ]; buildInputs = [ @@ -90,7 +98,7 @@ stdenv.mkDerivation (finalAttrs: { # Path to vips (otherwise it looks within the electron derivation) postPatch = '' substituteInPlace src/main/services/image.ts src/main.ts \ - --replace-fail "process.resourcesPath" "\"$out/share/ente-desktop/resources\"" + --replace-fail "process.resourcesPath" "\"${resourcesDir}\"" ''; postConfigure = '' @@ -114,7 +122,14 @@ stdenv.mkDerivation (finalAttrs: { cp -r ../web/apps/photos/out out yarn run tsc - yarn run electron-builder --dir -c.electronDist=./electron_dist -c.electronVersion=${electron.version} + yarn run electron-builder -- \ + --dir \ + --c.electronDist=./electron_dist \ + --c.electronVersion=${electron.version} \ + ${lib.optionalString stdenv.hostPlatform.isDarwin '' + --c.mac.identity=null \ + --c.mac.notarize=false \ + ''} runHook postBuild ''; @@ -122,29 +137,40 @@ stdenv.mkDerivation (finalAttrs: { installPhase = '' runHook preInstall - for size in 16 32 48 64 72 96 128 192 256 512 1024; do - mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps - convert -resize "$size"x"$size" build/icon.png $out/share/icons/hicolor/"$size"x"$size"/apps/ente-desktop.png - done + ${lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -r dist/*/ente.app $out/Applications - mkdir -p $out/share/ente-desktop - cp -r dist/*/resources $out/share/ente-desktop - ln -s ${vips}/bin/vips $out/share/ente-desktop/resources/vips - ln -s ${ffmpeg}/bin/ffmpeg $out/share/ente-desktop/resources/app.asar.unpacked/node_modules/ffmpeg-static/ffmpeg + mkdir -p $out/bin + ln -s $out/Applications/ente.app/Contents/MacOS/ente $out/bin/ente-desktop + ''} - # executable wrapper - makeWrapper '${electron}/bin/electron' "$out/bin/ente-desktop" \ - --set ELECTRON_FORCE_IS_PACKAGED 1 \ - --set ELECTRON_IS_DEV 0 \ - --add-flags "$out/share/ente-desktop/resources/app.asar" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" + ${lib.optionalString stdenv.hostPlatform.isLinux '' + for size in 16 32 48 64 72 96 128 192 256 512 1024; do + mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps + convert -resize "$size"x"$size" build/icon.png $out/share/icons/hicolor/"$size"x"$size"/apps/ente-desktop.png + done + + mkdir -p $out/share/ente-desktop + cp -r dist/*/resources $out/share/ente-desktop + + # executable wrapper + makeWrapper '${electron}/bin/electron' "$out/bin/ente-desktop" \ + --set ELECTRON_FORCE_IS_PACKAGED 1 \ + --set ELECTRON_IS_DEV 0 \ + --add-flags "${resourcesDir}/app.asar" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" + ''} + + ln -s ${vips}/bin/vips ${resourcesDir}/vips + ln -s ${ffmpeg}/bin/ffmpeg ${resourcesDir}/app.asar.unpacked/node_modules/ffmpeg-static/ffmpeg runHook postInstall ''; # The desktop item properties should be kept in sync with data from upstream: # https://github.com/ente-io/ente/blob/main/desktop/electron-builder.yml - desktopItems = [ + desktopItems = lib.optionals (!stdenv.hostPlatform.isDarwin) [ (makeDesktopItem { name = "ente-desktop"; desktopName = "Ente"; @@ -169,8 +195,8 @@ stdenv.mkDerivation (finalAttrs: { maintainers = with lib.maintainers; [ pinpox yuka + Br1ght0ne ]; - platforms = lib.platforms.all; - broken = stdenv.hostPlatform.isDarwin; + platforms = lib.platforms.linux ++ lib.platforms.darwin; }; })