diff --git a/pkgs/applications/networking/p2p/fragments/default.nix b/pkgs/applications/networking/p2p/fragments/default.nix index da74fd5e60acb..fe911688c762c 100644 --- a/pkgs/applications/networking/p2p/fragments/default.nix +++ b/pkgs/applications/networking/p2p/fragments/default.nix @@ -17,12 +17,12 @@ , rustPlatform , rustc , sqlite -, transmission +, transmission_3 , wrapGAppsHook4 }: let - patchedTransmission = transmission.overrideAttrs (oldAttrs: { + patchedTransmission = transmission_3.overrideAttrs (oldAttrs: { patches = (oldAttrs.patches or []) ++ [ (fetchpatch { url = "https://raw.githubusercontent.com/flathub/de.haeckerfelix.Fragments/2aee477c8e26a24570f8dbbdbd1c49e017ae32eb/transmission_pdeathsig.patch"; diff --git a/pkgs/applications/networking/p2p/libutp/3.3.nix b/pkgs/applications/networking/p2p/libutp/3.3.nix new file mode 100644 index 0000000000000..a07ffdea6b69d --- /dev/null +++ b/pkgs/applications/networking/p2p/libutp/3.3.nix @@ -0,0 +1,24 @@ +{ stdenv, lib, fetchFromGitHub, cmake }: + +stdenv.mkDerivation rec { + pname = "libutp"; + version = "unstable-2017-01-02"; + + src = fetchFromGitHub { + # Use transmission fork from post-3.3-transmission branch + owner = "transmission"; + repo = pname; + rev = "fda9f4b3db97ccb243fcbed2ce280eb4135d705b"; + sha256 = "CvuZLOBksIl/lS6LaqOIuzNvX3ihlIPjI3Eqwo7YJH0="; + }; + + nativeBuildInputs = [ cmake ]; + + meta = with lib; { + description = "uTorrent Transport Protocol library"; + homepage = "https://github.com/transmission/libutp"; + license = licenses.mit; + maintainers = with maintainers; [ emilytrau ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/applications/networking/p2p/libutp/default.nix b/pkgs/applications/networking/p2p/libutp/default.nix index a07ffdea6b69d..a7a7c7325bca5 100644 --- a/pkgs/applications/networking/p2p/libutp/default.nix +++ b/pkgs/applications/networking/p2p/libutp/default.nix @@ -1,18 +1,31 @@ -{ stdenv, lib, fetchFromGitHub, cmake }: +{ stdenv +, lib +, fetchFromGitHub +, cmake +, unstableGitUpdater +}: stdenv.mkDerivation rec { pname = "libutp"; - version = "unstable-2017-01-02"; + version = "unstable-2023-03-05"; src = fetchFromGitHub { - # Use transmission fork from post-3.3-transmission branch + # Use transmission fork from post-3.4-transmission branch owner = "transmission"; - repo = pname; - rev = "fda9f4b3db97ccb243fcbed2ce280eb4135d705b"; - sha256 = "CvuZLOBksIl/lS6LaqOIuzNvX3ihlIPjI3Eqwo7YJH0="; + repo = "libutp"; + rev = "9cb9f9c4f0073d78b08d6542cebaea6564ecadfe"; + sha256 = "dpbX1h/gpuVIAXC4hwwuRwQDJ0pwVVEsgemOVN0Dv9Q="; }; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ + cmake + ]; + + passthru = { + updateScript = unstableGitUpdater { + branch = "post-3.4-transmission"; + }; + }; meta = with lib; { description = "uTorrent Transport Protocol library"; diff --git a/pkgs/applications/networking/p2p/torrential/default.nix b/pkgs/applications/networking/p2p/torrential/default.nix index cfc10c3f7466f..ce739b4a34bd1 100644 --- a/pkgs/applications/networking/p2p/torrential/default.nix +++ b/pkgs/applications/networking/p2p/torrential/default.nix @@ -17,8 +17,8 @@ , libevent , libgee , libnatpmp -, libtransmission -, libutp +, transmission_3 +, libutp_3_3 , miniupnpc , openssl , pantheon @@ -54,8 +54,8 @@ stdenv.mkDerivation rec { libevent libgee libnatpmp - libtransmission - libutp + transmission_3 + libutp_3_3 miniupnpc openssl pantheon.granite7 diff --git a/pkgs/applications/networking/p2p/transmission/3.x.nix b/pkgs/applications/networking/p2p/transmission/3.x.nix new file mode 100644 index 0000000000000..905a2909c58d0 --- /dev/null +++ b/pkgs/applications/networking/p2p/transmission/3.x.nix @@ -0,0 +1,79 @@ +{ stdenv +, lib +, fetchFromGitHub +, fetchurl +, cmake +, pkg-config +, openssl +, curl +, libevent +, inotify-tools +, zlib +, pcre +, libb64 +, libutp_3_3 +, miniupnpc +, dht +, libnatpmp +, libiconv +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "transmission3"; + version = "3.00"; + + src = fetchFromGitHub { + owner = "transmission"; + repo = "transmission"; + rev = finalAttrs.version; + sha256 = "0ccg0km54f700x9p0jsnncnwvfnxfnxf7kcm7pcx1cj0vw78924z"; + fetchSubmodules = true; + }; + + patches = [ + # fix build with openssl 3.0 + (fetchurl { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/net-p2p/transmission/files/transmission-3.00-openssl-3.patch"; + hash = "sha256-peVrkGck8AfbC9uYNfv1CIu1alIewpca7A6kRXjVlVs="; + }) + ]; + + nativeBuildInputs = [ + pkg-config + cmake + ]; + + buildInputs = [ + openssl + curl + libevent + zlib + pcre + libb64 + libutp_3_3 + miniupnpc + dht + libnatpmp + ] ++ lib.optionals stdenv.isLinux [ + inotify-tools + ] ++ lib.optionals stdenv.isDarwin [ + libiconv + ]; + + cmakeFlags = [ + "-DENABLE_MAC=OFF" # requires xcodebuild + "-DENABLE_GTK=OFF" + "-DENABLE_QT=OFF" + "-DENABLE_DAEMON=ON" + "-DENABLE_CLI=OFF" + "-DINSTALL_LIB=ON" + ]; + + meta = { + description = "Old version of libtransmission library for apps that depend on it"; + homepage = "http://www.transmissionbt.com/"; + license = lib.licenses.gpl2Plus; # parts are under MIT + maintainers = with lib.maintainers; [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix index cc82c5038083c..cde2704083c25 100644 --- a/pkgs/applications/networking/p2p/transmission/default.nix +++ b/pkgs/applications/networking/p2p/transmission/default.nix @@ -1,7 +1,6 @@ { stdenv , lib , fetchFromGitHub -, fetchurl , cmake , pkg-config , openssl @@ -17,9 +16,14 @@ , dht , libnatpmp , libiconv +, libdeflate +, utf8cpp +, fmt +, libpsl +, python3 # Build options , enableGTK3 ? false -, gtk3 +, gtkmm3 , xorg , wrapGAppsHook , enableQt ? false @@ -30,32 +34,62 @@ , enableCli ? true , installLib ? false , apparmorRulesFromClosure +, darwin }: -let - version = "3.00"; - -in stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "transmission"; - inherit version; + version = "4.0.2"; + + outputs = [ "out" "apparmor" ]; src = fetchFromGitHub { owner = "transmission"; repo = "transmission"; - rev = version; - sha256 = "0ccg0km54f700x9p0jsnncnwvfnxfnxf7kcm7pcx1cj0vw78924z"; + rev = finalAttrs.version; + hash = "sha256-DaaJnnWEZOl6zLVxgg+U8C5ztv7Iq0wJ9yle0Gxwybc="; fetchSubmodules = true; }; - patches = [ - # fix build with openssl 3.0 - (fetchurl { - url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/net-p2p/transmission/files/transmission-3.00-openssl-3.patch"; - hash = "sha256-peVrkGck8AfbC9uYNfv1CIu1alIewpca7A6kRXjVlVs="; - }) + nativeBuildInputs = [ + pkg-config + cmake + python3 + ] ++ lib.optionals enableGTK3 [ + wrapGAppsHook + ] ++ lib.optionals enableQt [ + qt5.wrapQtAppsHook ]; - outputs = [ "out" "apparmor" ]; + buildInputs = [ + openssl + curl + libevent + zlib + pcre + libb64 + libutp + miniupnpc + dht + libnatpmp + libdeflate + utf8cpp + fmt + libpsl + ] ++ lib.optionals enableQt [ + qt5.qttools + qt5.qtbase + ] ++ lib.optionals enableGTK3 [ + gtkmm3 + xorg.libpthreadstubs + ] ++ lib.optionals enableSystemd [ + systemd + ] ++ lib.optionals stdenv.isLinux [ + inotify-tools + ] ++ lib.optionals stdenv.isDarwin [ + libiconv + darwin.apple_sdk.frameworks.Foundation + ]; cmakeFlags = let @@ -68,59 +102,74 @@ in stdenv.mkDerivation { "-DENABLE_DAEMON=${mkFlag enableDaemon}" "-DENABLE_CLI=${mkFlag enableCli}" "-DINSTALL_LIB=${mkFlag installLib}" + ] ++ lib.optionals stdenv.isDarwin [ + # Transmission sets this to 10.13 if not explicitly specified, see https://github.com/transmission/transmission/blob/0be7091eb12f4eb55f6690f313ef70a66795ee72/CMakeLists.txt#L7-L16. + "-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinMinVersion}" ]; - nativeBuildInputs = [ - pkg-config - cmake - ] - ++ lib.optionals enableGTK3 [ wrapGAppsHook ] - ++ lib.optionals enableQt [ qt5.wrapQtAppsHook ] - ; + postPatch = '' + # Clean third-party libraries to ensure system ones are used. + # Excluding gtest since it is hardcoded to vendored version. The rest of the listed libraries are not packaged. + pushd third-party + for f in *; do + if [[ ! $f =~ googletest|wildmat|fast_float|wide-integer|jsonsl ]]; then + rm -r "$f" + fi + done + popd + rm \ + cmake/FindFmt.cmake \ + cmake/FindUtfCpp.cmake - buildInputs = [ - openssl - curl - libevent - zlib - pcre - libb64 - libutp - miniupnpc - dht - libnatpmp - ] - ++ lib.optionals enableQt [ qt5.qttools qt5.qtbase ] - ++ lib.optionals enableGTK3 [ gtk3 xorg.libpthreadstubs ] - ++ lib.optionals enableSystemd [ systemd ] - ++ lib.optionals stdenv.isLinux [ inotify-tools ] - ++ lib.optionals stdenv.isDarwin [ libiconv ]; + # Upstream uses different config file name. + substituteInPlace CMakeLists.txt --replace 'find_package(UtfCpp)' 'find_package(utf8cpp)' + ''; - postInstall = '' - mkdir $apparmor - cat >$apparmor/bin.transmission-daemon < - $out/bin/transmission-daemon { - include - include - include - include "${apparmorRulesFromClosure { name = "transmission-daemon"; } ([ - curl libevent openssl pcre zlib libnatpmp miniupnpc - ] ++ lib.optionals enableSystemd [ systemd ] - ++ lib.optionals stdenv.isLinux [ inotify-tools ] - )}" - r @{PROC}/sys/kernel/random/uuid, - r @{PROC}/sys/vm/overcommit_memory, - r @{PROC}/@{pid}/environ, - r @{PROC}/@{pid}/mounts, - rwk /tmp/tr_session_id_*, + postInstall = + let + rules = + apparmorRulesFromClosure + { + name = "transmission-daemon"; + } + ([ + curl + libevent + openssl + pcre + zlib + libdeflate + libpsl + libnatpmp + miniupnpc + ] ++ lib.optionals enableSystemd [ + systemd + ] + ++ lib.optionals stdenv.isLinux [ + inotify-tools + ]); + in + '' + mkdir "$apparmor" + cat >"$apparmor/bin.transmission-daemon" < + $out/bin/transmission-daemon { + include + include + include + include "${rules}" + r @{PROC}/sys/kernel/random/uuid, + r @{PROC}/sys/vm/overcommit_memory, + r @{PROC}/@{pid}/environ, + r @{PROC}/@{pid}/mounts, + rwk /tmp/tr_session_id_*, - r $out/share/transmission/web/**, + r $out/share/transmission/web/**, - include - } - EOF - ''; + include + } + EOF + ''; passthru.tests = { apparmor = nixosTests.transmission; # starts the service with apparmor enabled @@ -145,5 +194,4 @@ in stdenv.mkDerivation { maintainers = with lib.maintainers; [ astsmtl ]; platforms = lib.platforms.unix; }; - -} +}) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index f3df5f2cc5d6c..541c91f832223 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -907,6 +907,7 @@ mapAliases ({ libtorrentRasterbar = libtorrent-rasterbar; # Added 2020-12-20 libtorrentRasterbar-1_2_x = libtorrent-rasterbar-1_2_x; # Added 2020-12-20 libtorrentRasterbar-2_0_x = libtorrent-rasterbar-2_0_x; # Added 2020-12-20 + libtransmission = transmission_3; libtxc_dxtn = throw "libtxc_dxtn was removed 2020-03-16, now integrated in Mesa"; libtxc_dxtn_s2tc = throw "libtxc_dxtn_s2tc was removed 2020-03-16, now integrated in Mesa"; libudev = throw "'libudev' has been renamed to/replaced by 'udev'"; # Converted to throw 2022-02-22 @@ -1687,6 +1688,7 @@ mapAliases ({ torchPackages = throw "torchPackages has been removed, as the upstream project has been abandoned"; # Added 2020-03-28 trang = throw "'trang' has been renamed to/replaced by 'jing-trang'"; # Converted to throw 2022-02-22 transfig = fig2dev; # Added 2022-02-15 + transmission = transmission_3; transmission-remote-cli = throw "transmission-remote-cli has been removed, as the upstream project has been abandoned. Please use tremc instead"; # Added 2020-10-14 transmission_gtk = throw "'transmission_gtk' has been renamed to/replaced by 'transmission-gtk'"; # Converted to throw 2022-02-22 transmission_remote_gtk = throw "'transmission_remote_gtk' has been renamed to/replaced by 'transmission-remote-gtk'"; # Converted to throw 2022-02-22 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ec146342702aa..332af40ebb854 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -32469,6 +32469,8 @@ with pkgs; libutp = callPackage ../applications/networking/p2p/libutp { }; + libutp_3_3 = callPackage ../applications/networking/p2p/libutp/3.3.nix { }; + lifelines = callPackage ../applications/misc/lifelines { }; liferea = callPackage ../applications/networking/newsreaders/liferea { }; @@ -34989,14 +34991,18 @@ with pkgs; transcribe = callPackage ../applications/audio/transcribe { }; - transmission = callPackage ../applications/networking/p2p/transmission { }; - libtransmission = transmission.override { + transmission_3 = callPackage ../applications/networking/p2p/transmission/3.x.nix { }; + transmission-gtk = transmission_3.override { enableGTK3 = true; }; + transmission-qt = transmission_3.override { enableQt = true; }; + + transmission_4 = callPackage ../applications/networking/p2p/transmission { }; + transmission_4-gtk = transmission_4.override { enableGTK3 = true; }; + transmission_4-qt = transmission_4.override { enableQt = true; }; + libtransmission_4 = transmission_4.override { installLib = true; enableDaemon = false; enableCli = false; }; - transmission-gtk = transmission.override { enableGTK3 = true; }; - transmission-qt = transmission.override { enableQt = true; }; transmission-remote-gtk = callPackage ../applications/networking/p2p/transmission-remote-gtk { };