From 6166507ca5eda4dae1c731b054938b816c644911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A4in=C3=B6=20J=C3=A4rvel=C3=A4?= Date: Fri, 23 Feb 2018 20:34:26 +0200 Subject: [PATCH 1/5] gst-plugins-bad: Add Darwin support Had to remove mjpegtools and Cocoa support because of compile problems. --- pkgs/development/libraries/gstreamer/bad/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index c033140d8dc3..69ade8899195 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -35,9 +35,13 @@ stdenv.mkDerivation rec { a real live maintainer, or some actual wide use. ''; license = licenses.lgpl2Plus; - platforms = platforms.linux; + platforms = platforms.linux ++ platforms.darwin; }; + # TODO: Fix Cocoa build. The problem was ARC, which might be related to too + # old version of Apple SDK's. + configureFlags = optional stdenv.isDarwin "--disable-cocoa"; + patchPhase = '' sed -i 's/openjpeg-2.2/openjpeg-${openJpegVersion}/' ext/openjpeg/* ''; @@ -58,7 +62,7 @@ stdenv.mkDerivation rec { openjpeg libopus librsvg fluidsynth libvdpau libwebp xvidcore gnutls mesa - mjpegtools libgme openssl x265 libxml2 + libgme openssl x265 libxml2 ] ++ libintlOrEmpty ++ optional faacSupport faac @@ -67,7 +71,9 @@ stdenv.mkDerivation rec { ++ optional stdenv.isLinux wayland # wildmidi requires apple's OpenAL # TODO: package apple's OpenAL, fix wildmidi, include on Darwin - ++ optional (!stdenv.isDarwin) wildmidi; + ++ optional (!stdenv.isDarwin) wildmidi + # TODO: mjpegtools uint64_t is not compatible with guint64 on Darwin + ++ optional (!stdenv.isDarwin) mjpegtools; LDFLAGS = optionalString stdenv.isDarwin "-lintl"; From e9ef15c32206864555b39b53465562271c9153c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A4in=C3=B6=20J=C3=A4rvel=C3=A4?= Date: Fri, 23 Feb 2018 20:36:19 +0200 Subject: [PATCH 2/5] glib-networking: Fix Darwin support --- pkgs/development/libraries/glib-networking/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix index 87f3c78a82e8..9336e5bbae91 100644 --- a/pkgs/development/libraries/glib-networking/default.nix +++ b/pkgs/development/libraries/glib-networking/default.nix @@ -17,6 +17,8 @@ stdenv.mkDerivation rec { configureFlags = "--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt"; + LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl"; + preBuild = '' sed -e "s@${glib.out}/lib/gio/modules@$out/lib/gio/modules@g" -i $(find . -name Makefile) ''; From 74d6d40bdf3c73a2fba7bef5453a16058c719e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A4in=C3=B6=20J=C3=A4rvel=C3=A4?= Date: Fri, 23 Feb 2018 20:36:52 +0200 Subject: [PATCH 3/5] mopidy: Remove dbus-python on Darwin Darwin doesn't have dbus. --- pkgs/applications/audio/mopidy/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/mopidy/default.nix b/pkgs/applications/audio/mopidy/default.nix index 8541ec6e2727..cfb7b57bc475 100644 --- a/pkgs/applications/audio/mopidy/default.nix +++ b/pkgs/applications/audio/mopidy/default.nix @@ -22,8 +22,8 @@ pythonPackages.buildPythonApplication rec { ]; propagatedBuildInputs = with pythonPackages; [ - gst-python pygobject3 pykka tornado requests dbus-python - ]; + gst-python pygobject3 pykka tornado requests + ] ++ stdenv.lib.optional (!stdenv.isDarwin) dbus-python; # There are no tests doCheck = false; From 381cb8b5ad5a66e06a96eb0c2854293e5756a9ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A4in=C3=B6=20J=C3=A4rvel=C3=A4?= Date: Fri, 23 Feb 2018 21:15:47 +0200 Subject: [PATCH 4/5] gst-plugins-ugly: Add mpg123 to enable mpg123audiodec in gstreamer Adds support for MP3 playback. --- pkgs/development/libraries/gstreamer/ugly/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gstreamer/ugly/default.nix b/pkgs/development/libraries/gstreamer/ugly/default.nix index 3aa8eb886d79..cdaa88ce350f 100644 --- a/pkgs/development/libraries/gstreamer/ugly/default.nix +++ b/pkgs/development/libraries/gstreamer/ugly/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, pkgconfig, python , gst-plugins-base, orc , a52dec, libcdio, libdvdread -, lame, libmad, libmpeg2, x264, libintlOrEmpty +, lame, libmad, libmpeg2, x264, libintlOrEmpty, mpg123 }: stdenv.mkDerivation rec { @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { buildInputs = [ gst-plugins-base orc a52dec libcdio libdvdread - lame libmad libmpeg2 x264 + lame libmad libmpeg2 x264 mpg123 ] ++ libintlOrEmpty; NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null; From 5291c2079b6241f7b18c04e9af6fe6d49ef948bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A4in=C3=B6=20J=C3=A4rvel=C3=A4?= Date: Sat, 24 Feb 2018 07:53:35 +0200 Subject: [PATCH 5/5] glib-networking: Disable ca-certificates on Darwin macOS does not have certificates at /etc/ssl/certs. cacerts package has been deprecated. And there is a long standing issue at https://github.com/NixOS/nixpkgs/issues/8247 for figuring out how to handle certificates. Disabling glib-networking ca-certificates on Darwin removes constant warnings when opening remote connections. --- pkgs/development/libraries/glib-networking/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix index 9336e5bbae91..954e5d1f6b5e 100644 --- a/pkgs/development/libraries/glib-networking/default.nix +++ b/pkgs/development/libraries/glib-networking/default.nix @@ -15,7 +15,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; # to deal with propagatedBuildInputs - configureFlags = "--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt"; + configureFlags = if stdenv.isDarwin then "--without-ca-certificates" + else "--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt"; LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";