From 237b25b55629f4bf0c5a87a1330fcf7f64e9a7e3 Mon Sep 17 00:00:00 2001 From: Ryan Omasta Date: Thu, 15 Aug 2024 01:53:26 -0600 Subject: [PATCH 1/4] cinny-desktop: migrate to pkgs/by-name, add ryand56 to maintainers --- .../default.nix => by-name/ci/cinny-desktop/package.nix} | 2 +- pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) rename pkgs/{applications/networking/instant-messengers/cinny-desktop/default.nix => by-name/ci/cinny-desktop/package.nix} (98%) diff --git a/pkgs/applications/networking/instant-messengers/cinny-desktop/default.nix b/pkgs/by-name/ci/cinny-desktop/package.nix similarity index 98% rename from pkgs/applications/networking/instant-messengers/cinny-desktop/default.nix rename to pkgs/by-name/ci/cinny-desktop/package.nix index a7742b91e0c7..80d21e621e3b 100644 --- a/pkgs/applications/networking/instant-messengers/cinny-desktop/default.nix +++ b/pkgs/by-name/ci/cinny-desktop/package.nix @@ -96,7 +96,7 @@ rustPlatform.buildRustPackage rec { meta = { description = "Yet another matrix client for desktop"; homepage = "https://github.com/cinnyapp/cinny-desktop"; - maintainers = with lib.maintainers; [ qyriad ]; + maintainers = with lib.maintainers; [ qyriad ryand56 ]; license = lib.licenses.agpl3Only; platforms = lib.platforms.linux ++ lib.platforms.darwin; mainProgram = "cinny"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5e56ba32c390..d0225e637019 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4445,8 +4445,6 @@ with pkgs; cht-sh = callPackage ../tools/misc/cht.sh { }; - cinny-desktop = callPackage ../applications/networking/instant-messengers/cinny-desktop { }; - ckbcomp = callPackage ../tools/X11/ckbcomp { }; clac = callPackage ../tools/misc/clac { }; From ce84b361b57c90788904cc954a4df27481083b96 Mon Sep 17 00:00:00 2001 From: Ryan Omasta Date: Sun, 18 Aug 2024 15:59:43 -0600 Subject: [PATCH 2/4] cinny-desktop: override cinny dependency with hashRouter --- pkgs/by-name/ci/cinny-desktop/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ci/cinny-desktop/package.nix b/pkgs/by-name/ci/cinny-desktop/package.nix index 80d21e621e3b..82a34af864be 100644 --- a/pkgs/by-name/ci/cinny-desktop/package.nix +++ b/pkgs/by-name/ci/cinny-desktop/package.nix @@ -37,7 +37,11 @@ rustPlatform.buildRustPackage rec { postPatch = let cinny' = assert lib.assertMsg (cinny.version == version) "cinny.version (${cinny.version}) != cinny-desktop.version (${version})"; - cinny; + cinny.override { + conf = { + hashRouter.enabled = true; + }; + }; in '' substituteInPlace tauri.conf.json \ --replace '"distDir": "../cinny/dist",' '"distDir": "${cinny'}",' From 9f136138197b9f0e85f9bd9594b234774ff4fbf8 Mon Sep 17 00:00:00 2001 From: Ryan Omasta Date: Sun, 18 Aug 2024 16:01:12 -0600 Subject: [PATCH 3/4] cinny-desktop: format using nixfmt-rfc-style --- pkgs/by-name/ci/cinny-desktop/package.nix | 131 ++++++++++++---------- 1 file changed, 74 insertions(+), 57 deletions(-) diff --git a/pkgs/by-name/ci/cinny-desktop/package.nix b/pkgs/by-name/ci/cinny-desktop/package.nix index 82a34af864be..2d34b78f5eb3 100644 --- a/pkgs/by-name/ci/cinny-desktop/package.nix +++ b/pkgs/by-name/ci/cinny-desktop/package.nix @@ -1,21 +1,22 @@ -{ lib -, stdenv -, darwin -, fetchFromGitHub -, rust -, rustPlatform -, cargo-tauri -, cinny -, copyDesktopItems -, wrapGAppsHook3 -, pkg-config -, openssl -, dbus -, glib -, glib-networking -, libayatana-appindicator -, webkitgtk -, makeDesktopItem +{ + lib, + stdenv, + darwin, + fetchFromGitHub, + rust, + rustPlatform, + cargo-tauri, + cinny, + copyDesktopItems, + wrapGAppsHook3, + pkg-config, + openssl, + dbus, + glib, + glib-networking, + libayatana-appindicator, + webkitgtk, + makeDesktopItem, }: rustPlatform.buildRustPackage rec { @@ -34,37 +35,44 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-bM+V37PJAob/DA2jy2g69zUY99ZyZBzgO6djadbdiJw="; - postPatch = let - cinny' = - assert lib.assertMsg (cinny.version == version) "cinny.version (${cinny.version}) != cinny-desktop.version (${version})"; - cinny.override { - conf = { - hashRouter.enabled = true; + postPatch = + let + cinny' = + assert lib.assertMsg ( + cinny.version == version + ) "cinny.version (${cinny.version}) != cinny-desktop.version (${version})"; + cinny.override { + conf = { + hashRouter.enabled = true; + }; }; - }; - in '' - substituteInPlace tauri.conf.json \ - --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 \ - --replace "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" - ''; + in + '' + substituteInPlace tauri.conf.json \ + --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 \ + --replace "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" + ''; 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.png $out/share/icons/hicolor/128x128/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" - ''; + 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.png $out/share/icons/hicolor/128x128/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 = [ copyDesktopItems @@ -73,18 +81,21 @@ rustPlatform.buildRustPackage rec { cargo-tauri ]; - buildInputs = [ - openssl - dbus - glib - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ - glib-networking - libayatana-appindicator - webkitgtk - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.DarwinTools - darwin.apple_sdk.frameworks.WebKit - ]; + buildInputs = + [ + openssl + dbus + glib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + glib-networking + libayatana-appindicator + webkitgtk + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.DarwinTools + darwin.apple_sdk.frameworks.WebKit + ]; desktopItems = lib.optionals stdenv.hostPlatform.isLinux [ (makeDesktopItem { @@ -93,14 +104,20 @@ rustPlatform.buildRustPackage rec { icon = "cinny"; desktopName = "Cinny"; comment = meta.description; - categories = [ "Network" "InstantMessaging" ]; + categories = [ + "Network" + "InstantMessaging" + ]; }) ]; meta = { description = "Yet another matrix client for desktop"; homepage = "https://github.com/cinnyapp/cinny-desktop"; - maintainers = with lib.maintainers; [ qyriad ryand56 ]; + maintainers = with lib.maintainers; [ + qyriad + ryand56 + ]; license = lib.licenses.agpl3Only; platforms = lib.platforms.linux ++ lib.platforms.darwin; mainProgram = "cinny"; From b26ca1d0713d21b9c6448a7a6a724dd0ce3e9660 Mon Sep 17 00:00:00 2001 From: Ryan Omasta Date: Sun, 18 Aug 2024 16:02:39 -0600 Subject: [PATCH 4/4] cinny-desktop: 4.0.3 -> 4.1.0 --- pkgs/by-name/ci/cinny-desktop/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ci/cinny-desktop/package.nix b/pkgs/by-name/ci/cinny-desktop/package.nix index 2d34b78f5eb3..eaba2e8e40b4 100644 --- a/pkgs/by-name/ci/cinny-desktop/package.nix +++ b/pkgs/by-name/ci/cinny-desktop/package.nix @@ -22,18 +22,18 @@ rustPlatform.buildRustPackage rec { pname = "cinny-desktop"; # We have to be using the same version as cinny-web or this isn't going to work. - version = "4.0.3"; + version = "4.1.0"; src = fetchFromGitHub { owner = "cinnyapp"; repo = "cinny-desktop"; - rev = "v${version}"; - hash = "sha256-05T/2e5+st+vGQuO8lRw6KWz3+Qiqd14dCPvayyz5mo="; + rev = "refs/tags/v${version}"; + hash = "sha256-3HwKDD0O1Yx2OIjyO5FhV4d1INAIFXMO7FjSL7cOVmI="; }; sourceRoot = "${src.name}/src-tauri"; - cargoHash = "sha256-bM+V37PJAob/DA2jy2g69zUY99ZyZBzgO6djadbdiJw="; + cargoHash = "sha256-CwB4S/5UuDH1LlJ4CY77XUCriplT3ZFfdg1j41AUoTI="; postPatch = let