-
-
Notifications
You must be signed in to change notification settings - Fork 517
Add glibmm (2.66.8, 2.88.0) to xrepo #9928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
ecf8a7d
8e11496
66afebe
b172066
4e14018
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| package("glibmm") | ||
| set_homepage("https://gtkmm.gnome.org") | ||
| set_description("A C++ API for parts of glib that are useful for C++.") | ||
| set_license("LGPL-2.1-or-later") | ||
| -- The giomm library is also built with glibmm. There isn't an option to separate them, under meson build system. | ||
|
|
||
| add_urls("https://gitlab.gnome.org/GNOME/glibmm.git") | ||
| add_urls("https://download.gnome.org/sources/glibmm/$(version).tar.xz", {version = function (version) | ||
| return format("%d.%d/glibmm-%s", version:major(), version:minor(), version) | ||
| end}) | ||
|
|
||
| add_versions("2.88.0", "a6549da3a6c43de83b8717dae5413c57a60d92f6ecc624615c612d0bb0ad0fe2") | ||
| add_versions("2.66.8", "64f11d3b95a24e2a8d4166ecff518730f79ecc27222ef41faf7c7e0340fc9329") | ||
|
|
||
| add_configs("deprecated_api", {description = "Build deprecated API and include it in the library", default = false, type = "boolean"}) | ||
| add_configs("shared", {description = "Build shared library.", default = false, type = "boolean"}) | ||
|
|
||
| add_deps("meson", "ninja") | ||
|
|
||
| on_load(function (package) | ||
| -- glibmm doesn't allow static build for MSVC-like compilers. | ||
| if package:toolchain("msvc") then | ||
| package:config_set("shared", true) | ||
| end | ||
|
|
||
| if package:version():lt("2.68") then | ||
| package:add("deps", "libsigcplusplus <3.0.0") | ||
| package:add("deps", "glib >=2.61.2") | ||
| package:add("languages", "c++11") | ||
| else | ||
| package:add("deps", "libsigcplusplus >=3.0.0") | ||
| package:add("deps", "glib >=2.87.3") | ||
| package:add("languages", "c++17") | ||
| end | ||
|
|
||
| local abi = package:version() and package:version():lt("2.68") and "2.4" or "2.68" | ||
| package:add("includedirs", | ||
| "include/glibmm-" .. abi, | ||
| "lib/glibmm-" .. abi .. "/include", | ||
| "include/giomm-" .. abi, | ||
| "lib/giomm-" .. abi .. "/include") | ||
| end) | ||
|
|
||
| on_install("!android and !wasm and !iphoneos and !bsd", function (package) | ||
| local configs = {"-Dbuild-documentation=false", "-Dbuild-examples=false"} | ||
| table.insert(configs, "-Dbuild-deprecated-api=" .. (package:config("deprecated_api") and "true" or "false")) | ||
| table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) | ||
| import("package.tools.meson").install(package, configs) | ||
|
Comment on lines
+45
to
+48
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is better to explicitly pass |
||
| end) | ||
|
|
||
| on_test(function (package) | ||
| assert(package:has_cxxincludes("glibmm.h", {configs = {languages = "c++17"}})) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test only checks for the presence of the header. It's better to use |
||
| end) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
on_loadblock is missingadd_links, which is critical for consumers to link against the library. Additionally, it's recommended to specify the required C++ standard (c++11for ABI 2.4 andc++17for ABI 2.68) so that it propagates to consumer projects. I've also refactored the logic to be cleaner and avoid duplicated version checks.