From c93660a7a434246da36ed4913f235092f2f25a7c Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Wed, 25 Apr 2018 20:30:22 +0200 Subject: [PATCH 1/3] harfbuzz: add CoreText support --- pkgs/development/libraries/harfbuzz/default.nix | 13 ++++++++++--- pkgs/top-level/all-packages.nix | 6 ++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix index f75d08022c65..ff60afc1f2be 100644 --- a/pkgs/development/libraries/harfbuzz/default.nix +++ b/pkgs/development/libraries/harfbuzz/default.nix @@ -1,5 +1,7 @@ { stdenv, fetchurl, pkgconfig, glib, freetype, cairo, libintl , icu, graphite2, harfbuzz # The icu variant uses and propagates the non-icu one. +, ApplicationServices, CoreText +, withCoreText ? false , withIcu ? false # recommended by upstream as default, but most don't needed and it's big , withGraphite2 ? true # it is small and major distros do include it , python @@ -27,12 +29,17 @@ stdenv.mkDerivation { outputBin = "dev"; configureFlags = [ - ( "--with-graphite2=" + (if withGraphite2 then "yes" else "no") ) # not auto-detected by default - ( "--with-icu=" + (if withIcu then "yes" else "no") ) + # not auto-detected by default + "--with-coretext=${if withCoreText then "yes" else "no"}" + "--with-graphite2=${if withGraphite2 then "yes" else "no"}" + "--with-icu=${if withIcu then "yes" else "no"}" ]; nativeBuildInputs = [ pkgconfig libintl ]; - buildInputs = [ glib freetype cairo ]; # recommended by upstream + + buildInputs = [ glib freetype cairo ] # recommended by upstream + ++ stdenv.lib.optionals withCoreText [ ApplicationServices CoreText ]; + propagatedBuildInputs = [] ++ optional withGraphite2 graphite2 ++ optionals withIcu [ icu harfbuzz ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 302ff26ed40f..a859fd56fa45 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9767,10 +9767,12 @@ with pkgs; }; libheimdal = heimdal.override { type = "lib"; }; - harfbuzz = callPackage ../development/libraries/harfbuzz { }; + harfbuzz = callPackage ../development/libraries/harfbuzz { + inherit (darwin.apple_sdk.frameworks) ApplicationServices CoreText; + }; harfbuzz-icu = harfbuzz.override { - withIcu = true; withGraphite2 = true; + withIcu = true; }; harfbuzz-icu-58 = harfbuzz-icu.override { icu = icu58; From 10267bfc9073174871772a34ebafd4c946a9f09f Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Wed, 25 Apr 2018 21:35:28 +0200 Subject: [PATCH 2/3] harfbuzz: avoid rebuilds --- pkgs/development/libraries/harfbuzz/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix index ff60afc1f2be..383f7f60f9bf 100644 --- a/pkgs/development/libraries/harfbuzz/default.nix +++ b/pkgs/development/libraries/harfbuzz/default.nix @@ -30,10 +30,10 @@ stdenv.mkDerivation { configureFlags = [ # not auto-detected by default - "--with-coretext=${if withCoreText then "yes" else "no"}" "--with-graphite2=${if withGraphite2 then "yes" else "no"}" "--with-icu=${if withIcu then "yes" else "no"}" - ]; + ] + ++ stdenv.lib.optional withCoreText "--with-coretext=yes"; nativeBuildInputs = [ pkgconfig libintl ]; From 80aca28e34f44a2fe7dafb225dd600980a4d80a7 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 27 May 2018 14:25:55 +0200 Subject: [PATCH 3/3] harfbuzz: add harfbuzzFull and remove other variants --- .../networking/browsers/chromium/common.nix | 4 ++-- pkgs/tools/typesetting/tectonic/default.nix | 4 ++-- pkgs/top-level/all-packages.nix | 23 +++++++++++-------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index ff9b8b10b18e..ebc700a7f37c 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -82,8 +82,8 @@ let xdg_utils yasm minizip libwebp libusb1 re2 zlib ffmpeg libxslt libxml2 - # harfbuzz-icu # in versions over 63 harfbuzz and freetype are being built together - # so we can't build with one from system and other from source + # harfbuzz # in versions over 63 harfbuzz and freetype are being built together + # so we can't build with one from system and other from source ]; # build paths and release info diff --git a/pkgs/tools/typesetting/tectonic/default.nix b/pkgs/tools/typesetting/tectonic/default.nix index fa8af0089556..0d082eac4bba 100644 --- a/pkgs/tools/typesetting/tectonic/default.nix +++ b/pkgs/tools/typesetting/tectonic/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchFromGitHub, rustPlatform -, darwin, fontconfig, harfbuzz-icu, openssl, pkgconfig }: +, darwin, fontconfig, harfbuzz, openssl, pkgconfig }: rustPlatform.buildRustPackage rec { name = "tectonic-${version}"; @@ -16,7 +16,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ fontconfig harfbuzz-icu openssl ] + buildInputs = [ fontconfig harfbuzz openssl ] ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ ApplicationServices Cocoa Foundation ]); # tests fail due to read-only nix store diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a859fd56fa45..d274aec077c9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9770,13 +9770,12 @@ with pkgs; harfbuzz = callPackage ../development/libraries/harfbuzz { inherit (darwin.apple_sdk.frameworks) ApplicationServices CoreText; }; - harfbuzz-icu = harfbuzz.override { + + harfbuzzFull = harfbuzz.override { + withCoreText = stdenv.isDarwin; withGraphite2 = true; withIcu = true; }; - harfbuzz-icu-58 = harfbuzz-icu.override { - icu = icu58; - }; hawknl = callPackage ../development/libraries/hawknl { }; @@ -11574,7 +11573,7 @@ with pkgs; inherit stdenv fetchurl makeSetupHook; bison = bison2; # error: too few arguments to function 'int yylex(... inherit cups; - harfbuzz = harfbuzz-icu; + harfbuzz = harfbuzzFull; inherit libGL; inherit perl; inherit (gst_all_1) gstreamer gst-plugins-base; @@ -11588,7 +11587,7 @@ with pkgs; inherit stdenv fetchurl makeSetupHook; bison = bison2; # error: too few arguments to function 'int yylex(... inherit cups; - harfbuzz = harfbuzz-icu; + harfbuzz = harfbuzzFull; inherit libGL; inherit perl; inherit (gst_all_1) gstreamer gst-plugins-base; @@ -11603,7 +11602,7 @@ with pkgs; inherit stdenv fetchurl fetchFromGitHub makeSetupHook; bison = bison2; # error: too few arguments to function 'int yylex(... inherit cups; - harfbuzz = harfbuzz-icu; + harfbuzz = harfbuzzFull; inherit libGL; inherit perl; inherit (gst_all_1) gstreamer gst-plugins-base; @@ -12123,7 +12122,9 @@ with pkgs; tecla = callPackage ../development/libraries/tecla { }; - tectonic = callPackage ../tools/typesetting/tectonic { }; + tectonic = callPackage ../tools/typesetting/tectonic { + harfbuzz = harfbuzzFull; + }; tepl = callPackage ../development/libraries/tepl { }; @@ -12318,13 +12319,15 @@ with pkgs; webkitgtk = webkitgtk220x; webkitgtk24x-gtk3 = callPackage ../development/libraries/webkitgtk/2.4.nix { - harfbuzz = harfbuzz-icu-58; + harfbuzz = harfbuzzFull.override { + icu = icu58; + }; gst-plugins-base = gst_all_1.gst-plugins-base; inherit (darwin) libobjc; }; webkitgtk220x = callPackage ../development/libraries/webkitgtk/2.20.nix { - harfbuzz = harfbuzz-icu; + harfbuzz = harfbuzzFull; inherit (gst_all_1) gst-plugins-base gst-plugins-bad; stdenv = overrideCC stdenv gcc6; };