Unverified Commit 1896e04b authored by Yureka's avatar Yureka Committed by GitHub
Browse files

ente-desktop: 1.7.15 -> 1.7.21, use electron 41 (#499911)

parents 2d27897a 6ff1ac9f
Loading
Loading
Loading
Loading
+33 −6
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
  fetchFromGitHub,
  fetchYarnDeps,
  nodejs,
  electron_38,
  electron_41,
  yarnConfigHook,
  copyDesktopItems,
  vips,
@@ -13,14 +13,20 @@
  autoPatchelfHook,
  makeDesktopItem,
  imagemagick,
  wasm-pack,
  rustPlatform,
  cargo,
  rustc,
  wasm-bindgen-cli_0_2_108,
  binaryen,
}:
let
  electron = electron_38;
  electron = electron_41;
in

stdenv.mkDerivation (finalAttrs: {
  pname = "ente-desktop";
  version = "1.7.15";
  version = "1.7.21";

  src = fetchFromGitHub {
    owner = "ente-io";
@@ -29,13 +35,25 @@ stdenv.mkDerivation (finalAttrs: {
    sparseCheckout = [
      "desktop"
      "web"
      "rust"
    ];
    tag = "photosd-v${finalAttrs.version}";
    hash = "sha256-QnJp+oHkRsb/uMobA33Hgo2VOzfDFDtJ6vchCAzyb+c=";
    hash = "sha256-nkI2wfjpQPWPmu+IKbNMQuqby2odRG3Dbyzd7cSxmYY=";
  };

  sourceRoot = "${finalAttrs.src.name}/desktop";

  cargoRoot = "../web/packages/wasm";

  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit (finalAttrs)
      pname
      version
      src
      sourceRoot
      cargoRoot
      ;
    hash = "sha256-ftb0h5MOHyQ2iec6iE7/WdHXgrviLCy8oIqFXv5OTq8=";
  };
  offlineCache = fetchYarnDeps {
    name = "ente-desktop-${finalAttrs.version}-offline-cache";
    inherit (finalAttrs) src sourceRoot;
@@ -45,7 +63,7 @@ stdenv.mkDerivation (finalAttrs: {
    name = "ente-desktop-${finalAttrs.version}-web-offline-cache";
    inherit (finalAttrs) src;
    sourceRoot = "${finalAttrs.src.name}/web";
    hash = "sha256-m+7woB5XnOPDMLpoIBui1GxeW1BOms18SKJ8vaJcv68=";
    hash = "sha256-NhpSwesQ9B5gEeBQVjEEAKO4A68wfmBoQ3ga/baieNE=";
  };

  nativeBuildInputs = [
@@ -55,6 +73,14 @@ stdenv.mkDerivation (finalAttrs: {
    autoPatchelfHook # for onnxruntime
    copyDesktopItems
    imagemagick

    wasm-pack
    rustPlatform.cargoSetupHook
    cargo
    rustc
    rustc.llvmPackages.lld
    wasm-bindgen-cli_0_2_108
    binaryen
  ];

  buildInputs = [
@@ -72,6 +98,7 @@ stdenv.mkDerivation (finalAttrs: {

    pushd ../web
    offlineCache=$webOfflineCache yarnConfigHook
    rm -rf node_modules/wasm-pack node_modules/.bin/wasm-pack
    popd

    cp -r ${electron.dist} ./electron_dist