mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 20:39:04 +02:00
Merge pull request #205046 from SuperSandro2000/lib-meson
This commit is contained in:
commit
6c056bed3a
|
@ -16,12 +16,6 @@
|
||||||
, libjpeg
|
, libjpeg
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
# Courtesy of sternenseemann and FRidh, commit c9a7fdfcfb420be8e0179214d0d91a34f5974c54
|
|
||||||
mesonFeatureFlag = feature: flag:
|
|
||||||
"-D${feature}=${if flag then "enabled" else "disabled"}";
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "wbg";
|
pname = "wbg";
|
||||||
version = "1.0.2";
|
version = "1.0.2";
|
||||||
|
@ -52,8 +46,8 @@ stdenv.mkDerivation rec {
|
||||||
mesonBuildType = "release";
|
mesonBuildType = "release";
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
(mesonFeatureFlag "png" enablePNG)
|
(lib.mesonEnable "png" enablePNG)
|
||||||
(mesonFeatureFlag "jpeg" enableJPEG)
|
(lib.mesonEnable "jpeg" enableJPEG)
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
|
|
@ -99,21 +99,19 @@ in stdenv.mkDerivation rec {
|
||||||
|
|
||||||
NIX_LDFLAGS = lib.optionalString x11Support "-lX11 -lXext ";
|
NIX_LDFLAGS = lib.optionalString x11Support "-lX11 -lXext ";
|
||||||
|
|
||||||
mesonFlags = let
|
mesonFlags = [
|
||||||
inherit (lib) mesonOption mesonBool mesonEnable;
|
(lib.mesonOption "default_library" "shared")
|
||||||
in [
|
(lib.mesonBool "libmpv" true)
|
||||||
(mesonOption "default_library" "shared")
|
(lib.mesonEnable "libarchive" archiveSupport)
|
||||||
(mesonBool "libmpv" true)
|
(lib.mesonEnable "manpage-build" true)
|
||||||
(mesonEnable "libarchive" archiveSupport)
|
(lib.mesonEnable "cdda" cddaSupport)
|
||||||
(mesonEnable "manpage-build" true)
|
(lib.mesonEnable "dvbin" dvbinSupport)
|
||||||
(mesonEnable "cdda" cddaSupport)
|
(lib.mesonEnable "dvdnav" dvdnavSupport)
|
||||||
(mesonEnable "dvbin" dvbinSupport)
|
(lib.mesonEnable "openal" openalSupport)
|
||||||
(mesonEnable "dvdnav" dvdnavSupport)
|
(lib.mesonEnable "sdl2" sdl2Support)
|
||||||
(mesonEnable "openal" openalSupport)
|
|
||||||
(mesonEnable "sdl2" sdl2Support)
|
|
||||||
# Disable whilst Swift isn't supported
|
# Disable whilst Swift isn't supported
|
||||||
(mesonEnable "swift-build" swiftSupport)
|
(lib.mesonEnable "swift-build" swiftSupport)
|
||||||
(mesonEnable "macos-cocoa-cb" swiftSupport)
|
(lib.mesonEnable "macos-cocoa-cb" swiftSupport)
|
||||||
];
|
];
|
||||||
|
|
||||||
mesonAutoFeatures = "auto";
|
mesonAutoFeatures = "auto";
|
||||||
|
|
|
@ -13,10 +13,6 @@ let
|
||||||
"grapheme"
|
"grapheme"
|
||||||
"run"
|
"run"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Courtesy of sternenseemann and FRidh, commit c9a7fdfcfb420be8e0179214d0d91a34f5974c54
|
|
||||||
mesonFeatureFlag = feature: flag:
|
|
||||||
"-D${feature}=${if flag then "enabled" else "disabled"}";
|
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
|
@ -40,7 +36,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
mesonBuildType = "release";
|
mesonBuildType = "release";
|
||||||
mesonFlags = builtins.map (t:
|
mesonFlags = builtins.map (t:
|
||||||
mesonFeatureFlag "${t}-shaping" (lib.elem t withShapingTypes)
|
lib.mesonEnable "${t}-shaping" (lib.elem t withShapingTypes)
|
||||||
) availableShapingTypes;
|
) availableShapingTypes;
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
|
@ -30,16 +30,9 @@
|
||||||
, qt5
|
, qt5
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "harfbuzz${lib.optionalString withIcu "-icu"}";
|
||||||
version = "5.3.1";
|
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 {
|
src = fetchurl {
|
||||||
url = "https://github.com/harfbuzz/harfbuzz/releases/download/${version}/harfbuzz-${version}.tar.xz";
|
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.
|
# and is not part of the library.
|
||||||
# Cairo causes transitive (build) dependencies on various X11 or other
|
# Cairo causes transitive (build) dependencies on various X11 or other
|
||||||
# GUI-related libraries, so it shouldn't be re-added lightly.
|
# 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
|
# chafa is only used in a development utility, not in the library
|
||||||
(mesonFeatureFlag "chafa" false)
|
(lib.mesonEnable "chafa" false)
|
||||||
(mesonFeatureFlag "coretext" withCoreText)
|
(lib.mesonEnable "coretext" withCoreText)
|
||||||
(mesonFeatureFlag "graphite" withGraphite2)
|
(lib.mesonEnable "graphite" withGraphite2)
|
||||||
(mesonFeatureFlag "icu" withIcu)
|
(lib.mesonEnable "icu" withIcu)
|
||||||
];
|
];
|
||||||
|
|
||||||
depsBuildBuild = [
|
depsBuildBuild = [
|
||||||
|
@ -99,17 +92,17 @@ stdenv.mkDerivation {
|
||||||
buildInputs = [ glib freetype gobject-introspection ]
|
buildInputs = [ glib freetype gobject-introspection ]
|
||||||
++ lib.optionals withCoreText [ ApplicationServices CoreText ];
|
++ lib.optionals withCoreText [ ApplicationServices CoreText ];
|
||||||
|
|
||||||
propagatedBuildInputs = optional withGraphite2 graphite2
|
propagatedBuildInputs = lib.optional withGraphite2 graphite2
|
||||||
++ optionals withIcu [ icu harfbuzz ];
|
++ lib.optionals withIcu [ icu harfbuzz ];
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
# Slightly hacky; some pkgs expect them in a single directory.
|
# 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"
|
rm "$out"/lib/libharfbuzz.* "$dev/lib/pkgconfig/harfbuzz.pc"
|
||||||
ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.la
|
ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.la
|
||||||
ln -s {'${harfbuzz.dev}',"$dev"}/lib/pkgconfig/harfbuzz.pc
|
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.dylib
|
||||||
ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.0.dylib
|
ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.0.dylib
|
||||||
''}
|
''}
|
||||||
|
|
Loading…
Reference in a new issue