From 6d43ede855855f94b79d4194388e03a45ac0b7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 27 Oct 2022 13:29:07 -0700 Subject: [PATCH] deltachat-desktop: 1.30.1 -> 1.34.0 https://github.com/deltachat/deltachat-desktop/blob/v1.34.0/CHANGELOG.md --- .../deltachat-desktop/default.nix | 59 +++++++++++-------- .../deltachat-desktop/package.json | 56 ------------------ .../deltachat-desktop/update.sh | 19 +----- .../node-packages/node-packages.json | 1 - 4 files changed, 37 insertions(+), 98 deletions(-) delete mode 100644 pkgs/applications/networking/instant-messengers/deltachat-desktop/package.json diff --git a/pkgs/applications/networking/instant-messengers/deltachat-desktop/default.nix b/pkgs/applications/networking/instant-messengers/deltachat-desktop/default.nix index 3e0e0362f200..8fc36454310e 100644 --- a/pkgs/applications/networking/instant-messengers/deltachat-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/deltachat-desktop/default.nix @@ -1,4 +1,5 @@ { lib +, buildNpmPackage , copyDesktopItems , electron_18 , buildGoModule @@ -8,9 +9,9 @@ , libdeltachat , makeDesktopItem , makeWrapper -, nodePackages , noto-fonts-emoji , pkg-config +, python3 , roboto , rustPlatform , sqlcipher @@ -20,52 +21,48 @@ let libdeltachat' = libdeltachat.overrideAttrs (old: rec { - version = "1.86.0"; + version = "1.102.0"; src = fetchFromGitHub { owner = "deltachat"; repo = "deltachat-core-rust"; rev = version; - hash = "sha256-VLS93Ffeit2rVmXxYkXcnf8eDA3DC2/wKYZTh56QCk0="; + hash = "sha256-xw/lUNs39nkBrydpcgUBL3j6XrZFafKslxx6zUiElWw="; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit src; name = "${old.pname}-${version}"; - hash = "sha256-4rpoDQ3o0WdWg/TmazTI+J0hL/MxwHcNMXWMq7GE7Tk="; + hash = "sha256-CiqYKFABHcFSjYUH/qop1xWCoygQJajI7nhv04ElD10="; }; - patches = [ - (fetchpatch { - name = "turn-off-hard-errors-for-lints.patch"; - url = "https://github.com/deltachat/deltachat-core-rust/commit/7598c50dbaa2abcbd417d96a02743269f666597b.patch"; - hash = "sha256-Xss44v6Wf6mL3FK9hH+oFYZ0fBA9rSh4wDrr7nSUibQ="; - }) - ]; }); esbuild' = esbuild.override { buildGoModule = args: buildGoModule (args // rec { - version = "0.12.29"; + version = "0.14.54"; src = fetchFromGitHub { owner = "evanw"; repo = "esbuild"; rev = "v${version}"; - hash = "sha256-oU++9E3StUoyrMVRMZz8/1ntgPI62M1NoNz9sH/N5Bg="; + hash = "sha256-qCtpy69ROCspRgPKmCV0YY/EOSWiNU/xwDblU0bQp4w="; }; - vendorSha256 = "sha256-QPkBR+FscUc3jOvH7olcGUhM6OW4vxawmNJuRQxPuGs="; + vendorSha256 = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ="; }); }; -in nodePackages.deltachat-desktop.override rec { +in buildNpmPackage rec { pname = "deltachat-desktop"; - version = "1.30.1"; + version = "1.34.0"; src = fetchFromGitHub { owner = "deltachat"; repo = "deltachat-desktop"; rev = "v${version}"; - hash = "sha256-gZjZbXiqhFVfThZOsvL/nKkf6MX+E3KB5ldEAIuzBYA="; + hash = "sha256-M2ZLWaxVq9PvxJemwv+7jd0cXKQb6T5VCyLvIRF+9d0="; }; + npmDepsHash = "sha256-wCsPKEgRpPsNmM0HzvS5QjlPnw8COPrOhQRIf+vYeig="; + nativeBuildInputs = [ makeWrapper pkg-config + python3 ] ++ lib.optionals stdenv.isLinux [ copyDesktopItems ]; @@ -81,20 +78,25 @@ in nodePackages.deltachat-desktop.override rec { USE_SYSTEM_LIBDELTACHAT = "true"; VERSION_INFO_GIT_REF = src.rev; - postRebuild = '' + preBuild = '' rm -r node_modules/deltachat-node/node/prebuilds - - npm run build4production ''; - postInstall = '' + npmBuildScript = "build4production"; + + installPhase = '' + runHook preInstall + npm prune --production - install -D $out/lib/node_modules/deltachat-desktop/build/icon.png \ - $out/share/icons/hicolor/scalable/apps/deltachat.png + mkdir -p $out/lib/node_modules/deltachat-desktop + cp -r . $out/lib/node_modules/deltachat-desktop awk '!/^#/ && NF' build/packageignore_list \ - | xargs -I {} sh -c "rm -rf {}" || true + | xargs -I {} sh -c "rm -rf $out/lib/node_modules/deltachat-desktop/{}" || true + + install -D build/icon.png \ + $out/share/icons/hicolor/scalable/apps/deltachat.png ln -sf ${noto-fonts-emoji}/share/fonts/noto/NotoColorEmoji.ttf \ $out/lib/node_modules/deltachat-desktop/html-dist/fonts/noto/emoji @@ -106,6 +108,8 @@ in nodePackages.deltachat-desktop.override rec { makeWrapper ${electron_18}/bin/electron $out/bin/deltachat \ --set LD_PRELOAD ${sqlcipher}/lib/libsqlcipher${stdenv.hostPlatform.extensions.sharedLibrary} \ --add-flags $out/lib/node_modules/deltachat-desktop + + runHook postInstall ''; desktopItems = lib.singleton (makeDesktopItem { @@ -117,7 +121,12 @@ in nodePackages.deltachat-desktop.override rec { comment = meta.description; categories = [ "Network" "InstantMessaging" "Chat" ]; startupWMClass = "DeltaChat"; - mimeTypes = [ "x-scheme-handler/openpgp4fpr" "x-scheme-handler/mailto" ]; + mimeTypes = [ + "x-scheme-handler/openpgp4fpr" + "x-scheme-handler/dcaccount" + "x-scheme-handler/dclogin" + "x-scheme-handler/mailto" + ]; }); passthru.updateScript = ./update.sh; diff --git a/pkgs/applications/networking/instant-messengers/deltachat-desktop/package.json b/pkgs/applications/networking/instant-messengers/deltachat-desktop/package.json deleted file mode 100644 index 96778eda7aa6..000000000000 --- a/pkgs/applications/networking/instant-messengers/deltachat-desktop/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "deltachat-desktop", - "version": "1.30.1", - "dependencies": { - "@blueprintjs/core": "^4.1.2", - "@deltachat/message_parser_wasm": "^0.4.0", - "@deltachat/react-qr-reader": "^4.0.0", - "@mapbox/geojson-extent": "^1.0.0", - "application-config": "^1.0.1", - "classnames": "^2.3.1", - "debounce": "^1.2.0", - "deltachat-node": "1.86.0", - "emoji-js-clean": "^4.0.0", - "emoji-mart": "^3.0.1", - "emoji-regex": "^9.2.2", - "error-stack-parser": "^2.0.7", - "filesize": "^8.0.6", - "immutable": "^4.0.0", - "mapbox-gl": "^1.12.0", - "mime-types": "^2.1.31", - "moment": "^2.29.2", - "path-browserify": "^1.0.1", - "rc": "^1.2.8", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "react-string-replace": "^1.0.0", - "react-virtualized-auto-sizer": "^1.0.5", - "react-window": "^1.8.6", - "react-window-infinite-loader": "^1.0.7", - "react-zoom-pan-pinch": "^2.1.3", - "source-map-support": "^0.5.19", - "stackframe": "^1.2.1", - "url-parse": "^1.5.9", - "use-debounce": "^3.3.0", - "@babel/core": "^7.7.7", - "@babel/preset-env": "^7.7.7", - "@babel/preset-react": "^7.7.4", - "@types/debounce": "^1.2.0", - "@types/emoji-mart": "^3.0.9", - "@types/mapbox-gl": "^0.54.5", - "@types/mime-types": "^2.1.0", - "@types/node": "^14.14.20", - "@types/rc": "^1.1.0", - "@types/react": "^17.0.2", - "@types/react-dom": "^17.0.2", - "@types/react-window": "^1.8.4", - "@types/react-window-infinite-loader": "^1.0.4", - "@types/url-parse": "^1.4.3", - "electron": "^18.0.3", - "esbuild": "^0.12.29", - "glob-watcher": "^5.0.5", - "sass": "^1.26.5", - "typescript": "^4.4.4", - "xml-js": "^1.6.8" - } -} diff --git a/pkgs/applications/networking/instant-messengers/deltachat-desktop/update.sh b/pkgs/applications/networking/instant-messengers/deltachat-desktop/update.sh index a21a97b3b83c..f31279cf4f0e 100755 --- a/pkgs/applications/networking/instant-messengers/deltachat-desktop/update.sh +++ b/pkgs/applications/networking/instant-messengers/deltachat-desktop/update.sh @@ -1,5 +1,5 @@ #! /usr/bin/env nix-shell -#! nix-shell -i bash -p coreutils curl gnused jq moreutils nix-prefetch +#! nix-shell -i bash -p coreutils curl gnused jq moreutils nix-prefetch prefetch-npm-deps set -euo pipefail cd "$(dirname "$0")" @@ -28,18 +28,5 @@ tac default.nix \ | sponge default.nix src=$(nix-build "$nixpkgs" -A deltachat-desktop.src --no-out-link) - -jq '{ name, version, dependencies: (.dependencies + (.devDependencies | del(.["@types/chai","@types/mocha","@types/node-fetch","@typescript-eslint/eslint-plugin","@typescript-eslint/parser","chai","electron-builder","electron-devtools-installer","electron-notarize","eslint","eslint-config-prettier","eslint-plugin-react-hooks","hallmark","mocha","node-fetch","prettier","testcafe","testcafe-browser-provider-electron","testcafe-react-selectors","ts-node","walk"]))) }' \ - "$src/package.json" > package.json.new - -if cmp --quiet package.json{.new,}; then - echo "package.json not changed, skip updating nodePackages" - rm package.json.new -else - echo "package.json changed, updating nodePackages" - mv package.json{.new,} - - pushd ../../../../development/node-packages - ./generate.sh - popd -fi +hash=$(prefetch-npm-deps $src/package-lock.json) +sed -i "s,npmDepsHash = \".*\",npmDepsHash = \"$hash\"," default.nix diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index f9bb0b1a82f1..dd08fb37e67f 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -117,7 +117,6 @@ , "csslint" , "dat" , "degit" -, {"deltachat-desktop": "../../applications/networking/instant-messengers/deltachat-desktop"} , "dhcp" , "diagnostic-languageserver" , "dockerfile-language-server-nodejs"