Merge pull request #205046 from SuperSandro2000/lib-meson

authored by

Sandro and committed by
GitHub
6c056bed 7bc51003

+26 -45
+2 -8
pkgs/applications/misc/wbg/default.nix
··· 16 16 , libjpeg 17 17 }: 18 18 19 - let 20 - # Courtesy of sternenseemann and FRidh, commit c9a7fdfcfb420be8e0179214d0d91a34f5974c54 21 - mesonFeatureFlag = feature: flag: 22 - "-D${feature}=${if flag then "enabled" else "disabled"}"; 23 - in 24 - 25 19 stdenv.mkDerivation rec { 26 20 pname = "wbg"; 27 21 version = "1.0.2"; ··· 52 46 mesonBuildType = "release"; 53 47 54 48 mesonFlags = [ 55 - (mesonFeatureFlag "png" enablePNG) 56 - (mesonFeatureFlag "jpeg" enableJPEG) 49 + (lib.mesonEnable "png" enablePNG) 50 + (lib.mesonEnable "jpeg" enableJPEG) 57 51 ]; 58 52 59 53 meta = with lib; {
+12 -14
pkgs/applications/video/mpv/default.nix
··· 99 99 100 100 NIX_LDFLAGS = lib.optionalString x11Support "-lX11 -lXext "; 101 101 102 - mesonFlags = let 103 - inherit (lib) mesonOption mesonBool mesonEnable; 104 - in [ 105 - (mesonOption "default_library" "shared") 106 - (mesonBool "libmpv" true) 107 - (mesonEnable "libarchive" archiveSupport) 108 - (mesonEnable "manpage-build" true) 109 - (mesonEnable "cdda" cddaSupport) 110 - (mesonEnable "dvbin" dvbinSupport) 111 - (mesonEnable "dvdnav" dvdnavSupport) 112 - (mesonEnable "openal" openalSupport) 113 - (mesonEnable "sdl2" sdl2Support) 102 + mesonFlags = [ 103 + (lib.mesonOption "default_library" "shared") 104 + (lib.mesonBool "libmpv" true) 105 + (lib.mesonEnable "libarchive" archiveSupport) 106 + (lib.mesonEnable "manpage-build" true) 107 + (lib.mesonEnable "cdda" cddaSupport) 108 + (lib.mesonEnable "dvbin" dvbinSupport) 109 + (lib.mesonEnable "dvdnav" dvdnavSupport) 110 + (lib.mesonEnable "openal" openalSupport) 111 + (lib.mesonEnable "sdl2" sdl2Support) 114 112 # Disable whilst Swift isn't supported 115 - (mesonEnable "swift-build" swiftSupport) 116 - (mesonEnable "macos-cocoa-cb" swiftSupport) 113 + (lib.mesonEnable "swift-build" swiftSupport) 114 + (lib.mesonEnable "macos-cocoa-cb" swiftSupport) 117 115 ]; 118 116 119 117 mesonAutoFeatures = "auto";
+1 -5
pkgs/development/libraries/fcft/default.nix
··· 13 13 "grapheme" 14 14 "run" 15 15 ]; 16 - 17 - # Courtesy of sternenseemann and FRidh, commit c9a7fdfcfb420be8e0179214d0d91a34f5974c54 18 - mesonFeatureFlag = feature: flag: 19 - "-D${feature}=${if flag then "enabled" else "disabled"}"; 20 16 in 21 17 22 18 stdenv.mkDerivation rec { ··· 40 36 41 37 mesonBuildType = "release"; 42 38 mesonFlags = builtins.map (t: 43 - mesonFeatureFlag "${t}-shaping" (lib.elem t withShapingTypes) 39 + lib.mesonEnable "${t}-shaping" (lib.elem t withShapingTypes) 44 40 ) availableShapingTypes; 45 41 46 42 doCheck = true;
+11 -18
pkgs/development/libraries/harfbuzz/default.nix
··· 30 30 , qt5 31 31 }: 32 32 33 - let 33 + stdenv.mkDerivation rec { 34 + pname = "harfbuzz${lib.optionalString withIcu "-icu"}"; 34 35 version = "5.3.1"; 35 - inherit (lib) optional optionals optionalString; 36 - mesonFeatureFlag = feature: flag: 37 - "-D${feature}=${if flag then "enabled" else "disabled"}"; 38 - in 39 - 40 - stdenv.mkDerivation { 41 - pname = "harfbuzz${optionalString withIcu "-icu"}"; 42 - inherit version; 43 36 44 37 src = fetchurl { 45 38 url = "https://github.com/harfbuzz/harfbuzz/releases/download/${version}/harfbuzz-${version}.tar.xz"; ··· 72 65 # and is not part of the library. 73 66 # Cairo causes transitive (build) dependencies on various X11 or other 74 67 # GUI-related libraries, so it shouldn't be re-added lightly. 75 - (mesonFeatureFlag "cairo" false) 68 + (lib.mesonEnable "cairo" false) 76 69 # chafa is only used in a development utility, not in the library 77 - (mesonFeatureFlag "chafa" false) 78 - (mesonFeatureFlag "coretext" withCoreText) 79 - (mesonFeatureFlag "graphite" withGraphite2) 80 - (mesonFeatureFlag "icu" withIcu) 70 + (lib.mesonEnable "chafa" false) 71 + (lib.mesonEnable "coretext" withCoreText) 72 + (lib.mesonEnable "graphite" withGraphite2) 73 + (lib.mesonEnable "icu" withIcu) 81 74 ]; 82 75 83 76 depsBuildBuild = [ ··· 99 92 buildInputs = [ glib freetype gobject-introspection ] 100 93 ++ lib.optionals withCoreText [ ApplicationServices CoreText ]; 101 94 102 - propagatedBuildInputs = optional withGraphite2 graphite2 103 - ++ optionals withIcu [ icu harfbuzz ]; 95 + propagatedBuildInputs = lib.optional withGraphite2 graphite2 96 + ++ lib.optionals withIcu [ icu harfbuzz ]; 104 97 105 98 doCheck = true; 106 99 107 100 # Slightly hacky; some pkgs expect them in a single directory. 108 - postFixup = optionalString withIcu '' 101 + postFixup = lib.optionalString withIcu '' 109 102 rm "$out"/lib/libharfbuzz.* "$dev/lib/pkgconfig/harfbuzz.pc" 110 103 ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.la 111 104 ln -s {'${harfbuzz.dev}',"$dev"}/lib/pkgconfig/harfbuzz.pc 112 - ${optionalString stdenv.isDarwin '' 105 + ${lib.optionalString stdenv.isDarwin '' 113 106 ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.dylib 114 107 ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.0.dylib 115 108 ''}