Skip to content

Commit

Permalink
framework: Add new USES 'magick' for graphics/ImageMagick*
Browse files Browse the repository at this point in the history
A new USES has been added to depend on ImageMagick.

	USES=magick

adds a LIB_DEPENDS on graphics/ImageMagick${IMAGEMAGICK_DEFAULT}.

If a specific version is required, use for example

	USES=magick:6        resp.     USES=magick:7

If only a build, run or test is required, use for example

	USES=magick:build    resp.     USES=magick:6,build,test

If a dependency on the nox11 flavor is required, use for example

	USES=magick:nox11    resp.     USES=magick:7,nox11,run,test

See magick.mk for more details on the available flags.

The tree has been completely converted to make use of this.

Approved by:	bapt
Differential Revision: https://reviews.freebsd.org/D32754
  • Loading branch information
tcberner committed Dec 11, 2021
1 parent a148ebe commit 45526ec
Show file tree
Hide file tree
Showing 146 changed files with 343 additions and 313 deletions.
23 changes: 23 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@ in the release notes and/or placed into UPDATING.

All ports committers are allowed to commit to this file.

20211211:
AUTHOR: tcberner@FreeBSD.org

A new USES has been added to depend on ImageMagick.

USES=magick

adds a LIB_DEPENDS on graphics/ImageMagick${IMAGEMAGICK_DEFAULT}.

If a specific version is required, use for example

USES=magick:6 resp. USES=magick:7

If only a build, run or test is required, use for example

USES=magick:build resp. USES=magick:6,build,test

If a dependency on the nox11 flavor is required, use for example

USES=magick:nox11 resp. USES=magick:7,nox11,run,test

See magick.mk for more details on the available flags.

20211122:
AUTHOR: bapt@FreeBSD.org

Expand Down
9 changes: 9 additions & 0 deletions Mk/Scripts/qa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,15 @@ proxydeps_suggest_uses() {
# lua
elif expr ${pkg} : "^lang/lua" > /dev/null; then
warn "you need USES+=lua"
# magick
elif [ ${pkg} = "graphics/ImageMagick6" ] ; then
warn "you need USES=magick:6"
elif [ ${pkg} = "graphics/ImageMagick6-nox11" ] ; then
warn "you need USES=magick:6,nox11"
elif [ ${pkg} = "graphics/ImageMagick7" ] ; then
warn "you need USES=magick:7"
elif [ ${pkg} = "graphics/ImageMagick7-nox11" ] ; then
warn "you need USES=magick:7,nox11"
# motif
elif [ ${pkg} = "x11-toolkits/lesstif" -o ${pkg} = "x11-toolkits/open-motif" ]; then
warn "you need USES+=motif"
Expand Down
93 changes: 93 additions & 0 deletions Mk/Uses/magick.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Handle dependency on ImageMagick
#
# Feature: magick
# Usage: USES=magick:ARGS
# Valid ARGS: [version],[kinds],[flavor]
#
# version The chooseable versions are <none>, 6 and 7.
# USES=magick -- depend on ${IMAGEMAGICK_DEFAULT} (default)
# 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)
# 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
#
# In short, on a default ports tree
# USES=magick
# is equivalent to
# USES=magick:7,lib
#
# MAINTAINER: tcberner@FreeBSD.org
#

.if ! defined(_INCLUDE_USES_MAGICK_MK)
_INCLUDE_USES_MAGICK_MK= YES

#=== Version selection ===
_magick_versions= 6 7

_magick_version= #
. for _ver in ${_magick_versions:O:u}
. if ${magick_ARGS:M${_ver}}
. if empty(_magick_version)
_magick_version= ${_ver}
. else
IGNORE= Incorrect USES=magick:${magick_ARGS} - multiple versions defined
. endif
. endif
. endfor
# Fallback to the default version
.if empty(_magick_version)
_magick_version= ${IMAGEMAGICK_DEFAULT}
.endif

#=== Flavor selection ===
_magick_flavors= nox11
_magick_flavor= #
. for _flavor in ${_magick_flavors:O:u}
. if ${magick_ARGS:M${_flavor}}
. if empty(_magick_flavor)
_magick_flavor= -${_flavor}
. else
IGNORE= Incorrect USES=magick:${magick_ARGS} - multiple flavors defined
. endif
. endif
. endfor

#=== Dependeny selection ===
_magick_depends= lib build run test
_magick_depend= #
. for _depend in ${_magick_depends:O:u}
. if ${magick_ARGS:M${_depend}}
_magick_depend+= ${_depend}
. endif
. endfor
.if empty(_magick_depend)
_magick_depend= lib
.endif

#=== Dependency setup ===
_MAGICK_PORT= graphics/ImageMagick${_magick_version}${_magick_flavor}
_MAGICK_LIB= libMagick++-${_magick_version}.so
_MAGICK_PKG= ImageMagick${_magick_version}${_magick_flavor}

_MAGICK_BUILD_DEPENDS= ${_MAGICK_PKG}>=${_magick_version}:${_MAGICK_PORT}
_MAGICK_LIB_DEPENDS= ${_MAGICK_LIB}:${_MAGICK_PORT}
_MAGICK_RUN_DEPENDS= ${_MAGICK_PKG}>=${_magick_version}:${_MAGICK_PORT}
_MAGICK_TEST_DEPENDS= ${_MAGICK_PKG}>=${_magick_version}:${_MAGICK_PORT}

#=== Actual dependency creation ===
. for _kind in ${_magick_depend}
${_kind:tu}_DEPENDS+= ${_MAGICK_${_kind:tu}_DEPENDS}
. endfor

.endif
2 changes: 1 addition & 1 deletion audio/beets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ DISCOGS_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}discogs-client>=2.2.1:audio/py-disco
EMBYUPDATE_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}requests>=0:www/py-requests@${PY_FLAVOR}
FETCHART_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}requests>=0:www/py-requests@${PY_FLAVOR}
FFMPEG_RUN_DEPENDS= ffmpeg>=2:multimedia/ffmpeg
IMAGEMAGICK_RUN_DEPENDS= convert:graphics/ImageMagick6
IMAGEMAGICK_USES= magick:6,run
IPFS_RUN_DEPENDS= ipfs-go:sysutils/ipfs-go
KODIUPDATE_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}requests>=0:www/py-requests@${PY_FLAVOR}
LASTFM_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pylast>=0:audio/py-pylast@${PY_FLAVOR}
Expand Down
3 changes: 1 addition & 2 deletions audio/kwave/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ CATEGORIES= audio kde kde-applications
MAINTAINER= kde@FreeBSD.org
COMMENT= Sound editor for KDE

