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.
This commit is contained in:
Matthew Bauer 2017-01-05 17:28:13 -06:00
parent 976aed886b
commit 6695954d48
No known key found for this signature in database
GPG Key ID: E04D0AD9469141C3

View File

@ -20,19 +20,22 @@ 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 ]
++ optionals enableSystemd [ 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 = [ configureFlags = [
("--enable-cli=" + (if enableCli then "yes" else "no")) ("--enable-cli=" + (if enableCli then "yes" else "no"))
("--enable-daemon=" + (if enableDaemon then "yes" else "no")) ("--enable-daemon=" + (if enableDaemon then "yes" else "no"))
"--disable-mac" # requires xcodebuild
] ]
++ optional enableSystemd "--with-systemd-daemon" ++ optional enableSystemd "--with-systemd-daemon"
++ optional enableGTK3 "--with-gtk"; ++ optional enableGTK3 "--with-gtk";
@ -43,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 = ''
@ -59,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;
}; };
} }