Skip to Content.
Sympa Menu

sm-commit - [[SM-Commit] ] GIT changes to master grimoire by Justin Boffemmyer (5146afd98c49d1201dac3ff47668c056d4831151)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Justin Boffemmyer <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [[SM-Commit] ] GIT changes to master grimoire by Justin Boffemmyer (5146afd98c49d1201dac3ff47668c056d4831151)
  • Date: Sat, 10 Feb 2024 18:29:32 +0000

GIT changes to master grimoire by Justin Boffemmyer <flux AT sourcemage.org>:

ChangeLog | 4 +++
build_system_handler.function | 20 +++++++++++-------
graphics-libs/glfw/BUILD | 5 ++--
graphics-libs/glfw/CONFIGURE | 7 ++++++
graphics-libs/glfw/DEPENDS | 46
+++++++++++++++++++++++++++++++-----------
graphics-libs/glfw/DETAILS | 33 +++++++++++++++---------------
graphics-libs/glfw/HISTORY | 9 ++++++++
7 files changed, 87 insertions(+), 37 deletions(-)

New commits:
commit 5146afd98c49d1201dac3ff47668c056d4831151
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

graphics-libs/glfw: update to 3.3.9

Update to 3.3.9 and improve option/dependency handling. Provide the user
with clearer choices for the optional functionality to enable. Respect
the user's choice for whether to enable testing.

Currently, enabling examples causes the build to fail, so examples are
forcefully disabled.

Convert depends functions to buildsys_depends to future-proof both if
the spell switches to a different build system(s) in the future, as well
as to make adding new cmake options cleaner. Also, this spell can serve
as a reference for how to use buildsys_depends in lieu of the regular
(optional_)depends functions now that the buildsys_depends functions can
cover those cases as well.

commit 9376a1c9aac759df83d099c1d42352d248aca3f1
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

build_system_handler.function: normal depends uses

Improve to handle normal (optional_)depends usages where only a single
build system is used for a spell. This enables the same functions to be
used whether a spell supports only a single build system or multiple.
It also enables more succinct code when the current build system matches
the default build system of the spell (i.e., SPELL_BUILD_SYSTEM).

The main difference between the syntax provided by the functions here
and the normal (optional_)depends function calls is the order of the
arguments. However, by making use of default values, the syntactic order
of the normal functions (see [1] below) can be emulated with only
inserting an additional "-o" before the option name (see [2] below).
When a depends call explicitly provides neither the disabled option
value nor the message, the functions here are equal to the normal
functions except for the addition of the "-o" flag and the change from
the full enabled specification to only giving the name of the enabled
option.

1: SPELL OPTION_ENABLED OPTION_DISABLED MESSAGE
2: SPELL -o OPTION MESSAGE ENABLED_OVERRIDE DISABLED_OVERRIDE

diff --git a/ChangeLog b/ChangeLog
index b85c25a..e3cacaa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-02-10 Justin Boffemmyer <flux AT sourcemage.org>
+ * build_system_handler.function: improve to handle generic
+ (optional_)depends usages as well with single/default build systems
+
2024-02-07 Treeve Jelbert <treeve AT sourcemage.org>
* propertyeditor: deleted, dead spell
* exaro: deleted. dead spell
diff --git a/build_system_handler.function b/build_system_handler.function
index a489394..3d104ea 100644
--- a/build_system_handler.function
+++ b/build_system_handler.function
@@ -79,7 +79,7 @@ buildsys_autotools_default() {
_buildsys_chkerr "invalid parameters" || return 1
local value="$1"
local name="$2"
- printf '--%s-%s\n' "${value%d}" "$name"
+ printf -- '--%s-%s\n' "${value%d}" "$name"
}

#---------------------------------------------------------------------
@@ -100,7 +100,7 @@ buildsys_cmake_default() {
enabled) value=ON ;;
disabled) value=OFF ;;
esac
- printf '-D%s=%s\n' "$name" "$value"
+ printf -- '-D%s=%s\n' "$name" "$value"
}

#---------------------------------------------------------------------
@@ -117,7 +117,7 @@ buildsys_meson_default() {
_buildsys_chkerr "invalid parameters" || return 1
local value="$1"
local name="$2"
- printf '%s=%s\n' "$name" "$value"
+ printf -- '%s=%s\n' "$name" "$value"
}

