From 02cc6797343958c957e476ace2edaf2c6566008a Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 24 Jan 2017 22:41:59 +0100 Subject: [PATCH 1/7] libcddb: fix darwin build --- pkgs/development/libraries/libcddb/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libcddb/default.nix b/pkgs/development/libraries/libcddb/default.nix index 8645fa37c335..6a164ef90553 100644 --- a/pkgs/development/libraries/libcddb/default.nix +++ b/pkgs/development/libraries/libcddb/default.nix @@ -1,17 +1,19 @@ -{fetchurl, stdenv}: +{ stdenv, fetchurl, libiconv }: stdenv.mkDerivation rec { name = "libcddb-1.3.2"; - + src = fetchurl { url = "mirror://sourceforge/libcddb/${name}.tar.bz2"; sha256 = "0fr21a7vprdyy1bq6s99m0x420c9jm5fipsd63pqv8qyfkhhxkim"; }; - meta = { + buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv; + + meta = with stdenv.lib; { description = "C library to access data on a CDDB server (freedb.org)"; - license = stdenv.lib.licenses.lgpl2Plus; homepage = http://libcddb.sourceforge.net/; - platforms = stdenv.lib.platforms.linux; + license = licenses.lgpl2Plus; + platforms = platforms.linux ++ platforms.darwin; }; } From e20fc5059d518d9b951d700f6ad7d37585cf1f83 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 24 Jan 2017 22:45:08 +0100 Subject: [PATCH 2/7] libcdio: fix darwin build --- pkgs/development/libraries/libcdio/0.82.nix | 13 +++++++------ pkgs/development/libraries/libcdio/default.nix | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/libcdio/0.82.nix b/pkgs/development/libraries/libcdio/0.82.nix index 9cfc5f307edf..632ee9161351 100644 --- a/pkgs/development/libraries/libcdio/0.82.nix +++ b/pkgs/development/libraries/libcdio/0.82.nix @@ -1,19 +1,20 @@ -{ fetchurl, stdenv, libcddb, pkgconfig, ncurses, help2man }: +{ stdenv, fetchurl, libcddb, pkgconfig, ncurses, help2man, libiconv }: stdenv.mkDerivation rec { name = "libcdio-0.82"; - + src = fetchurl { url = "mirror://gnu/libcdio/${name}.tar.gz"; sha256 = "0fax1dzy84dzs20bmpq2gfw6hc1x2x9mhk53wynhcycjw3l3vjqs"; }; - buildInputs = [ libcddb pkgconfig ncurses help2man ]; + buildInputs = [ libcddb pkgconfig ncurses help2man ] + ++ stdenv.lib.optional stdenv.isDarwin libiconv; # Disabled because one test (check_paranoia.sh) fails. #doCheck = true; - meta = { + meta = with stdenv.lib; { description = "A library for OS-independent CD-ROM and CD image access"; longDescription = '' GNU libcdio is a library for OS-independent CD-ROM and @@ -21,8 +22,8 @@ stdenv.mkDerivation rec { ISO-9660 filesystems (libiso9660), as well as utility programs such as an audio CD player and an extractor. ''; - license = stdenv.lib.licenses.gpl2Plus; + license = licenses.gpl2Plus; homepage = http://www.gnu.org/software/libcdio/; - platforms = stdenv.lib.platforms.linux; + platforms = platforms.linux ++ platforms.darwin; }; } diff --git a/pkgs/development/libraries/libcdio/default.nix b/pkgs/development/libraries/libcdio/default.nix index f0cff815c443..74c95704bbf0 100644 --- a/pkgs/development/libraries/libcdio/default.nix +++ b/pkgs/development/libraries/libcdio/default.nix @@ -1,19 +1,20 @@ -{ fetchurl, stdenv, libcddb, pkgconfig, ncurses, help2man }: +{ stdenv, fetchurl, libcddb, pkgconfig, ncurses, help2man, libiconv }: stdenv.mkDerivation rec { name = "libcdio-0.93"; - + src = fetchurl { url = "mirror://gnu/libcdio/${name}.tar.bz2"; sha256 = "1a6x2c5bvpnkn7lhmxkjgz4axmh93m1clrlv41s1wzkc48lnc9zq"; }; - buildInputs = [ libcddb pkgconfig ncurses help2man ]; + buildInputs = [ libcddb pkgconfig ncurses help2man ] + ++ stdenv.lib.optional stdenv.isDarwin libiconv; # Disabled because one test (check_paranoia.sh) fails. #doCheck = true; - meta = { + meta = with stdenv.lib; { description = "A library for OS-independent CD-ROM and CD image access"; longDescription = '' GNU libcdio is a library for OS-independent CD-ROM and @@ -21,8 +22,8 @@ stdenv.mkDerivation rec { ISO-9660 filesystems (libiso9660), as well as utility programs such as an audio CD player and an extractor. ''; - license = stdenv.lib.licenses.gpl2Plus; homepage = http://www.gnu.org/software/libcdio/; - platforms = stdenv.lib.platforms.linux; + license = licenses.gpl2Plus; + platforms = platforms.linux ++ platforms.darwin; }; } From fb954784dd617cf73a7db2d77f25ac354b920061 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 24 Jan 2017 22:46:17 +0100 Subject: [PATCH 3/7] libcue: enable darwin build --- pkgs/development/libraries/libcue/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/libcue/default.nix b/pkgs/development/libraries/libcue/default.nix index a1639397b5ea..22bda89c6030 100644 --- a/pkgs/development/libraries/libcue/default.nix +++ b/pkgs/development/libraries/libcue/default.nix @@ -1,4 +1,5 @@ { stdenv, fetchFromGitHub, cmake, bison, flex }: + stdenv.mkDerivation rec { name = "libcue-${version}"; version = "2.1.0"; @@ -12,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake bison flex ]; - meta = { + meta = with stdenv.lib; { description = "CUE Sheet Parser Library"; longDescription = '' libcue is intended to parse a so called cue sheet from a char string or @@ -20,8 +21,8 @@ stdenv.mkDerivation rec { available. ''; homepage = http://sourceforge.net/projects/libcue/; - license = stdenv.lib.licenses.gpl2; - maintainers = with stdenv.lib.maintainers; [ astsmtl ]; - platforms = with stdenv.lib.platforms; linux; + license = licenses.gpl2; + maintainers = with maintainers; [ astsmtl ]; + platforms = platforms.linux ++ platforms.darwin; }; } From 1e324cdd5791acf5bff5cabfa93ac37884049531 Mon Sep 17 00:00:00 2001 From: Michael Phillips Date: Fri, 25 Mar 2016 10:40:01 -0500 Subject: [PATCH 4/7] cmus: add gcc build dep for darwin (cherry picked from commit 597a3898fca1a2dd5875bc6bcf37b6e4e4d37279) --- pkgs/applications/audio/cmus/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/cmus/default.nix b/pkgs/applications/audio/cmus/default.nix index 8e4a08bcaccb..b71ffce61e27 100644 --- a/pkgs/applications/audio/cmus/default.nix +++ b/pkgs/applications/audio/cmus/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, ncurses, pkgconfig +{ stdenv, fetchFromGitHub, ncurses, pkgconfig, gcc , alsaSupport ? stdenv.isLinux, alsaLib ? null # simple fallback for everyone else @@ -109,7 +109,7 @@ stdenv.mkDerivation rec { "CONFIG_WAV=y" ] ++ concatMap (a: a.flags) opts); - buildInputs = [ ncurses pkgconfig ] ++ concatMap (a: a.deps) opts; + buildInputs = [ ncurses pkgconfig gcc ] ++ concatMap (a: a.deps) opts; meta = { description = "Small, fast and powerful console music player for Linux and *BSD"; From 5afd6a9bea3fe54c642c42f3a20f7b02bf6f0a77 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 24 Jan 2017 22:39:01 +0100 Subject: [PATCH 5/7] cmus: fix on darwin (using gcc) --- pkgs/applications/audio/cmus/default.nix | 18 +++++++++++------- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/audio/cmus/default.nix b/pkgs/applications/audio/cmus/default.nix index b71ffce61e27..c0fb900e3ee7 100644 --- a/pkgs/applications/audio/cmus/default.nix +++ b/pkgs/applications/audio/cmus/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitHub, ncurses, pkgconfig, gcc +{ stdenv, fetchFromGitHub, ncurses, pkgconfig +, gcc, libiconv, CoreAudio , alsaSupport ? stdenv.isLinux, alsaLib ? null # simple fallback for everyone else @@ -18,7 +19,7 @@ , cddbSupport ? true, libcddb ? null , cdioSupport ? true, libcdio ? null , cueSupport ? true, libcue ? null -, discidSupport ? true, libdiscid ? null +, discidSupport ? (!stdenv.isDarwin), libdiscid ? null , ffmpegSupport ? true, ffmpeg ? null , flacSupport ? true, flac ? null , madSupport ? true, libmad ? null @@ -109,13 +110,16 @@ stdenv.mkDerivation rec { "CONFIG_WAV=y" ] ++ concatMap (a: a.flags) opts); - buildInputs = [ ncurses pkgconfig gcc ] ++ concatMap (a: a.deps) opts; + buildInputs = [ ncurses pkgconfig ] + ++ stdenv.lib.optional stdenv.cc.isClang gcc + ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv CoreAudio ] + ++ concatMap (a: a.deps) opts; - meta = { + meta = with stdenv.lib; { description = "Small, fast and powerful console music player for Linux and *BSD"; homepage = https://cmus.github.io/; - license = stdenv.lib.licenses.gpl2; - maintainers = [ stdenv.lib.maintainers.oxij ]; - platforms = stdenv.lib.platforms.linux; + license = licenses.gpl2; + maintainers = [ maintainers.oxij ]; + platforms = platforms.linux ++ platforms.darwin; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1d924df6aea3..7fb6e4fef6ef 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12690,6 +12690,7 @@ with pkgs; cmatrix = callPackage ../applications/misc/cmatrix { }; cmus = callPackage ../applications/audio/cmus { + inherit (darwin.apple_sdk.frameworks) CoreAudio; libjack = libjack2; libcdio = libcdio082; ffmpeg = ffmpeg_2; From ad6ac35ae45ac0dadccbf3ad826e58e2a7189d2a Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Wed, 25 Jan 2017 21:33:55 +0100 Subject: [PATCH 6/7] python-pycdio: fix darwin build --- pkgs/top-level/python-packages.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 061dcd68f9b6..d285a7febcaa 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19883,9 +19883,8 @@ in { patchShebangs . ''; - buildInputs = [ - self.setuptools self.nose pkgs.pkgconfig pkgs.swig pkgs.libcdio - ]; + buildInputs = [ self.setuptools self.nose pkgs.pkgconfig pkgs.swig pkgs.libcdio ] + ++ stdenv.lib.optional stdenv.isDarwin pkgs.libiconv; patches = [ ../development/python-modules/pycdio/add-cdtext-toc.patch ]; From 50e9921179066d00de84c421332cfd3de2f52d28 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Wed, 25 Jan 2017 21:48:43 +0100 Subject: [PATCH 7/7] cmus: use clang's gcc compatibility for a clang based stdenv --- pkgs/applications/audio/cmus/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/audio/cmus/default.nix b/pkgs/applications/audio/cmus/default.nix index c0fb900e3ee7..bb2deb71ba20 100644 --- a/pkgs/applications/audio/cmus/default.nix +++ b/pkgs/applications/audio/cmus/default.nix @@ -1,5 +1,5 @@ -{ stdenv, fetchFromGitHub, ncurses, pkgconfig -, gcc, libiconv, CoreAudio +{ stdenv, fetchFromGitHub, runCommand, ncurses, pkgconfig +, libiconv, CoreAudio , alsaSupport ? stdenv.isLinux, alsaLib ? null # simple fallback for everyone else @@ -90,6 +90,13 @@ let #(mkFlag vtxSupport "CONFIG_VTX=y" libayemu) ]; + clangGCC = runCommand "clang-gcc" {} '' + #! ${stdenv.shell} + mkdir -p $out/bin + ln -s ${stdenv.cc}/bin/clang $out/bin/gcc + ln -s ${stdenv.cc}/bin/clang++ $out/bin/g++ + ''; + in stdenv.mkDerivation rec { @@ -111,7 +118,7 @@ stdenv.mkDerivation rec { ] ++ concatMap (a: a.flags) opts); buildInputs = [ ncurses pkgconfig ] - ++ stdenv.lib.optional stdenv.cc.isClang gcc + ++ stdenv.lib.optional stdenv.cc.isClang clangGCC ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv CoreAudio ] ++ concatMap (a: a.deps) opts;