riot-desktop: init at 1.0.4

This commit is contained in:
pacien 2019-03-18 02:59:57 +01:00
parent d630716229
commit 839c988dd0
4 changed files with 1242 additions and 0 deletions

View File

@ -0,0 +1,15 @@
{
"name": "riot-web",
"productName": "Riot",
"main": "src/electron-main.js",
"version": "1.0.4",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"dependencies": {
"auto-launch": "^5.0.1",
"electron-store": "^2.0.0",
"electron-window-state": "^4.1.0",
"minimist": "^1.2.0",
"png-to-ico": "^1.0.2"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
{ stdenv, fetchFromGitHub, yarn2nix, makeWrapper, makeDesktopItem, electron, riot-web }:
let
executableName = "riot-desktop";
version = "1.0.4";
riot-web-src = fetchFromGitHub {
owner = "vector-im";
repo = "riot-web";
rev = "v${version}";
sha256 = "152mi81miams5a7l9rd12bnf6wkd1r0lyicgr35r5fq0p6z7a4dk";
};
in yarn2nix.mkYarnPackage rec {
name = "riot-desktop-${version}";
inherit version;
src = "${riot-web-src}/electron_app";
# The package manifest should be copied on each update of this package.
# > cp ${riot-web-src}/electron_app/package.json riot-desktop-package.json
packageJSON = ./riot-desktop-package.json;
# The dependency expression can be regenerated using nixos.yarn2nix with the following command:
# > yarn2nix --lockfile=${riot-web-src}/electron_app/yarn.lock > riot-desktop-yarndeps.nix
yarnNix = ./riot-desktop-yarndeps.nix;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
# resources
mkdir -p "$out/share/riot"
ln -s '${riot-web}' "$out/share/riot/webapp"
cp -r '${riot-web-src}/origin_migrator' "$out/share/riot/origin_migrator"
cp -r '.' "$out/share/riot/electron"
# icons
for icon in $out/share/riot/electron/build/icons/*.png; do
mkdir -p "$out/share/icons/hicolor/$(basename $icon .png)/apps"
ln -s "$icon" "$out/share/icons/hicolor/$(basename $icon .png)/apps/riot.png"
done
# desktop item
mkdir -p "$out/share"
ln -s "${desktopItem}/share/applications" "$out/share/applications"
# executable wrapper
makeWrapper '${electron}/bin/electron' "$out/bin/${executableName}" \
--add-flags "$out/share/riot/electron"
'';
# The desktop item properties should be kept in sync with data from upstream:
# * productName and description from
# https://github.com/vector-im/riot-web/blob/develop/electron_app/package.json
# * category and StartupWMClass from the build.linux section of
# https://github.com/vector-im/riot-web/blob/develop/package.json
desktopItem = makeDesktopItem {
inherit name;
exec = executableName;
icon = "riot";
desktopName = "Riot";
genericName = "Matrix Client";
comment = meta.description;
categories = "Network;InstantMessaging;Chat;";
extraEntries = ''
StartupWMClass="riot"
'';
};
meta = with stdenv.lib; {
description = "A feature-rich client for Matrix.org";
homepage = https://about.riot.im/;
license = licenses.asl20;
maintainers = with maintainers; [ pacien ];
inherit (electron.meta) platforms;
};
}

View File

@ -1678,6 +1678,8 @@ in
ring-daemon = callPackage ../applications/networking/instant-messengers/ring-daemon { };
riot-desktop = callPackage ../applications/networking/instant-messengers/riot/riot-desktop.nix { };
riot-web = callPackage ../applications/networking/instant-messengers/riot/riot-web.nix {
conf = config.riot-web.conf or null;
};