From 2286655abd99b87d9a3c23d946f2b7c8f6572504 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 6 Aug 2018 23:32:13 +0200 Subject: [PATCH 1/3] gtk3: add x11Support for darwin --- pkgs/development/libraries/gtk+/2.x.nix | 2 +- pkgs/development/libraries/gtk+/3.x.nix | 13 +++++++------ pkgs/top-level/all-packages.nix | 7 ++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/gtk+/2.x.nix b/pkgs/development/libraries/gtk+/2.x.nix index a384e46fb147..4bf42e1b5b65 100644 --- a/pkgs/development/libraries/gtk+/2.x.nix +++ b/pkgs/development/libraries/gtk+/2.x.nix @@ -2,7 +2,7 @@ , gdk_pixbuf, xlibsWrapper, gobjectIntrospection , xineramaSupport ? stdenv.isLinux , cupsSupport ? true, cups ? null -, gdktarget ? "x11" +, gdktarget ? if stdenv.isDarwin then "quartz" else "x11" , AppKit, Cocoa , fetchpatch }: diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix index 21f9adfdc8e3..22e48c8ba7a6 100644 --- a/pkgs/development/libraries/gtk+/3.x.nix +++ b/pkgs/development/libraries/gtk+/3.x.nix @@ -1,10 +1,11 @@ { stdenv, fetchurl, fetchpatch, pkgconfig, gettext, perl, makeWrapper, shared-mime-info , expat, glib, cairo, pango, gdk_pixbuf, atk, at-spi2-atk, gobjectIntrospection -, xorg, epoxy, json-glib, libxkbcommon, gmp +, xorg, epoxy, json-glib, libxkbcommon, gmp, gnome3 +, x11Support ? stdenv.isLinux , waylandSupport ? stdenv.isLinux, mesa_noglu, wayland, wayland-protocols , xineramaSupport ? stdenv.isLinux , cupsSupport ? stdenv.isLinux, cups ? null -, darwin, gnome3 +, AppKit, Cocoa }: assert cupsSupport -> cups != null; @@ -36,12 +37,12 @@ stdenv.mkDerivation rec { }) ]; - buildInputs = [ libxkbcommon epoxy json-glib ]; + buildInputs = [ libxkbcommon epoxy json-glib ] + ++ optionals stdenv.isDarwin [ AppKit Cocoa ]; propagatedBuildInputs = with xorg; with stdenv.lib; [ expat glib cairo pango gdk_pixbuf atk at-spi2-atk gnome3.gsettings-desktop-schemas libXrandr libXrender libXcomposite libXi libXcursor libSM libICE ] ++ optionals waylandSupport [ mesa_noglu wayland wayland-protocols ] - ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Cocoa ]) ++ optional xineramaSupport libXinerama ++ optional cupsSupport cups; #TODO: colord? @@ -55,9 +56,9 @@ stdenv.mkDerivation rec { "--disable-debug" "--disable-dependency-tracking" "--disable-glibtest" - "--with-gdktarget=quartz" + ] ++ optional (stdenv.isDarwin && !x11Support) "--enable-quartz-backend" - ] ++ optional stdenv.isLinux [ + ++ optional x11Support [ "--enable-x11-backend" ] ++ optional waylandSupport [ "--enable-wayland-backend" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8ab22e40b0b3..81841abdddf8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9671,7 +9671,6 @@ with pkgs; gtk2 = callPackage ../development/libraries/gtk+/2.x.nix { cupsSupport = config.gtk2.cups or stdenv.isLinux; - gdktarget = if stdenv.isDarwin then "quartz" else "x11"; inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; }; @@ -9679,7 +9678,9 @@ with pkgs; gdktarget = "x11"; }; - gtk3 = callPackage ../development/libraries/gtk+/3.x.nix { }; + gtk3 = callPackage ../development/libraries/gtk+/3.x.nix { + inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; + }; gtkmm2 = callPackage ../development/libraries/gtkmm/2.x.nix { }; gtkmm3 = callPackage ../development/libraries/gtkmm/3.x.nix { }; @@ -17320,7 +17321,7 @@ with pkgs; minitube = libsForQt5.callPackage ../applications/video/minitube { }; - mimic = callPackage ../applications/audio/mimic { + mimic = callPackage ../applications/audio/mimic { pulseaudioSupport = config.pulseaudio or false; }; From a71a9eab8ca71ed00ecb2a48f316723d1b9257b2 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 7 Aug 2018 01:31:17 +0200 Subject: [PATCH 2/3] at-spi2-atk: fix darwin dylib install_name --- pkgs/development/libraries/at-spi2-atk/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/at-spi2-atk/default.nix b/pkgs/development/libraries/at-spi2-atk/default.nix index a9652f4da3ee..f1db64cc9ea5 100644 --- a/pkgs/development/libraries/at-spi2-atk/default.nix +++ b/pkgs/development/libraries/at-spi2-atk/default.nix @@ -10,6 +10,7 @@ , dbus , glib , libxml2 +, fixDarwinDylibNames , gnome3 # To pass updateScript }: @@ -24,7 +25,9 @@ stdenv.mkDerivation rec { sha256 = "0vkan52ab9vrkknnv8y4f1cspk8x7xd10qx92xk9ys71p851z2b1"; }; - nativeBuildInputs = [ meson ninja pkgconfig ]; + nativeBuildInputs = [ meson ninja pkgconfig ] + # Fixup rpaths because of meson, remove with meson-0.47 + ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; buildInputs = [ at-spi2-core atk dbus glib libxml2 ]; doCheck = false; # fails with "No test data file provided" From abe2ab1581f79561f099a2a48d46fe5dd507cfef Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 7 Aug 2018 01:56:24 +0200 Subject: [PATCH 3/3] at-spi2-core: fix darwin dylib install_name --- pkgs/development/libraries/at-spi2-core/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/at-spi2-core/default.nix b/pkgs/development/libraries/at-spi2-core/default.nix index 9bbde08023ba..d9251c2bdc5d 100644 --- a/pkgs/development/libraries/at-spi2-core/default.nix +++ b/pkgs/development/libraries/at-spi2-core/default.nix @@ -11,6 +11,7 @@ , libX11 , libXtst # at-spi2-core can be build without X support, but due it is a client-side library, GUI-less usage is a very rare case , libXi +, fixDarwinDylibNames , gnome3 # To pass updateScript }: @@ -27,7 +28,9 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ meson ninja pkgconfig gobjectIntrospection ]; + nativeBuildInputs = [ meson ninja pkgconfig gobjectIntrospection ] + # Fixup rpaths because of meson, remove with meson-0.47 + ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; buildInputs = [ dbus glib libX11 libXtst libXi ]; doCheck = false; # fails with "AT-SPI: Couldn't connect to accessibility bus. Is at-spi-bus-launcher running?"