about summary refs log tree commit diff
path: root/pkgs/by-name/tr
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/tr')
-rw-r--r--pkgs/by-name/tr/transmission_3/package.nix144
-rw-r--r--pkgs/by-name/tr/transmission_3/transmission-3.00-openssl-3.patch37
-rw-r--r--pkgs/by-name/tr/trealla/package.nix4
-rw-r--r--pkgs/by-name/tr/treefmt1/package.nix (renamed from pkgs/by-name/tr/treefmt/package.nix)0
-rw-r--r--pkgs/by-name/tr/treefmt2/package.nix2
5 files changed, 184 insertions, 3 deletions
diff --git a/pkgs/by-name/tr/transmission_3/package.nix b/pkgs/by-name/tr/transmission_3/package.nix
new file mode 100644
index 0000000000000..3b5c4d30d2f8f
--- /dev/null
+++ b/pkgs/by-name/tr/transmission_3/package.nix
@@ -0,0 +1,144 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, fetchurl
+, cmake
+, pkg-config
+, openssl
+, curl
+, libevent
+, inotify-tools
+, systemd
+, zlib
+, pcre
+, libb64
+, libutp
+, miniupnpc
+, dht
+, libnatpmp
+, libiconv
+  # Build options
+, enableGTK3 ? false
+, gtk3
+, xorg
+, wrapGAppsHook3
+, enableQt ? false
+, qt5
+, nixosTests
+, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
+, enableDaemon ? true
+, enableCli ? true
+, installLib ? false
+, apparmorRulesFromClosure
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "transmission";
+  version = "3.00";
+
+  src = fetchFromGitHub {
+    owner = "transmission";
+    repo = "transmission";
+    rev = finalAttrs.version;
+    sha256 = "0ccg0km54f700x9p0jsnncnwvfnxfnxf7kcm7pcx1cj0vw78924z";
+    fetchSubmodules = true;
+  };
+
+  patches = [
+    # fix build with openssl 3.0
+    ./transmission-3.00-openssl-3.patch
+  ];
+
+  outputs = [ "out" "apparmor" ];
+
+  cmakeFlags =
+    let
+      mkFlag = opt: if opt then "ON" else "OFF";
+    in
+    [
+      "-DENABLE_MAC=OFF" # requires xcodebuild
+      "-DENABLE_GTK=${mkFlag enableGTK3}"
+      "-DENABLE_QT=${mkFlag enableQt}"
+      "-DENABLE_DAEMON=${mkFlag enableDaemon}"
+      "-DENABLE_CLI=${mkFlag enableCli}"
+      "-DINSTALL_LIB=${mkFlag installLib}"
+    ];
+
+  nativeBuildInputs = [
+    pkg-config
+    cmake
+  ]
+  ++ lib.optionals enableGTK3 [ wrapGAppsHook3 ]
+  ++ lib.optionals enableQt [ qt5.wrapQtAppsHook ]
+  ;
+
+  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 ];
+
+  postInstall = ''
+    mkdir $apparmor
+    cat >$apparmor/bin.transmission-daemon <<EOF
+    include <tunables/global>
+    $out/bin/transmission-daemon {
+      include <abstractions/base>
+      include <abstractions/nameservice>
+      include <abstractions/ssl_certs>
+      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_*,
+
+      r $out/share/transmission/web/**,
+
+      include <local/bin.transmission-daemon>
+    }
+    EOF
+  '';
+
+  passthru.tests = {
+    apparmor = nixosTests.transmission_3; # starts the service with apparmor enabled
+    smoke-test = nixosTests.bittorrent;
+  };
+
+  meta = {
+    description = "Fast, easy and free BitTorrent client (deprecated version 3)";
+    mainProgram = if enableQt then "transmission-qt" else if enableGTK3 then "transmission-gtk" else "transmission-cli";
+    longDescription = ''
+      Transmission is a BitTorrent client which features a simple interface
+      on top of a cross-platform back-end.
+      Feature spotlight:
+        * Uses fewer resources than other clients
+        * Native Mac, GTK and Qt GUI clients
+        * Daemon ideal for servers, embedded systems, and headless use
+        * All these can be remote controlled by Web and Terminal clients
+        * Bluetack (PeerGuardian) blocklists with automatic updates
+        * Full encryption, DHT, and PEX support
+    '';
+    homepage = "http://www.transmissionbt.com/";
+    license = lib.licenses.gpl2Plus; # parts are under MIT
+    maintainers = with lib.maintainers; [ astsmtl ];
+    platforms = lib.platforms.unix;
+  };
+
+})
diff --git a/pkgs/by-name/tr/transmission_3/transmission-3.00-openssl-3.patch b/pkgs/by-name/tr/transmission_3/transmission-3.00-openssl-3.patch
new file mode 100644
index 0000000000000..f288298cbf3d4
--- /dev/null
+++ b/pkgs/by-name/tr/transmission_3/transmission-3.00-openssl-3.patch
@@ -0,0 +1,37 @@
+From 6ee128b95bacaff20746538dc97c2b8e2b9fcc29 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Sun, 15 May 2022 10:54:38 -0400
+Subject: [PATCH] openssl: load "legacy" provider for RC4
+
+---
+ libtransmission/crypto-utils-openssl.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/libtransmission/crypto-utils-openssl.c b/libtransmission/crypto-utils-openssl.c
+index 45fd71913..14d680654 100644
+--- a/libtransmission/crypto-utils-openssl.c
++++ b/libtransmission/crypto-utils-openssl.c
+@@ -20,6 +20,9 @@
+ #include <openssl/rand.h>
+ #include <openssl/ssl.h>
+ #include <openssl/x509.h>
++#if OPENSSL_VERSION_MAJOR >= 3
++#include <openssl/provider.h>
++#endif
+ 
+ #include "transmission.h"
+ #include "crypto-utils.h"
+@@ -184,6 +187,10 @@ static void openssl_evp_cipher_context_free(EVP_CIPHER_CTX* handle)
+ 
+ tr_rc4_ctx_t tr_rc4_new(void)
+ {
++#if OPENSSL_VERSION_MAJOR >= 3
++    OSSL_PROVIDER_load(NULL, "default");
++    OSSL_PROVIDER_load(NULL, "legacy");
++#endif
+     EVP_CIPHER_CTX* handle = EVP_CIPHER_CTX_new();
+ 
+     if (check_result(EVP_CipherInit_ex(handle, EVP_rc4(), NULL, NULL, NULL, -1)))
+-- 
+2.35.1
+
diff --git a/pkgs/by-name/tr/trealla/package.nix b/pkgs/by-name/tr/trealla/package.nix
index 7183280a01b07..fe33c5ba6923e 100644
--- a/pkgs/by-name/tr/trealla/package.nix
+++ b/pkgs/by-name/tr/trealla/package.nix
@@ -23,13 +23,13 @@ assert lib.elem lineEditingLibrary [
 ];
 stdenv.mkDerivation (finalAttrs: {
   pname = "trealla";
-  version = "2.52.18";
+  version = "2.53.2";
 
   src = fetchFromGitHub {
     owner = "trealla-prolog";
     repo = "trealla";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-ai1z/Y3KuQUnRhWduuZfnPdz+vc1VS24Wih/CFnuCtk=";
+    hash = "sha256-LquQDKgh1yZ0kUuLIDHM3b8Xe8mdh/ZjILGvnOMm+Os=";
   };
 
   postPatch = ''
diff --git a/pkgs/by-name/tr/treefmt/package.nix b/pkgs/by-name/tr/treefmt1/package.nix
index 48fc4b44962e8..48fc4b44962e8 100644
--- a/pkgs/by-name/tr/treefmt/package.nix
+++ b/pkgs/by-name/tr/treefmt1/package.nix
diff --git a/pkgs/by-name/tr/treefmt2/package.nix b/pkgs/by-name/tr/treefmt2/package.nix
index ab61349bcf7f2..81ca1b6b6f626 100644
--- a/pkgs/by-name/tr/treefmt2/package.nix
+++ b/pkgs/by-name/tr/treefmt2/package.nix
@@ -1,7 +1,7 @@
 { lib, buildGoModule, fetchFromGitHub }:
 buildGoModule rec {
   pname = "treefmt";
-  version = "2.0.0-rc5";
+  version = "2.0.1";
 
   src = fetchFromGitHub {
     owner = "numtide";