BUILD_DEPENDS= convert:graphics/ImageMagick6
LIB_DEPENDS= libaudiofile.so:audio/libaudiofile \
libFLAC.so:audio/flac \
libfftw3.so:math/fftw3 \
Expand All @@ -17,7 +16,7 @@ LIB_DEPENDS= libaudiofile.so:audio/libaudiofile \
libvorbisenc.so:audio/libvorbis

USES= cmake compiler:c++11-lang desktop-file-utils gettext kde:5 \
localbase:ldflags pkgconfig qt:5 tar:xz
localbase:ldflags magick:6,build pkgconfig qt:5 tar:xz
USE_KDE= archive auth bookmarks codecs completion config configwidgets \
coreaddons crash dbusaddons i18n iconthemes itemviews \
jobwidgets kio service solid sonnet textwidgets widgetsaddons \
Expand Down
2 changes: 1 addition & 1 deletion audio/mp3plot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PLIST_FILES= bin/${PORTNAME} man/man1/${PORTNAME}.1.gz
GD_CONFIGURE_ENABLE= gd
GD_LIB_DEPENDS= libgd.so:graphics/gd
IMAGEMAGICK_CONFIGURE_ENABLE= magick
IMAGEMAGICK_LIB_DEPENDS=libMagick++-6.so:graphics/ImageMagick6
IMAGEMAGICK_USES= magick:6

post-patch:
@${REINPLACE_CMD} -e '/bldtype_/s|-O2||g; s|^extra_LD.*||g' ${WRKSRC}/configure
Expand Down
5 changes: 2 additions & 3 deletions cad/alliance/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

BROKEN_aarch64= fails to link: collect2: error: ld returned 1 exit status

BUILD_DEPENDS= convert:graphics/ImageMagick${IMAGEMAGICK_DEFAULT} \
fig2dev:print/fig2dev
BUILD_DEPENDS= fig2dev:print/fig2dev

