about summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2022-12-27 04:20:25 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2022-12-27 04:21:16 +0100
commit5e3e81f6048239c821e7663a2371d4cd018b1ef1 (patch)
treed51b74fb85e25edeb3313547ede159eb30cbb3d3 /pkgs/development/libraries
parent7b705d1546ec6c6a623c4586551e58788dbea479 (diff)
harfbuzz: use lib.mesonEnable, cleanup up let in
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/harfbuzz/default.nix29
1 files changed, 11 insertions, 18 deletions
diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix
index 797b3243ab9a0..977d39ba35687 100644
--- a/pkgs/development/libraries/harfbuzz/default.nix
+++ b/pkgs/development/libraries/harfbuzz/default.nix
@@ -30,16 +30,9 @@
 , qt5
 }:
 
-let
+stdenv.mkDerivation rec {
+  pname = "harfbuzz${lib.optionalString withIcu "-icu"}";
   version = "5.3.1";
-  inherit (lib) optional optionals optionalString;
-  mesonFeatureFlag = feature: flag:
-    "-D${feature}=${if flag then "enabled" else "disabled"}";
-in
-
-stdenv.mkDerivation {
-  pname = "harfbuzz${optionalString withIcu "-icu"}";
-  inherit version;
 
   src = fetchurl {
     url = "https://github.com/harfbuzz/harfbuzz/releases/download/${version}/harfbuzz-${version}.tar.xz";
@@ -72,12 +65,12 @@ stdenv.mkDerivation {
     # and is not part of the library.
     # Cairo causes transitive (build) dependencies on various X11 or other
     # GUI-related libraries, so it shouldn't be re-added lightly.
-    (mesonFeatureFlag "cairo" false)
+    (lib.mesonEnable "cairo" false)
     # chafa is only used in a development utility, not in the library
-    (mesonFeatureFlag "chafa" false)
-    (mesonFeatureFlag "coretext" withCoreText)
-    (mesonFeatureFlag "graphite" withGraphite2)
-    (mesonFeatureFlag "icu" withIcu)
+    (lib.mesonEnable "chafa" false)
+    (lib.mesonEnable "coretext" withCoreText)
+    (lib.mesonEnable "graphite" withGraphite2)
+    (lib.mesonEnable "icu" withIcu)
   ];
 
   depsBuildBuild = [
@@ -99,17 +92,17 @@ stdenv.mkDerivation {
   buildInputs = [ glib freetype gobject-introspection ]
     ++ lib.optionals withCoreText [ ApplicationServices CoreText ];
 
-  propagatedBuildInputs = optional withGraphite2 graphite2
-    ++ optionals withIcu [ icu harfbuzz ];
+  propagatedBuildInputs = lib.optional withGraphite2 graphite2
+    ++ lib.optionals withIcu [ icu harfbuzz ];
 
   doCheck = true;
 
   # Slightly hacky; some pkgs expect them in a single directory.
-  postFixup = optionalString withIcu ''
+  postFixup = lib.optionalString withIcu ''
     rm "$out"/lib/libharfbuzz.* "$dev/lib/pkgconfig/harfbuzz.pc"
     ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.la
     ln -s {'${harfbuzz.dev}',"$dev"}/lib/pkgconfig/harfbuzz.pc
-    ${optionalString stdenv.isDarwin ''
+    ${lib.optionalString stdenv.isDarwin ''
       ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.dylib
       ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.0.dylib
     ''}