From cae067f17a8c592d716a6ad2c1a6be2ff79f7c55 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 5 Jan 2017 17:24:08 -0600 Subject: [PATCH 1/4] transmission: add enableSystemd flag This flag can be used to enable systemd daemon support in transmission. --- .../applications/networking/p2p/transmission/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix index b85970df4b4a..fcf9225c3aab 100644 --- a/pkgs/applications/networking/p2p/transmission/default.nix +++ b/pkgs/applications/networking/p2p/transmission/default.nix @@ -1,6 +1,7 @@ { stdenv, fetchurl, pkgconfig, intltool, file, makeWrapper , openssl, curl, libevent, inotify-tools, systemd, zlib , enableGTK3 ? false, gtk3 +, enableSystemd ? stdenv.isLinux }: let @@ -19,7 +20,7 @@ stdenv.mkDerivation rec { buildInputs = [ pkgconfig intltool file openssl curl libevent inotify-tools zlib ] ++ optionals enableGTK3 [ gtk3 makeWrapper ] - ++ optional stdenv.isLinux systemd; + ++ optionals enableSystemd [ systemd ] postPatch = '' substituteInPlace ./configure \ @@ -27,8 +28,10 @@ stdenv.mkDerivation rec { --replace "/usr/bin/file" "${file}/bin/file" ''; - configureFlags = [ "--with-systemd-daemon" ] - ++ [ "--enable-cli" ] + configureFlags = [ + "--enable-cli" + ] + ++ optional enableSystemd "--with-systemd-daemon" ++ optional enableGTK3 "--with-gtk"; preFixup = optionalString enableGTK3 /* gsettings schemas for file dialogues */ '' From 30eed5541039ed12d764016e52a4316a97d4c9cf Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 5 Jan 2017 17:26:51 -0600 Subject: [PATCH 2/4] transmission: add enableCli flag --- pkgs/applications/networking/p2p/transmission/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix index fcf9225c3aab..102a12c84c16 100644 --- a/pkgs/applications/networking/p2p/transmission/default.nix +++ b/pkgs/applications/networking/p2p/transmission/default.nix @@ -2,6 +2,7 @@ , openssl, curl, libevent, inotify-tools, systemd, zlib , enableGTK3 ? false, gtk3 , enableSystemd ? stdenv.isLinux +, enableCli ? true }: let @@ -29,7 +30,7 @@ stdenv.mkDerivation rec { ''; configureFlags = [ - "--enable-cli" + ("--enable-cli=" + (if enableCli then "yes" else "no")) ] ++ optional enableSystemd "--with-systemd-daemon" ++ optional enableGTK3 "--with-gtk"; From 976aed886b8f9280521a38dfa07419741263acfe Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 5 Jan 2017 17:27:16 -0600 Subject: [PATCH 3/4] transmission: add enableDaemon flag --- pkgs/applications/networking/p2p/transmission/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix index 102a12c84c16..dba0de118e1c 100644 --- a/pkgs/applications/networking/p2p/transmission/default.nix +++ b/pkgs/applications/networking/p2p/transmission/default.nix @@ -2,6 +2,7 @@ , openssl, curl, libevent, inotify-tools, systemd, zlib , enableGTK3 ? false, gtk3 , enableSystemd ? stdenv.isLinux +, enableDaemon ? true , enableCli ? true }: @@ -31,6 +32,7 @@ stdenv.mkDerivation rec { configureFlags = [ ("--enable-cli=" + (if enableCli then "yes" else "no")) + ("--enable-daemon=" + (if enableDaemon then "yes" else "no")) ] ++ optional enableSystemd "--with-systemd-daemon" ++ optional enableGTK3 "--with-gtk"; From 6695954d48ac8ce21b35e396972c857dc0c3f8f0 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 5 Jan 2017 17:28:13 -0600 Subject: [PATCH 4/4] transmission: fix building on Darwin This sets "--disable-mac" so that we use GTK instead of the macOS backend. The macOS backend should work but currently it breaks with xcbuild. --- .../networking/p2p/transmission/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix index dba0de118e1c..12692b9566f9 100644 --- a/pkgs/applications/networking/p2p/transmission/default.nix +++ b/pkgs/applications/networking/p2p/transmission/default.nix @@ -20,19 +20,22 @@ stdenv.mkDerivation rec { sha256 = "0pykmhi7pdmzq47glbj8i2im6iarp4wnj4l1pyvsrnba61f0939s"; }; - buildInputs = [ pkgconfig intltool file openssl curl libevent inotify-tools zlib ] + buildInputs = [ pkgconfig intltool file openssl curl libevent zlib ] ++ optionals enableGTK3 [ gtk3 makeWrapper ] ++ optionals enableSystemd [ systemd ] + ++ optionals stdenv.isLinux [ inotify-tools ]; postPatch = '' substituteInPlace ./configure \ --replace "libsystemd-daemon" "libsystemd" \ - --replace "/usr/bin/file" "${file}/bin/file" + --replace "/usr/bin/file" "${file}/bin/file" \ + --replace "test ! -d /Developer/SDKs/MacOSX10.5.sdk" "false" ''; configureFlags = [ ("--enable-cli=" + (if enableCli then "yes" else "no")) ("--enable-daemon=" + (if enableDaemon then "yes" else "no")) + "--disable-mac" # requires xcodebuild ] ++ optional enableSystemd "--with-systemd-daemon" ++ optional enableGTK3 "--with-gtk"; @@ -43,6 +46,8 @@ stdenv.mkDerivation rec { --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" ''; + NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation"; + meta = with stdenv.lib; { description = "A fast, easy and free BitTorrent client"; longDescription = '' @@ -59,7 +64,7 @@ stdenv.mkDerivation rec { homepage = http://www.transmissionbt.com/; license = licenses.gpl2; # parts are under MIT maintainers = with maintainers; [ astsmtl vcunat wizeman ]; - platforms = platforms.linux; + platforms = platforms.unix; }; }