From 760949b72bcb5762ffed8c39124f1704e784b1d4 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Sun, 2 Jul 2023 20:12:10 +0200 Subject: [PATCH] transmission_4: make sure to use dependencies from nixpkgs --- .../networking/p2p/transmission/4.nix | 41 +++++++++++++++---- pkgs/top-level/all-packages.nix | 5 ++- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/networking/p2p/transmission/4.nix b/pkgs/applications/networking/p2p/transmission/4.nix index 82f6aa83ed7c..6ad2c8dd0828 100644 --- a/pkgs/applications/networking/p2p/transmission/4.nix +++ b/pkgs/applications/networking/p2p/transmission/4.nix @@ -14,6 +14,9 @@ , libb64 , libutp , libdeflate +, utf8cpp +, fmt +, libpsl , miniupnpc , dht , libnatpmp @@ -64,6 +67,23 @@ stdenv.mkDerivation rec { "-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinMinVersion}" ]; + 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 + # Upstream uses different config file name. + substituteInPlace CMakeLists.txt --replace 'find_package(UtfCpp)' 'find_package(utf8cpp)' + ''; + nativeBuildInputs = [ pkg-config cmake @@ -74,17 +94,20 @@ stdenv.mkDerivation rec { ; buildInputs = [ - openssl curl - libevent - zlib - pcre - libb64 - libutp - libdeflate - miniupnpc dht + fmt + libb64 + libdeflate + libevent libnatpmp + libpsl + libutp + miniupnpc + openssl + pcre + utf8cpp + zlib ] ++ lib.optionals enableQt [ qt5.qttools qt5.qtbase ] ++ lib.optionals enableGTK3 [ gtkmm3 xorg.libpthreadstubs ] @@ -101,7 +124,7 @@ stdenv.mkDerivation rec { include include include "${apparmorRulesFromClosure { name = "transmission-daemon"; } ([ - curl libevent openssl pcre zlib libdeflate libnatpmp miniupnpc + curl libevent openssl pcre zlib libdeflate libpsl libnatpmp miniupnpc ] ++ lib.optionals enableSystemd [ systemd ] ++ lib.optionals stdenv.isLinux [ inotify-tools ] )}" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ba833ab7a4dd..da3910ca91ec 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -35213,7 +35213,10 @@ with pkgs; transmission-gtk = transmission.override { enableGTK3 = true; }; transmission-qt = transmission.override { enableQt = true; }; - transmission_4 = callPackage ../applications/networking/p2p/transmission/4.nix { }; + transmission_4 = callPackage ../applications/networking/p2p/transmission/4.nix { + fmt = fmt_9; + libutp = libutp_3_4; + }; libtransmission_4 = transmission_4.override { installLib = true; enableDaemon = false;