#---------------------------------------------------------------------
@@ -129,7 +129,7 @@ buildsys_meson_default() {
## @param -a active_build_system (optional, flag to specify the
## currently active build system, overrides the build
## system set in $SPELL_BUILD_SYSTEM)
-## @param -g grimoie (optional, flag to specify the grimoire to use)
+## @param -g grimoire (optional, flag to specify the grimoire to use)
## @param -o global_optname (optional, flag to give the default option
## name to use across all build systems)
## @param spell_name (the name of the actual dependency as a spell)
@@ -201,10 +201,12 @@ _buildsys_transform_depends() {
done &&
spell="$1" &&
shift 1 &&
+ match=true &&
while [ "$#" -gt 0 ] ;do
+ match=false &&
+ buildsys="$targetsys"
case "$1" in
-b) buildsys="$2" && shift 2 ;;
- *) buildsys="$1" && shift 1 ;;
esac &&
match=false &&
case "$(buildsys_mapping "$buildsys")" in
@@ -259,6 +261,10 @@ _buildsys_transform_depends() {
case "$depends_func" in
depends) unset disabled ;;
esac &&
+ if [ -n "$global_optname" ] ;then
+ # provide a last-resort fallback value for enabled settings
+ : "${enabled:=$(buildsys_defaults "$targetsys" enabled
"$global_optname")}"
+ fi
"$depends_func" "$spell" "$enabled" ${disabled:+"$disabled"} "$msg"
"$grimoire"
}

