Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110167379
D39424.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D39424.diff
View Options
diff --git a/CHANGES b/CHANGES
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,21 @@
All ports committers are allowed to commit to this file.
+20230430:
+AUTHOR: zirias@FreeBSD.org
+
+ USES=magick has been updated based on flavorized ports.
+
+ A new argument 'x11' is available to specifically depend on the flavor
+ with X11 support. Fallback to DEFAULT_VERSIONS now happens
+ independently for the version (currently 6 or 7) and the flavor
+ (currently x11 or nox11).
+
+ Only use arguments for version or flavor if your port really requires
+ it. Also, there is no need to add options for selecting the -nox11
+ flavor any more, as the user setting in DEFAULT_VERSIONS will be
+ honored.
+
20230111:
AUTHOR: vishwin@FreeBSD.org
diff --git a/Mk/Uses/magick.mk b/Mk/Uses/magick.mk
--- a/Mk/Uses/magick.mk
+++ b/Mk/Uses/magick.mk
@@ -2,29 +2,33 @@
#
# Feature: magick
# Usage: USES=magick:ARGS
-# Valid ARGS: [version],[kinds],[flavor]
+# Valid ARGS: [version],[flavor],[kinds]
#
# version The chooseable versions are <none>, 6 and 7.
-# USES=magick -- depend on ${IMAGEMAGICK_DEFAULT} (default)
+# USES=magick -- depend on version from DEFAULT_VERSIONS
# USES=magick:6 -- depend on ImageMagick6
# USES=magick:7 -- depend on ImageMagick7
#
-# flavor The flavors are <none> and nox11
-# USES=magick -- depend on the default flavor (default)
+# flavor The flavors are <none>, x11 and nox11
+# USES=magick -- depend on flavor from DEFAULT_VERSIONS
+# USES=magick:x11 -- depend on the x11 flavor
# USES=magick:nox11 -- depend on the nox11 flavor
#
# kinds The dependency kinds are <none>, lib, build, run and test
-# USES=magick -- add a LIB_DEPENDS (default)
-# USES=magick:lib -- add a LIB_DEPENDS
-# USES=magick:build -- add a BUILD_DEPENDS
-# USES=magick:run -- add a RUN_DEPENDS
-# USES=magick:test -- add a TEST_DEPENDS
-# USES=build,run -- add a BUILD_- and RUN_DEPENDS
+# USES=magick -- add a LIB_DEPENDS (default)
+# USES=magick:lib -- add a LIB_DEPENDS
+# USES=magick:build -- add a BUILD_DEPENDS
+# USES=magick:run -- add a RUN_DEPENDS
+# USES=magick:test -- add a TEST_DEPENDS
+# USES=magick:build,run -- add a BUILD_- and RUN_DEPENDS
#
-# In short, on a default ports tree
+# In short, on a default ports tree without custom DEFAULT_VERSIONS
# USES=magick
# is equivalent to
-# USES=magick:7,lib
+# USES=magick:7,x11,lib
+#
+# Make sure to only add arguments strictly needed, as [version] and [flavor]
+# will override user configuration in DEFAULT_VERSIONS.
#
# MAINTAINER: tcberner@FreeBSD.org
#
@@ -47,21 +51,31 @@
. endfor
# Fallback to the default version
. if empty(_magick_version)
-_magick_version= ${IMAGEMAGICK_DEFAULT}
+_magick_version= ${IMAGEMAGICK_DEFAULT:C/-.*//}
+. endif
+. if !${_magick_versions:M${_magick_version}}
+IGNORE= Invalid version of ImageMagick: "${_magick_version}"
. endif
#=== Flavor selection ===
-_magick_flavors= nox11
+_magick_flavors= x11 nox11
_magick_flavor= #
. for _flavor in ${_magick_flavors:O:u}
. if ${magick_ARGS:M${_flavor}}
. if empty(_magick_flavor)
-_magick_flavor= -${_flavor}
+_magick_flavor= ${_flavor}
. else
IGNORE= Incorrect USES=magick:${magick_ARGS} - multiple flavors defined
. endif
. endif
. endfor
+# Fallback to the default flavor
+. if empty(_magick_flavor) && ${IMAGEMAGICK_DEFAULT:M*-*}
+_magick_flavor= ${IMAGEMAGICK_DEFAULT:C/.*-//}
+. endif
+. if !empty(_magick_flavor) && !${_magick_flavors:M${_magick_flavor}}
+IGNORE= Invalid flavor of ImageMagick: "${_magick_flavor}"
+. endif
#=== Dependency selection ===
_magick_depends= lib build run test
@@ -75,10 +89,19 @@
_magick_depend= lib
. endif
+#=== Check for invalid arguments ===
+_magick_unknown_args:= ${magick_ARGS:N${_magick_version}:N${_magick_flavor}}
+. for _depend in ${_magick_depend}
+_magick_unknown_args:= ${_magick_unknown_args:N${_depend}}
+. endfor
+. if !empty(_magick_unknown_args)
+IGNORE= Invalid USES=magick - unsupported argument(s): ${_magick_unknown_args}
+. endif
+
#=== Dependency setup ===
-_MAGICK_PORT= graphics/ImageMagick${_magick_version}${_magick_flavor}
+_MAGICK_PORT= graphics/ImageMagick${_magick_version}${_magick_flavor:%=@%}
_MAGICK_LIB= libMagick++-${_magick_version}.so
-_MAGICK_PKG= ImageMagick${_magick_version}${_magick_flavor}
+_MAGICK_PKG= ImageMagick${_magick_version}${_magick_flavor:Mnox11:%=-%}
_MAGICK_BUILD_DEPENDS= ${_MAGICK_PKG}>=${_magick_version}:${_MAGICK_PORT}
_MAGICK_LIB_DEPENDS= ${_MAGICK_LIB}:${_MAGICK_PORT}
diff --git a/Mk/bsd.default-versions.mk b/Mk/bsd.default-versions.mk
--- a/Mk/bsd.default-versions.mk
+++ b/Mk/bsd.default-versions.mk
@@ -59,7 +59,11 @@
GL_DEFAULT?= mesa-libs
# Possible values: 1.18, 1.19, 1.20, 1.21-devel
GO_DEFAULT?= 1.20
-# Possible values: 6, 6-nox11, 7, 7-nox11
+# Possible versions: 6, 7
+# Possible flavors: x11, nox11
+# (defaults to x11 when not specified)
+# Format: version[-flavor]
+# Examples: 6-nox11, 7
IMAGEMAGICK_DEFAULT?= 7
# Possible values: 7, 8, 11, 17, 18
JAVA_DEFAULT?= 8
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 15, 1:34 PM (11 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16659227
Default Alt Text
D39424.diff (5 KB)
Attached To
Mode
D39424: Mk/Uses/magick.mk: Fix DEFAULT_VERSION handling
Attached
Detach File
Event Timeline
Log In to Comment