deltachat-desktop: init at unstable-2021-08-04
This commit is contained in:
parent
4d9ddc3eeb
commit
8959f1d2e8
@ -0,0 +1,95 @@
|
||||
{ lib
|
||||
, copyDesktopItems
|
||||
, electron
|
||||
, esbuild
|
||||
, fetchFromGitHub
|
||||
, libdeltachat
|
||||
, makeDesktopItem
|
||||
, makeWrapper
|
||||
, nodePackages
|
||||
, pkg-config
|
||||
, stdenv
|
||||
, CoreServices
|
||||
}:
|
||||
|
||||
let
|
||||
electronExec = if stdenv.isDarwin then
|
||||
"${electron}/Applications/Electron.app/Contents/MacOS/Electron"
|
||||
else
|
||||
"${electron}/bin/electron";
|
||||
in nodePackages.deltachat-desktop.override rec {
|
||||
pname = "deltachat-desktop";
|
||||
version = "unstable-2021-08-04";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "deltachat";
|
||||
repo = "deltachat-desktop";
|
||||
rev = "2c47d6b7e46f4f68c7eb45508ab9e145af489ea1";
|
||||
sha256 = "03b6j3cj2yanvsargh6q57bf1llg17yrqgmd14lp0wkam767kkfa";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
esbuild
|
||||
makeWrapper
|
||||
pkg-config
|
||||
] ++ lib.optionals stdenv.isLinux [
|
||||
copyDesktopItems
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libdeltachat
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
CoreServices
|
||||
];
|
||||
|
||||
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
||||
USE_SYSTEM_LIBDELTACHAT = "true";
|
||||
VERSION_INFO_GIT_REF = src.rev;
|
||||
|
||||
postInstall = let
|
||||
keep = lib.concatMapStringsSep " " (file: "! -name ${file}") [
|
||||
"_locales" "build" "html-dist" "images" "index.js"
|
||||
"node_modules" "themes" "tsc-dist"
|
||||
];
|
||||
in ''
|
||||
rm -r node_modules/deltachat-node/{deltachat-core-rust,prebuilds,src}
|
||||
|
||||
patchShebangs node_modules/sass/sass.js
|
||||
|
||||
npm run build
|
||||
|
||||
npm prune --production
|
||||
|
||||
find . -mindepth 1 -maxdepth 1 ${keep} -print0 | xargs -0 rm -r
|
||||
|
||||
mkdir -p $out/share/icons/hicolor/scalable/apps
|
||||
ln -s $out/lib/node_modules/deltachat-desktop/build/icon.png \
|
||||
$out/share/icons/hicolor/scalable/apps/deltachat.png
|
||||
|
||||
makeWrapper ${electronExec} $out/bin/deltachat \
|
||||
--add-flags $out/lib/node_modules/deltachat-desktop
|
||||
'';
|
||||
|
||||
desktopItems = lib.singleton (makeDesktopItem {
|
||||
name = "deltachat";
|
||||
exec = "deltachat %u";
|
||||
icon = "deltachat";
|
||||
desktopName = "Delta Chat";
|
||||
genericName = "Delta Chat";
|
||||
comment = meta.description;
|
||||
categories = "Network;InstantMessaging;Chat;";
|
||||
extraEntries = ''
|
||||
StartupWMClass=DeltaChat
|
||||
MimeType=x-scheme-handler/openpgp4fpr;x-scheme-handler/mailto;
|
||||
'';
|
||||
});
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Email-based instant messaging for Desktop";
|
||||
homepage = "https://github.com/deltachat/deltachat-desktop";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ dotlambda ];
|
||||
};
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
{
|
||||
"name": "deltachat-desktop",
|
||||
"version": "1.20.3",
|
||||
"dependencies": {
|
||||
"@blueprintjs/core": "^3.22.3",
|
||||
"@mapbox/geojson-extent": "^1.0.0",
|
||||
"application-config": "^1.0.1",
|
||||
"array-differ": "^3.0.0",
|
||||
"classnames": "^2.3.1",
|
||||
"debounce": "^1.2.0",
|
||||
"deltachat-node": "1.56.2",
|
||||
"emoji-js-clean": "^4.0.0",
|
||||
"emoji-mart": "^3.0.0",
|
||||
"emoji-regex": "^9.2.2",
|
||||
"error-stack-parser": "^2.0.6",
|
||||
"filesize": "^6.1.0",
|
||||
"fs-extra": "^8.1.0",
|
||||
"mapbox-gl": "^1.12.0",
|
||||
"mime-types": "^2.1.31",
|
||||
"moment": "^2.27.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"path-browserify": "^1.0.1",
|
||||
"punycode": "^2.1.1",
|
||||
"rc": "^1.2.8",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-qr-reader": "^2.2.1",
|
||||
"react-qr-svg": "^2.1.0",
|
||||
"react-string-replace": "^0.4.4",
|
||||
"react-virtualized": "^9.21.2",
|
||||
"simple-markdown": "^0.7.1",
|
||||
"source-map-support": "^0.5.19",
|
||||
"tempy": "^0.3.0",
|
||||
"url-parse": "^1.4.7",
|
||||
"use-debounce": "^3.3.0",
|
||||
"@babel/core": "^7.7.7",
|
||||
"@types/debounce": "^1.2.0",
|
||||
"@babel/preset-env": "^7.7.7",
|
||||
"@babel/preset-react": "^7.7.4",
|
||||
"@types/emoji-mart": "^3.0.2",
|
||||
"@types/fs-extra": "^8.0.1",
|
||||
"@types/mapbox-gl": "^0.54.5",
|
||||
"@types/mime-types": "^2.1.0",
|
||||
"@types/node": "^14.14.20",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@types/prop-types": "^15.7.3",
|
||||
"@types/rc": "^1.1.0",
|
||||
"@types/react": "^16.9.17",
|
||||
"@types/react-dom": "^16.9.4",
|
||||
"@types/react-virtualized": "^9.21.10",
|
||||
"@types/url-parse": "^1.4.3",
|
||||
"electron": "^13.1.6",
|
||||
"glob-watcher": "^5.0.5",
|
||||
"sass": "^1.26.5",
|
||||
"typescript": "^3.9.7",
|
||||
"xml-js": "^1.6.8"
|
||||
}
|
||||
}
|
42
pkgs/applications/networking/instant-messengers/deltachat-desktop/update.sh
Executable file
42
pkgs/applications/networking/instant-messengers/deltachat-desktop/update.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p curl jq nix-prefetch
|
||||
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
owner=deltachat
|
||||
repo=deltachat-desktop
|
||||
nixpkgs=../../../../..
|
||||
|
||||
rev=$(
|
||||
curl -s "https://api.github.com/repos/$owner/$repo/releases" |
|
||||
jq 'map(select(.prerelease | not)) | .[0].tag_name' --raw-output
|
||||
)
|
||||
ver=$(echo "$rev" | sed 's/^v//')
|
||||
old_ver=$(sed -n 's/.*\bversion = "\(.*\)".*/\1/p' default.nix)
|
||||
if [ "$ver" = "$old_ver" ]; then
|
||||
echo "Up to date: $ver"
|
||||
exit
|
||||
fi
|
||||
echo "$old_ver -> $ver"
|
||||
|
||||
sha256=$(nix-prefetch -f "$nixpkgs" deltachat-desktop --rev "$rev")
|
||||
sed -e "s#\\bversion = \".*\"#version = \"$ver\"#" \
|
||||
-e "s#\\bsha256 = \".*\"#sha256 = \"$sha256\"#" \
|
||||
-i default.nix
|
||||
src=$(nix-build "$nixpkgs" -A deltachat-desktop.src --no-out-link)
|
||||
|
||||
jq '{ name, version, dependencies: (.dependencies + (.devDependencies | del(.["@typescript-eslint/eslint-plugin","@typescript-eslint/parser","esbuild","electron-builder","electron-devtools-installer","electron-notarize","esbuild","eslint","eslint-config-prettier","eslint-plugin-react-hooks","hallmark","prettier","tape","testcafe","testcafe-browser-provider-electron","testcafe-react-selectors","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
|
@ -46,6 +46,10 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
deltachat-desktop = super."deltachat-desktop-../../applications/networking/instant-messengers/deltachat-desktop".override {
|
||||
meta.broken = true; # use the top-level package instead
|
||||
};
|
||||
|
||||
fast-cli = super.fast-cli.override ({
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
prePatch = ''
|
||||
|
@ -78,6 +78,7 @@
|
||||
, "csslint"
|
||||
, "dat"
|
||||
, "degit"
|
||||
, {"deltachat-desktop": "../../applications/networking/instant-messengers/deltachat-desktop"}
|
||||
, "dhcp"
|
||||
, "diagnostic-languageserver"
|
||||
, "dockerfile-language-server-nodejs"
|
||||
|
1526
pkgs/development/node-packages/node-packages.nix
generated
1526
pkgs/development/node-packages/node-packages.nix
generated
File diff suppressed because it is too large
Load Diff
@ -1463,6 +1463,10 @@ with pkgs;
|
||||
|
||||
deltachat-cursed = callPackage ../applications/networking/instant-messengers/deltachat-cursed { };
|
||||
|
||||
deltachat-desktop = callPackage ../applications/networking/instant-messengers/deltachat-desktop {
|
||||
inherit (darwin.apple_sdk.frameworks) CoreServices;
|
||||
};
|
||||
|
||||
deltachat-electron = callPackage
|
||||
../applications/networking/instant-messengers/deltachat-electron { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user