Merge pull request #304439 from Qyriad/package/cinny
cinny-desktop: add macOS support
This commit is contained in:
commit
ada481d696
|
@ -16509,6 +16509,13 @@
|
||||||
fingerprint = "7573 56D7 79BB B888 773E 415E 736C CDF9 EF51 BD97";
|
fingerprint = "7573 56D7 79BB B888 773E 415E 736C CDF9 EF51 BD97";
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
qyriad = {
|
||||||
|
email = "qyriad@qyriad.me";
|
||||||
|
github = "Qyriad";
|
||||||
|
githubId = 1542224;
|
||||||
|
matrix = "@qyriad:katesiria.org";
|
||||||
|
name = "Qyriad";
|
||||||
|
};
|
||||||
r3dl3g = {
|
r3dl3g = {
|
||||||
email = "redleg@rothfuss-web.de";
|
email = "redleg@rothfuss-web.de";
|
||||||
github = "r3dl3g";
|
github = "r3dl3g";
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
{ lib
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, darwin
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
|
, rust
|
||||||
, rustPlatform
|
, rustPlatform
|
||||||
|
, cargo-tauri
|
||||||
, cinny
|
, cinny
|
||||||
, copyDesktopItems
|
, copyDesktopItems
|
||||||
, wrapGAppsHook
|
, wrapGAppsHook
|
||||||
|
@ -16,6 +20,7 @@
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "cinny-desktop";
|
pname = "cinny-desktop";
|
||||||
|
# We have to be using the same version as cinny-web or this isn't going to work.
|
||||||
version = "3.1.0";
|
version = "3.1.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
|
@ -37,33 +42,48 @@ rustPlatform.buildRustPackage rec {
|
||||||
in ''
|
in ''
|
||||||
substituteInPlace tauri.conf.json \
|
substituteInPlace tauri.conf.json \
|
||||||
--replace '"distDir": "../cinny/dist",' '"distDir": "${cinny'}",'
|
--replace '"distDir": "../cinny/dist",' '"distDir": "${cinny'}",'
|
||||||
|
substituteInPlace tauri.conf.json \
|
||||||
|
--replace '"cd cinny && npm run build"' '""'
|
||||||
|
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||||
substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
|
substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
|
||||||
--replace "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
|
--replace "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postBuild = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||||
|
cargo tauri build --bundles app --target "${rust.envVars.rustHostPlatform}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||||
install -DT icons/128x128@2x.png $out/share/icons/hicolor/256x256@2/apps/cinny.png
|
install -DT icons/128x128@2x.png $out/share/icons/hicolor/256x256@2/apps/cinny.png
|
||||||
install -DT icons/128x128.png $out/share/icons/hicolor/128x128/apps/cinny.png
|
install -DT icons/128x128.png $out/share/icons/hicolor/128x128/apps/cinny.png
|
||||||
install -DT icons/32x32.png $out/share/icons/hicolor/32x32/apps/cinny.png
|
install -DT icons/32x32.png $out/share/icons/hicolor/32x32/apps/cinny.png
|
||||||
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||||
|
mkdir -p "$out/Applications/"
|
||||||
|
cp -r "target/${rust.envVars.rustHostPlatform}/release/bundle/macos/Cinny.app" "$out/Applications/"
|
||||||
|
ln -sf "$out/Applications/Cinny.app/Contents/MacOS/Cinny" "$out/bin/cinny"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
copyDesktopItems
|
copyDesktopItems
|
||||||
wrapGAppsHook
|
wrapGAppsHook
|
||||||
pkg-config
|
pkg-config
|
||||||
|
cargo-tauri
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
openssl
|
openssl
|
||||||
dbus
|
dbus
|
||||||
glib
|
glib
|
||||||
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
glib-networking
|
glib-networking
|
||||||
libayatana-appindicator
|
libayatana-appindicator
|
||||||
webkitgtk
|
webkitgtk
|
||||||
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||||
|
darwin.DarwinTools
|
||||||
|
darwin.apple_sdk.frameworks.WebKit
|
||||||
];
|
];
|
||||||
|
|
||||||
desktopItems = [
|
desktopItems = lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
(makeDesktopItem {
|
(makeDesktopItem {
|
||||||
name = "cinny";
|
name = "cinny";
|
||||||
exec = "cinny";
|
exec = "cinny";
|
||||||
|
@ -77,9 +97,9 @@ rustPlatform.buildRustPackage rec {
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Yet another matrix client for desktop";
|
description = "Yet another matrix client for desktop";
|
||||||
homepage = "https://github.com/cinnyapp/cinny-desktop";
|
homepage = "https://github.com/cinnyapp/cinny-desktop";
|
||||||
maintainers = [ ];
|
maintainers = with maintainers; [ qyriad ];
|
||||||
license = licenses.agpl3Only;
|
license = licenses.agpl3Only;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
mainProgram = "cinny";
|
mainProgram = "cinny";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user