@@ -268,7 +274,7 @@ _buildsys_transform_depends() {
## "depends". See _buildsys_optional_depends for further details of
## the parameters.
##
-## @param -g grimoie (optional, flag to specify the grimoire to use)
+## @param -g grimoire (optional, flag to specify the grimoire to use)
## @param -o global_optname (optional, flag to give the default option
## name to use across all build systems)
## @param spell_name (the name of the actual dependency as a spell)
@@ -294,7 +300,7 @@ buildsys_depends() {
## "optional_depends". See _buildsys_optional_depends for details of
## the parameters.
##
-## @param -g grimoie (optional, flag to specify the grimoire to use)
+## @param -g grimoire (optional, flag to specify the grimoire to use)
## @param -o global_optname (optional, flag to give the default option
## name to use across all build systems)
## @param spell_name (the name of the actual dependency as a spell)
diff --git a/graphics-libs/glfw/BUILD b/graphics-libs/glfw/BUILD
index 25bc7e1..a41b640 100755
--- a/graphics-libs/glfw/BUILD
+++ b/graphics-libs/glfw/BUILD
@@ -1,6 +1,7 @@
+. "$GRIMOIRE/CMAKE_FUNCTIONS" &&
+
OPTS="-DBUILD_SHARED_LIBS=ON \
-DGLFW_BUILD_EXAMPLES=OFF \
- -DGLFW_BUILD_TESTS=OFF \
${OPTS}" &&

-cmake_build
+default_build
diff --git a/graphics-libs/glfw/CONFIGURE b/graphics-libs/glfw/CONFIGURE
new file mode 100755
index 0000000..4d16410
--- /dev/null
+++ b/graphics-libs/glfw/CONFIGURE
@@ -0,0 +1,7 @@
+. "$GRIMOIRE/CMAKE_CONFIGURE"
+
+config_query GLFW_SUPPORT_OPENGL 'Build support for OpenGL?' y &&
+config_query GLFW_SUPPORT_OSMESA 'Build support for Mesa off-screen
rendering?' y &&
+config_query GLFW_SUPPORT_VULKAN 'Build support for Vulkan?' y &&
+config_query GLFW_SUPPORT_WAYLAND 'Build support for Wayland windowing?' y &&
+config_query GLFW_SUPPORT_X11 'Build support for Xwindows windowing?' y
diff --git a/graphics-libs/glfw/DEPENDS b/graphics-libs/glfw/DEPENDS
index ffab8f0..5a56ee1 100755
--- a/graphics-libs/glfw/DEPENDS
+++ b/graphics-libs/glfw/DEPENDS
@@ -1,12 +1,34 @@
-depends cmake &&
-depends libx11 &&
-depends libxinerama &&
-depends libxrandr &&
-depends libxxf86vm &&
-depends libxcursor &&
-depends OPENGL &&
-
-optional_depends doxygen \
- "-DGLFW_BUILD_DOCS=ON" \
- "-DGLFW_BUILD_DOCS=OFF" \
- "to build documentation"
+. "$GRIMOIRE/CMAKE_DEPENDS" &&
+. "$GRIMOIRE/build_system_handler.function" &&
+
+# needed to handle input
+buildsys_depends libxkbcommon &&
+
+if [ x"$GLFW_SUPPORT_X11"x = x'y'x ] ;then
+ buildsys_depends libxcb &&
+ buildsys_depends libxinerama &&
+ buildsys_depends libxrandr &&
+ buildsys_depends libxxf86vm &&
+ buildsys_depends libxcursor
+fi &&
+
+if [ x"$GLFW_SUPPORT_OSMESA"x = x'y'x ] ;then
+ buildsys_depends mesa -o GLFW_USE_OSMESA
+fi &&
+
+if [ x"$GLFW_SUPPORT_WAYLAND"x = x'y'x ] ;then
+ buildsys_depends extra-cmake-modules &&
+ buildsys_depends wayland -o GLFW_USE_WAYLAND
+fi &&
+
+if [ x"$GLFW_SUPPORT_OPENGL "x = x'y'x ] ;then
+ buildsys_depends OPENGL
+fi &&
+
+if [ x"$GLFW_SUPPORT_VULKAN "x = x'y'x ] ;then
+ buildsys_depends vulkan-headers
+fi &&
+
+buildsys_optional_depends doxygen \
+ -o GLFW_BUILD_DOCS \
+ "to build documentation"
diff --git a/graphics-libs/glfw/DETAILS b/graphics-libs/glfw/DETAILS
index 3c703e3..b526cee 100755
--- a/graphics-libs/glfw/DETAILS
+++ b/graphics-libs/glfw/DETAILS
@@ -1,19 +1,20 @@
- SPELL=glfw
- VERSION=3.2.1
- SOURCE="${SPELL}-${VERSION}.tar.gz"
-
SOURCE_URL[0]=https://github.com/${SPELL}/${SPELL}/archive/${VERSION}.tar.gz
-
SOURCE_HASH=sha512:c7921f993b9a99b3b9421fefadb039cd475c42d85f5b5a35d7c5401c70491349bb885a02fd31e527de06a8b40d9d49a1fdb92c964e13c04ae092c6b98eb491dc
-SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
- DOC_DIRS=""
- WEB_SITE="http://www.glfw.org/";
- LICENSE[0]=zlib
- ENTERED=20150430
- SHORT="an Open Source, multi-platform library for creating
windows with OpenGL contexts and receiving input and events"
+. "$GRIMOIRE/CMAKE_FUNCTIONS"
+SPELL_BUILD_SYSTEM=cmake
+ SPELL=glfw
+ VERSION=3.3.9
+ SOURCE="${SPELL}-${VERSION}.tar.gz"
+
SOURCE_URL[0]=https://github.com/${SPELL}/${SPELL}/archive/${VERSION}.tar.gz
+
SOURCE_HASH=sha512:9fcccd650990fa88fcb6383afa90bc6c2eca7f4a4a3d4fc58fa5bd6b7995c32989bb29d2753f438984043b294244b82ba9f094426e12f3d4da4547e73bb62e3f
+ SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
+ DOC_DIRS=""
+ WEB_SITE="http://www.glfw.org/";
+ LICENSE[0]=zlib
+ ENTERED=20150430
+ SHORT="an Open Source, multi-platform library for creating
windows with OpenGL contexts and receiving input and events"
cat << EOF
-GLFW is an Open Source, multi-platform library for creating windows with
-OpenGL contexts and receiving input and events. It is easy to integrate into
-existing applications and does not lay claim to the main loop.
+GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and
Vulkan
+development on the desktop. It provides a simple API for creating windows,
+contexts and surfaces, receiving input and events.

-GLFW is written in C and has native support for Windows, OS X and many
-Unix-like systems using the X Window System, such as Linux and FreeBSD.
+GLFW is written in C and supports Windows, macOS, X11 and Wayland.
EOF
diff --git a/graphics-libs/glfw/HISTORY b/graphics-libs/glfw/HISTORY
index de930ce..e94a0ad 100644
--- a/graphics-libs/glfw/HISTORY
+++ b/graphics-libs/glfw/HISTORY
@@ -1,3 +1,12 @@
+2024-02-10 Justin Boffemmyer <flux AT sourcemage.org>
+ * DETAILS: updated spell to 3.3.9
+ * CONFIGURE: new, simplify and clarify selectable options while also
+ covering more of the choices upstream provides
+ * DEPENDS: convert to buildsys_depends, add new options for Wayland,
+ Vulkan, etc. support
+ * BUILD: respect the user's choice for building tests or not, examples
+ break the build so they are forcefully disabled for now
+
2016-09-29 Vlad Glagolev <stealth AT sourcemage.org>
* DETAILS: updated spell to 3.2.1; don't do useless doc-ing
* DEPENDS: added missing dependencies


  • [[SM-Commit] ] GIT changes to master grimoire by Justin Boffemmyer (5146afd98c49d1201dac3ff47668c056d4831151), Justin Boffemmyer, 02/10/2024

Archive powered by MHonArc 2.6.24.

Top of Page