diff options
author | huantian <davidtianli@gmail.com> | 2023-09-01 12:46:12 -0700 |
---|---|---|
committer | huantian <davidtianli@gmail.com> | 2023-09-04 11:39:32 -0700 |
commit | e095938c264cbf9d4df737a2535d6e642293097e (patch) | |
tree | f3532442194a236de26c7cd6c48c60ef77c6cd6c /pkgs/applications/networking/instant-messengers/cinny-desktop | |
parent | 6d9e1eb60a37a4dec85623598ec38ac201e846d7 (diff) |
cinny, cinny-desktop: build from source
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/cinny-desktop')
-rw-r--r-- | pkgs/applications/networking/instant-messengers/cinny-desktop/default.nix | 67 |
1 files changed, 48 insertions, 19 deletions
diff --git a/pkgs/applications/networking/instant-messengers/cinny-desktop/default.nix b/pkgs/applications/networking/instant-messengers/cinny-desktop/default.nix index 511b6bccb997e..2dbe74d3b34e7 100644 --- a/pkgs/applications/networking/instant-messengers/cinny-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/cinny-desktop/default.nix @@ -1,45 +1,74 @@ -{ stdenv -, lib -, dpkg -, fetchurl -, autoPatchelfHook -, glib-networking +{ lib +, fetchFromGitHub +, rustPlatform +, cinny +, copyDesktopItems +, wrapGAppsHook +, pkg-config , openssl +, dbus +, glib +, glib-networking , webkitgtk -, wrapGAppsHook +, makeDesktopItem }: -stdenv.mkDerivation rec { +rustPlatform.buildRustPackage rec { pname = "cinny-desktop"; version = "2.2.6"; - src = fetchurl { - url = "https://github.com/cinnyapp/cinny-desktop/releases/download/v${version}/Cinny_desktop-x86_64.deb"; - sha256 = "sha256-Bh7qBlHh2bQ6y2HnI4TtxMU6N3t04tr1Juoul2KMrqs="; + src = fetchFromGitHub { + owner = "cinnyapp"; + repo = "cinny-desktop"; + rev = "v${version}"; + hash = "sha256-RW6LeItIAHJk1e7qMa1MLIGb3jHvJ/KM8E9l1qR48w8="; }; + sourceRoot = "${src.name}/src-tauri"; + + cargoHash = "sha256-Iab/icQ9hFVh/o6egZVPa2zeKgO5WxzkluhRckcayvw="; + + postPatch = '' + substituteInPlace tauri.conf.json \ + --replace '"distDir": "../cinny/dist",' '"distDir": "${cinny}",' + ''; + + postInstall = '' + 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 + ''; + nativeBuildInputs = [ - autoPatchelfHook - dpkg + copyDesktopItems + wrapGAppsHook + pkg-config ]; buildInputs = [ - glib-networking openssl + dbus + glib + glib-networking webkitgtk - wrapGAppsHook ]; - unpackCmd = "dpkg-deb -x $curSrc source"; - - installPhase = "mv usr $out"; + desktopItems = [ + (makeDesktopItem { + name = "cinny"; + exec = "cinny"; + icon = "cinny"; + desktopName = "Cinny"; + comment = meta.description; + categories = [ "Network" "InstantMessaging" ]; + }) + ]; meta = with lib; { description = "Yet another matrix client for desktop"; homepage = "https://github.com/cinnyapp/cinny-desktop"; maintainers = [ maintainers.aveltras ]; license = licenses.agpl3Only; - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; platforms = platforms.linux; mainProgram = "cinny"; }; |