From 6402231607610a1f80b6aaaf4c6d5c89c3db0bf2 Mon Sep 17 00:00:00 2001 From: Ryan Horiguchi Date: Tue, 8 Feb 2022 21:08:15 +0100 Subject: [PATCH] fragments: 1.5 -> 2.0.2 --- .../networking/p2p/fragments/default.nix | 97 +++++++++++-------- .../p2p/fragments/dependency-resolution.patch | 25 ----- 2 files changed, 55 insertions(+), 67 deletions(-) delete mode 100644 pkgs/applications/networking/p2p/fragments/dependency-resolution.patch diff --git a/pkgs/applications/networking/p2p/fragments/default.nix b/pkgs/applications/networking/p2p/fragments/default.nix index a07869209c7d..ebeba4c010e8 100644 --- a/pkgs/applications/networking/p2p/fragments/default.nix +++ b/pkgs/applications/networking/p2p/fragments/default.nix @@ -1,76 +1,89 @@ { lib , stdenv , fetchFromGitLab -, meson -, vala -, ninja -, pkg-config -, wrapGAppsHook -, desktop-file-utils +, fetchpatch , appstream-glib -, python3 +, dbus +, desktop-file-utils +, git , glib -, gtk3 -, libhandy -, libtransmission -, libb64 -, libutp -, miniupnpc -, dht -, libnatpmp -, libevent -, curl +, gtk4 +, libadwaita +, meson +, ninja , openssl -, zlib +, pkg-config +, python3 +, rustPlatform +, sqlite +, transmission +, wrapGAppsHook4 }: -stdenv.mkDerivation rec { +let + patchedTransmission = transmission.overrideAttrs (oldAttrs: { + patches = (oldAttrs.patches or []) ++ [ + (fetchpatch { + url = "https://raw.githubusercontent.com/flathub/de.haeckerfelix.Fragments/2aee477c8e26a24570f8dbbdbd1c49e017ae32eb/transmission_pdeathsig.patch"; + sha256 = "sha256-/rCoA566tMmzqcIfffC082Y56TwEyyQJ0knxymtscbA="; + }) + ]; + }); +in stdenv.mkDerivation rec { pname = "fragments"; - version = "1.5"; + version = "2.0.2"; src = fetchFromGitLab { domain = "gitlab.gnome.org"; owner = "World"; repo = "Fragments"; rev = version; - sha256 = "0x1kafhlgyi65l4w67c24r8mpvasg3q3c4wlgnjc9sxvp6ki7xbn"; + sha256 = "sha256-CMa1yka0kOxMhxSuazlJxTk4fzxuuwKYLBpEMwHbBUE="; }; - patches = [ - # Fix dependency resolution - ./dependency-resolution.patch - ]; + postPatch = '' + patchShebangs build-aux/meson/postinstall.py + ''; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-/rFZcbpITYkpSCEZp9XH253u90RGmuVLEBGIRNBgI/o="; + }; nativeBuildInputs = [ + appstream-glib + desktop-file-utils + git meson - vala ninja pkg-config - wrapGAppsHook - desktop-file-utils - appstream-glib python3 - ]; + wrapGAppsHook4 + ] ++ (with rustPlatform; [ + cargoSetupHook + rust.cargo + rust.rustc + ]); buildInputs = [ + dbus glib - gtk3 - libhandy - libtransmission - libb64 - libutp - miniupnpc - dht - libnatpmp - libevent - curl + gtk4 + libadwaita openssl - zlib + sqlite ]; + preFixup = '' + gappsWrapperArgs+=( + --prefix PATH : "${lib.makeBinPath [ patchedTransmission ]}" + ) + ''; + meta = with lib; { homepage = "https://gitlab.gnome.org/World/Fragments"; - description = "A GTK3 BitTorrent Client"; + description = "Easy to use BitTorrent client for the GNOME desktop environment"; maintainers = with maintainers; [ emilytrau ]; license = licenses.gpl3Plus; platforms = platforms.linux; diff --git a/pkgs/applications/networking/p2p/fragments/dependency-resolution.patch b/pkgs/applications/networking/p2p/fragments/dependency-resolution.patch deleted file mode 100644 index 0446bc1390c7..000000000000 --- a/pkgs/applications/networking/p2p/fragments/dependency-resolution.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/meson.build b/meson.build -index 5030d0c..6de7a20 100644 ---- a/meson.build -+++ b/meson.build -@@ -32,10 +32,11 @@ transmission_dep = declare_dependency( - meson.get_compiler('c').find_library('dht'), - meson.get_compiler('c').find_library('natpmp'), - meson.get_compiler('c').find_library('event'), -- meson.get_compiler('c').find_library('libcurl'), -- meson.get_compiler('c').find_library('libcrypto'), -+ meson.get_compiler('c').find_library('curl'), -+ meson.get_compiler('c').find_library('crypto'), -+ meson.get_compiler('c').find_library('ssl'), - meson.get_compiler('c').find_library('libpthread'), -- meson.get_compiler('c').find_library('libz'), -+ meson.get_compiler('c').find_library('z'), - transmission_vapi, - transmission_lib - ]) -@@ -45,4 +46,4 @@ subdir('data') - subdir('po') - subdir('src') - --meson.add_install_script('build-aux/postinstall.py') -+meson.add_install_script('python3', '../build-aux/postinstall.py')