Merge pull request #21720 from matthewbauer/transmission

Transmission: Darwin support
This commit is contained in:
Daiderd Jordan 2017-01-11 01:21:24 +01:00 committed by GitHub
commit e590659295

View File

@ -1,6 +1,9 @@
{ stdenv, fetchurl, pkgconfig, intltool, file, makeWrapper { stdenv, fetchurl, pkgconfig, intltool, file, makeWrapper
, openssl, curl, libevent, inotify-tools, systemd, zlib , openssl, curl, libevent, inotify-tools, systemd, zlib
, enableGTK3 ? false, gtk3 , enableGTK3 ? false, gtk3
, enableSystemd ? stdenv.isLinux
, enableDaemon ? true
, enableCli ? true
}: }:
let let
@ -17,18 +20,24 @@ stdenv.mkDerivation rec {
sha256 = "0pykmhi7pdmzq47glbj8i2im6iarp4wnj4l1pyvsrnba61f0939s"; 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 enableGTK3 [ gtk3 makeWrapper ]
++ optional stdenv.isLinux systemd; ++ optionals enableSystemd [ systemd ]
++ optionals stdenv.isLinux [ inotify-tools ];
postPatch = '' postPatch = ''
substituteInPlace ./configure \ substituteInPlace ./configure \
--replace "libsystemd-daemon" "libsystemd" \ --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 = [ "--with-systemd-daemon" ] configureFlags = [
++ [ "--enable-cli" ] ("--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"; ++ optional enableGTK3 "--with-gtk";
preFixup = optionalString enableGTK3 /* gsettings schemas for file dialogues */ '' preFixup = optionalString enableGTK3 /* gsettings schemas for file dialogues */ ''
@ -37,6 +46,8 @@ stdenv.mkDerivation rec {
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
''; '';
NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation";
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A fast, easy and free BitTorrent client"; description = "A fast, easy and free BitTorrent client";
longDescription = '' longDescription = ''
@ -53,7 +64,7 @@ stdenv.mkDerivation rec {
homepage = http://www.transmissionbt.com/; homepage = http://www.transmissionbt.com/;
license = licenses.gpl2; # parts are under MIT license = licenses.gpl2; # parts are under MIT
maintainers = with maintainers; [ astsmtl vcunat wizeman ]; maintainers = with maintainers; [ astsmtl vcunat wizeman ];
platforms = platforms.linux; platforms = platforms.unix;
}; };
} }