USES= autoreconf:build gmake libtool motif tar:bz2 xorg
USES= autoreconf:build gmake libtool magick:build motif tar:bz2 xorg
USE_GCC= yes
USE_TEX= dvipsk:build latex:build
USE_XORG= ice sm x11 xext xt
Expand Down
5 changes: 2 additions & 3 deletions comms/apitran/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tkinter>0:x11-toolkits/py-tkinter@${PY_FLAVO
${PYTHON_PKGNAMEPREFIX}scipy>0:science/py-scipy@${PY_FLAVOR} \
${PYNUMPY} \
${PY_PILLOW} \
sox:audio/sox \
display:graphics/ImageMagick6
sox:audio/sox

USES= python:3.6+,run shebangfix
USES= magick:6,run python:3.6+,run shebangfix
USE_GITHUB= yes
GH_ACCOUNT= rsj56
GH_TAGNAME= d209347
Expand Down
2 changes: 1 addition & 1 deletion comms/xastir/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ OPTIONS_DEFAULT= BDB CURL GMAGICK

DAVIS_CONFIGURE_ON= --enable-davis

IMAGICK_LIB_DEPENDS= libMagickWand-6.so:graphics/ImageMagick6
IMAGICK_USES= magick:6
IMAGICK_CONFIGURE_WITH= imagemagick

GMAGICK_LIB_DEPENDS= libGraphicsMagickWand.so:graphics/GraphicsMagick
Expand Down
4 changes: 1 addition & 3 deletions databases/opendbviewer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ COMMENT= Simple database explorer
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/COPYING

BUILD_DEPENDS= convert:graphics/ImageMagick6

USES= cmake compiler:c++11-lang qt:5
USES= cmake compiler:c++11-lang magick:6,build qt:5
USE_GITHUB= yes
GH_ACCOUNT= Jet1oeil
USE_QT= core gui network sql sql-sqlite3 testlib widgets \
Expand Down
2 changes: 1 addition & 1 deletion databases/virtuoso/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ BROKEN_FreeBSD_14= OpenSSL version 1.1.0 or greater is currently not supported

.if ${PORT_OPTIONS:MIMAGEMAGICK}
CONFIGURE_ARGS+=--enable-imagemagick=${LOCALBASE}
LIB_DEPENDS+= libMagickWand-6.so:graphics/ImageMagick6
USES+= magick:6
PLIST_SUB+= WITH_IMAGEMAGICK=""
.else
CONFIGURE_ARGS+=--disable-imagemagick
Expand Down
3 changes: 1 addition & 2 deletions deskutils/goesimage/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ LICENSE= UNLICENSE
LICENSE_FILE= ${WRKSRC}/UNLICENSE

RUN_DEPENDS= bash:shells/bash \
convert:graphics/ImageMagick6 \
curl:ftp/curl \
nitrogen:sysutils/nitrogen

USES= shebangfix
USES= magick:6,run shebangfix
SHEBANG_FILES= goesimage
USE_GITHUB= yes
GH_ACCOUNT= pigmonkey
Expand Down
8 changes: 4 additions & 4 deletions deskutils/py-paperless/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ IMAGICK7_X11_DESC= ImageMagick7 with X11 support
DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>=1.8.3,1:textproc/py-sphinx@${PY_FLAVOR}
DOCS_USES= gmake

IMAGICK6_X11_RUN_DEPENDS= convert:graphics/ImageMagick6
IMAGICK6_NOX11_RUN_DEPENDS= convert:graphics/ImageMagick6-nox11
IMAGICK7_X11_RUN_DEPENDS= convert:graphics/ImageMagick7
IMAGICK7_NOX11_RUN_DEPENDS= convert:graphics/ImageMagick7-nox11
IMAGICK6_X11_USES= magick:6,run
IMAGICK6_NOX11_USES= magick:6,run,nox11
IMAGICK7_X11_USES= magick:7,run
IMAGICK7_NOX11_USES= magick:7,run,nox11

PORTDOCS= *

Expand Down
2 changes: 1 addition & 1 deletion devel/bugzilla44/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ MAIL_QUEUEING_RUN_DEPENDS= p5-TheSchwartz>=1.10:devel/p5-TheSchwartz \
p5-File-Slurp>=9999.13:devel/p5-File-Slurp
MOVE_BUGZ_RUN_DEPENDS= p5-MIME-Tools>=5.406:mail/p5-MIME-Tools \
p5-XML-Twig>=0:textproc/p5-XML-Twig
BMP2PNG_RUN_DEPENDS= convert:graphics/ImageMagick6
BMP2PNG_USES= magick:6,run
# Note: XML-RPC and JSON-RPC are deprecated in favor of REST
# and will likely be removed in the Bugzilla 7.0 release.
# XXX SOAP::Lite can be removed if upstream officially depends on
Expand Down
2 changes: 1 addition & 1 deletion devel/bugzilla50/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ MAIL_QUEUEING_RUN_DEPENDS= p5-TheSchwartz>=1.10:devel/p5-TheSchwartz \
p5-Daemon-Generic>=0:net/p5-Daemon-Generic
MOVE_BUGZ_RUN_DEPENDS= p5-MIME-Tools>=5.406:mail/p5-MIME-Tools \
p5-XML-Twig>=0:textproc/p5-XML-Twig
BMP2PNG_RUN_DEPENDS= convert:graphics/ImageMagick6
BMP2PNG_USES= magick:6,run
# Note: XML-RPC and JSON-RPC are deprecated in favor of REST
# and will likely be removed in the Bugzilla 7.0 release.
# XXX SOAP::Lite can be removed if upstream officially depends on
Expand Down
5 changes: 2 additions & 3 deletions devel/p5-Project-Gantt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ MAINTAINER= perl@FreeBSD.org
COMMENT= Create Gantt charts to manage project scheduling

BUILD_DEPENDS= ${RUN_DEPENDS}
RUN_DEPENDS= p5-Class-Date>=0:devel/p5-Class-Date \
convert:graphics/ImageMagick6
RUN_DEPENDS= p5-Class-Date>=0:devel/p5-Class-Date

USES= perl5
USES= magick:6,run perl5
USE_PERL5= configure
WRKSRC= ${WRKDIR}/Gantt

Expand Down
4 changes: 2 additions & 2 deletions devel/rubygem-paperclip-rails5/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ OPTIONS_DEFAULT= IMNOX11
IMNOX11_DESC= Depend on ImageMagick without X11 support
IMX11_DESC= Depend on ImageMagick with X11 support

IMNOX11_RUN_DEPENDS= ImageMagick6-nox11>0:graphics/ImageMagick6-nox11
IMX11_RUN_DEPENDS= ImageMagick6>0:graphics/ImageMagick6
IMNOX11_USES= magick:6,run,nox11
IMX11_USES= magick:6,run

.include <bsd.port.mk>
5 changes: 2 additions & 3 deletions devel/rubygem-paperclip-rails50/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ COMMENT= Easy upload management for ActiveRecord
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE

RUN_DEPENDS= ImageMagick7-nox11>=0:graphics/ImageMagick7-nox11 \
rubygem-activemodel50>0:databases/rubygem-activemodel50 \
RUN_DEPENDS= rubygem-activemodel50>0:databases/rubygem-activemodel50 \
rubygem-activesupport50>=0:devel/rubygem-activesupport50 \
rubygem-mimemagic>=0.3.0:misc/rubygem-mimemagic \
rubygem-mime-types>=0:misc/rubygem-mime-types \
rubygem-terrapin>=0.6.0:devel/rubygem-terrapin

NO_ARCH= yes
USE_RUBY= yes
USES= cpe gem
USES= cpe gem magick:7,nox11,run
CPE_VENDOR= thoughtbot

.include <bsd.port.mk>
2 changes: 1 addition & 1 deletion editors/emacs-devel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ LCMS2_CONFIGURE_WITH= lcms2
M17N_IMPLIES= XFT
M17N_LIB_DEPENDS= libm17n.so:devel/m17n-lib
M17N_CONFIGURE_WITH= m17n-flt
MAGICK_LIB_DEPENDS= libMagickCore-7.so:graphics/ImageMagick7
MAGICK_USES= magick:7
MAGICK_CONFIGURE_WITH= imagemagick
MAILUTILS_LIB_DEPENDS= libmailutils.so:mail/mailutils
MAILUTILS_CONFIGURE_WITH= mailutils
Expand Down
2 changes: 1 addition & 1 deletion editors/emacs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ LCMS2_CONFIGURE_WITH= lcms2
M17N_IMPLIES= XFT
M17N_LIB_DEPENDS= libm17n.so:devel/m17n-lib
M17N_CONFIGURE_WITH= m17n-flt
MAGICK_LIB_DEPENDS= libMagickCore-7.so:graphics/ImageMagick7
MAGICK_USES= magick:7
MAGICK_CONFIGURE_WITH= imagemagick
MAILUTILS_LIB_DEPENDS= libmailutils.so:mail/mailutils
MAILUTILS_CONFIGURE_WITH= mailutils
Expand Down
3 changes: 1 addition & 2 deletions emulators/mgba/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ LIBRETRO_CMAKE_BOOL= BUILD_LIBRETRO
LIBRETRO_CMAKE_ON= -DLIBRETRO_LIBDIR:PATH="${PREFIX}/lib/libretro"
LIBRETRO_CONFLICTS_INSTALL= libretro-mgba

MAGICK_LIB_DEPENDS= libMagickWand-6.so:graphics/ImageMagick6 \
libMagickCore-6.so:graphics/ImageMagick6
MAGICK_USES= magick:6
MAGICK_CMAKE_BOOL= USE_MAGICK

QT5_USES= desktop-file-utils qt:5
Expand Down
3 changes: 1 addition & 2 deletions games/enigma/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ LIB_DEPENDS= libxerces-c.so.3:textproc/xerces-c3 \
libpng.so:graphics/png \
libenet.so:net/enet \
libcurl.so:ftp/curl
BUILD_DEPENDS= convert:graphics/ImageMagick6

USE_GITHUB= yes
GH_ACCOUNT= Enigma-Game
GH_PROJECT= Enigma

USES= autoreconf:build gettext gmake iconv localbase pkgconfig sdl
USES= autoreconf:build gettext gmake iconv localbase magick:6,build pkgconfig sdl
GNU_CONFIGURE= yes
USE_SDL= sdl2 image2 mixer2 ttf2
CONFIGURE_ARGS= --with-system-enet
Expand Down
3 changes: 1 addition & 2 deletions games/openclaw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ OPTIONS_DEFINE= LAUNCHER
OPTIONS_DEFAULT= LAUNCHER

LAUNCHER_DESC= Install launcher to manage game settings
LAUNCHER_USES= mono
LAUNCHER_BUILD_DEPENDS= convert:graphics/ImageMagick6
LAUNCHER_USES= magick:6,build mono
LAUNCHER_PLIST_FILES= bin/ClawLauncher.exe bin/clawlauncher
LAUNCHER_DESKTOP_ENTRIES= \
"${GH_PROJECT}" \
Expand Down
2 changes: 1 addition & 1 deletion games/openfodder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DESKTOP_ENTRIES="${PORTNAME}" \
OPTIONS_DEFINE= DOCS ICONS
OPTIONS_DEFAULT=ICONS

ICONS_BUILD_DEPENDS= mogrify:graphics/ImageMagick${IMAGEMAGICK_DEFAULT}
ICONS_USES= magick:build

post-patch:
@${REINPLACE_CMD} -e 's,clang++,${CXX},' \
Expand Down
3 changes: 1 addition & 2 deletions games/openspades/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
ONLY_FOR_ARCHS= amd64 powerpc64 powerpc64le
ONLY_FOR_ARCHS_REASON= bundles non-portable AngelScript

BUILD_DEPENDS= convert:graphics/ImageMagick6 # for building icons
LIB_DEPENDS= libcurl.so:ftp/curl \
libopusfile.so:audio/opusfile

USE_GITHUB= yes
GH_ACCOUNT= yvt

USES= cmake:insource compiler:c++11-lib desktop-file-utils dos2unix \
gl gnome openal sdl xorg
gl gnome magick:6,build openal sdl xorg
CMAKE_ARGS= -DOPENSPADES_RESOURCES=OFF \
-DOPENSPADES_INSTALL_MAN="man/man6" \
-DOPENSPADES_INSTALL_BINARY="bin" \
Expand Down
Loading

0 comments on commit 45526ec

Please sign in to comment.