From c214bc9aeec943345e095b88a94eabc6fba9671f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 23 Apr 2018 12:31:36 -0500 Subject: gstreamer: fix on Darwin --- pkgs/development/libraries/gstreamer/core/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix index ab3f78767a1c..5845c8c50db2 100644 --- a/pkgs/development/libraries/gstreamer/core/default.nix +++ b/pkgs/development/libraries/gstreamer/core/default.nix @@ -2,17 +2,18 @@ , pkgconfig, gettext, gobjectIntrospection , bison, flex, python3, glib, makeWrapper , libcap,libunwind, darwin +, lib }: stdenv.mkDerivation rec { name = "gstreamer-1.14.0"; - meta = { + meta = with lib ;{ description = "Open source multimedia framework"; homepage = https://gstreamer.freedesktop.org; - license = stdenv.lib.licenses.lgpl2Plus; - platforms = stdenv.lib.platforms.unix; - maintainers = [ stdenv.lib.maintainers.ttuegel ]; + license = licenses.lgpl2Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ ttuegel matthewbauer ]; }; src = fetchurl { @@ -20,7 +21,7 @@ stdenv.mkDerivation rec { sha256 = "0vj6k01lp2yva6rfd95fkyng9jdr62gkz0x8d2l81dyly1ki6dpw"; }; - patches = [ + patches = [ (fetchpatch { url = "https://bug794856.bugzilla-attachments.gnome.org/attachment.cgi?id=370411"; sha256 = "16plzzmkk906k4892zq68j3c9z8vdma5nxzlviq20jfv04ykhmk2"; @@ -34,7 +35,9 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson ninja pkgconfig gettext bison flex python3 makeWrapper gobjectIntrospection ]; - buildInputs = [ libcap libunwind ] ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.CoreServices; + buildInputs = + lib.optionals stdenv.isLinux [ libcap libunwind ] + ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.CoreServices; propagatedBuildInputs = [ glib ]; -- cgit 1.4.1 From b09c250435dcdcb8fd66fcb0ed701b580ca3d482 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 23 Apr 2018 12:32:37 -0500 Subject: gst_plugins_base: fix on darwin --- .../libraries/gstreamer/base/default.nix | 50 +++++++++++++++------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix index b3a4f445289e..39cf57ec5258 100644 --- a/pkgs/development/libraries/gstreamer/base/default.nix +++ b/pkgs/development/libraries/gstreamer/base/default.nix @@ -1,17 +1,22 @@ -{ stdenv, fetchurl, fetchpatch, pkgconfig, meson -, ninja, gettext, gobjectIntrospection, python -, gstreamer, orc, alsaLib, libXv, pango, libtheora -, wayland, cdparanoia, libvisual, libintl -}: +{ stdenv, fetchurl, fetchpatch, lib +, pkgconfig, meson, ninja, gettext, gobjectIntrospection +, python, gstreamer, orc, pango, libtheora, libvisual +, libintl +, enableX11 ? stdenv.isLinux, libXv +, enableWayland ? stdenv.isLinux, wayland +, enableAlsa ? stdenv.isLinux, alsaLib +, enableCocoa ? false, darwin +, enableCdparanoia ? (!stdenv.isDarwin), cdparanoia }: stdenv.mkDerivation rec { name = "gst-plugins-base-1.14.0"; - meta = { + meta = with lib; { description = "Base plugins and helper libraries"; homepage = https://gstreamer.freedesktop.org; - license = stdenv.lib.licenses.lgpl2Plus; - platforms = stdenv.lib.platforms.unix; + license = licenses.lgpl2Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ matthewbauer ]; }; src = fetchurl { @@ -21,19 +26,32 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - pkgconfig python meson ninja gettext gobjectIntrospection - ]; + nativeBuildInputs = [ pkgconfig python gettext gobjectIntrospection ] + + # Broken meson with Darwin. Should hopefully be fixed soon. Tracking + # in https://bugzilla.gnome.org/show_bug.cgi?id=781148. + ++ lib.optionals (!stdenv.isDarwin) [ meson ninja ]; - buildInputs = [ - orc libXv pango libtheora cdparanoia libintl wayland + # TODO How to pass these to Meson? + configureFlags = [ + "--enable-x11=${if enableX11 then "yes" else "no"}" + "--enable-wayland=${if enableWayland then "yes" else "no"}" + "--enable-cocoa=${if enableCocoa then "yes" else "no"}" ] - ++ stdenv.lib.optional stdenv.isLinux alsaLib - ++ stdenv.lib.optional (!stdenv.isDarwin) libvisual; + + # Introspection fails on my MacBook currently + ++ lib.optional stdenv.isDarwin "--disable-introspection"; + + buildInputs = [ orc libtheora libintl ] + ++ lib.optional enableAlsa alsaLib + ++ lib.optionals enableX11 [ libXv pango ] + ++ lib.optional enableWayland wayland + ++ lib.optional enableCocoa darwin.apple_sdk.frameworks.Cocoa + ++ lib.optional enableCdparanoia cdparanoia; propagatedBuildInputs = [ gstreamer ]; - preConfigure = '' + postPatch = '' patchShebangs . ''; -- cgit 1.4.1