1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00

graphics/darktable: Simplify options-dependent parts

Use variables prefixed by option names. This removes the need to use .if
blocks.

Use OPTIONS_SUB=yes and %%OPTION%% markers in pkg-plist. This fixes
pkg-plist for at least the LUA option [1].

Remove the post-patch target. It's not needed anymore, as the changes
were committed upstream.

Replace the usage of bsd.port.pre.mk/bsd.port.post.mk by
bsd.port.options.mk/bsd.port.mk.

Fix the build when WITH_DEBUG=1 is set. darktable's CMakeLists.txt
throws a fatal error if CMAKE_BUILD_TYPE is set to Debug and suggests to
use RelWithDebInfo: we now follow this advice.

Sort USES and options-prefixed variables alphabetically.

PR:		190516 [1]
Phabricator:	D178
Submitted by:	Matthieu Volat <mazhe@alkumuna.eu> (previous patch to fix [1])
Reviewed by:	bapt@
Approved by:	bapt@
This commit is contained in:
Jean-Sébastien Pédron 2014-06-12 09:10:15 +00:00
parent a666d7948a
commit 3163e98c5c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=357572
2 changed files with 109 additions and 153 deletions

View File

@ -20,7 +20,7 @@ LIB_DEPENDS= libexiv2.so:${PORTSDIR}/graphics/exiv2 \
ONLY_FOR_ARCHS= i386 amd64
ONLY_FOR_ARCHS_REASON= uses SSE extensions
USES= cmake:outsource pkgconfig tar:xz ninja desktop-file-utils
USES= cmake:outsource desktop-file-utils ninja pkgconfig tar:xz
USE_GNOME= librsvg2
USE_SQLITE= yes
USE_LDCONFIG= ${PREFIX}/lib/${PORTNAME}
@ -39,140 +39,75 @@ SLIDESHOW_DESC= Build OpenGL/SDL slideshow viewer
OPTIONS_DEFAULT=COLORD FB_PICASA FLICKR GEO GPHOTO LUA NLS OPENEXR \
OPENJPEG RAWSPEED WEBP
OPTIONS_SUB= yes
CMAKE_ARGS+= -DBINARY_PACKAGE_BUILD=1
.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MGPHOTO}
LIB_DEPENDS+= libgphoto2.so:${PORTSDIR}/graphics/libgphoto2
PLIST_FILES+= lib/darktable/plugins/lighttable/libcamera.so \
lib/darktable/plugins/lighttable/libcapture.so \
lib/darktable/plugins/lighttable/liblive_view.so \
lib/darktable/views/libcapture.so
.else
CMAKE_ARGS+= -DUSE_CAMERA_SUPPORT:BOOL=OFF
.endif
.if ${PORT_OPTIONS:MGEO}
LIB_DEPENDS+= libsoup-2.4.so:${PORTSDIR}/devel/libsoup
PLIST_FILES+= lib/darktable/plugins/lighttable/libgeotagging.so \
lib/darktable/plugins/lighttable/liblocation.so \
lib/darktable/plugins/lighttable/libmap_settings.so \
lib/darktable/views/libmap.so
.else
CMAKE_ARGS+= -DUSE_GEO:BOOL=OFF
.endif
.if ${PORT_OPTIONS:MFLICKR}
LIB_DEPENDS+= libflickcurl.so:${PORTSDIR}/www/flickcurl
PLIST_FILES+= lib/darktable/plugins/imageio/storage/libflickr.so
.else
CMAKE_ARGS+= -DUSE_FLICKR:BOOL=OFF
.endif
.if ${PORT_OPTIONS:MFB_PICASA}
LIB_DEPENDS+= libjson-glib-1.0.so:${PORTSDIR}/devel/json-glib
PLIST_FILES+= lib/darktable/plugins/imageio/storage/libfacebook.so \
lib/darktable/plugins/imageio/storage/libpicasa.so
.else
CMAKE_ARGS+= -DUSE_GLIBJSON:BOOL=OFF
.endif
.if ${PORT_OPTIONS:MGNOMEKEYRING}
LIB_DEPENDS+= libgnome-keyring.so:${PORTSDIR}/security/libgnome-keyring
.else
CMAKE_ARGS+= -DUSE_GNOME_KEYRING:BOOL=OFF
.endif
.if ! ${PORT_OPTIONS:MRAWSPEED}
CMAKE_ARGS+= -DDONT_USE_RAWSPEED:BOOL=ON
.endif
.if ${PORT_OPTIONS:MOPENEXR}
LIB_DEPENDS+= libIlmImf.so:${PORTSDIR}/graphics/OpenEXR
PLIST_FILES+= lib/darktable/plugins/imageio/format/libexr.so
.else
CMAKE_ARGS+= -DUSE_OPENEXR:BOOL=OFF
.endif
.if ${PORT_OPTIONS:MOPENJPEG}
LIB_DEPENDS+= libopenjpeg.so:${PORTSDIR}/graphics/openjpeg15
PLIST_FILES+= lib/darktable/plugins/imageio/format/libj2k.so
.else
CMAKE_ARGS+= -DUSE_OPENJPEG:BOOL=OFF
.endif
.if ${PORT_OPTIONS:MCOLORD}
# darktable 1.4 can use colord but provides its own libcolord,
# statically linked to libdarktable.so.
LIB_DEPENDS+= libcolord.so:${PORTSDIR}/graphics/colord
.else
CMAKE_ARGS+= -DUSE_COLORD:BOOL=OFF
.endif
COLORD_LIB_DEPENDS= libcolord.so:${PORTSDIR}/graphics/colord
COLORD_CMAKE_OFF= -DUSE_COLORD:BOOL=OFF
.if ${PORT_OPTIONS:MGRAPHMAGICK}
LIB_DEPENDS+= libGraphicsMagick.so:${PORTSDIR}/graphics/GraphicsMagick13
.else
CMAKE_ARGS+= -DUSE_GRAPHICSMAGICK:BOOL=OFF
.endif
FB_PICASA_LIB_DEPENDS= libjson-glib-1.0.so:${PORTSDIR}/devel/json-glib
FB_PICASA_CMAKE_OFF= -DUSE_GLIBJSON:BOOL=OFF
.if ${PORT_OPTIONS:MLUA}
USES+= lua
PLIST_FILES+= %%DATADIR%%/lua/darktable/debug.lua \
%%DATADIR%%/luarc
.else
CMAKE_ARGS+= -DUSE_LUA:BOOL=OFF
.endif
FLICKR_LIB_DEPENDS= libflickcurl.so:${PORTSDIR}/www/flickcurl
FLICKR_CMAKE_OFF= -DUSE_FLICKR:BOOL=OFF
.if ${PORT_OPTIONS:MSQUISH}
BUILD_DEPENDS+= ${LOCALBASE}/lib/libsquish.a:${PORTSDIR}/graphics/squish
.else
CMAKE_ARGS+= -DUSE_SQUISH:BOOL=OFF
.endif
GEO_LIB_DEPENDS= libsoup-2.4.so:${PORTSDIR}/devel/libsoup
GEO_CMAKE_OFF= -DUSE_GEO:BOOL=OFF
.if ${PORT_OPTIONS:MSLIDESHOW}
USE_GL= gl
USE_SDL= sdl
PLIST_FILES+= bin/darktable-viewer
.else
CMAKE_ARGS+= -DBUILD_SLIDESHOW:BOOL=OFF
.endif
GNOMEKEYRING_LIB_DEPENDS=libgnome-keyring.so:${PORTSDIR}/security/libgnome-keyring
GNOMEKEYRING_CMAKE_OFF= -DUSE_GNOME_KEYRING:BOOL=OFF
.if ${PORT_OPTIONS:MWEBP}
LIB_DEPENDS+= libwebp.so:${PORTSDIR}/graphics/webp
PLIST_FILES+= lib/darktable/plugins/imageio/format/libwebp.so
.else
CMAKE_ARGS+= -DUSE_WEBP:BOOL=OFF
.endif
GPHOTO_LIB_DEPENDS= libgphoto2.so:${PORTSDIR}/graphics/libgphoto2
GPHOTO_CMAKE_OFF= -DUSE_CAMERA_SUPPORT:BOOL=OFF
.if ${PORT_OPTIONS:MNLS}
USES+= gettext
.else
CMAKE_ARGS+= -DUSE_NLS:BOOL=OFF
.endif
GRAPHMAGICK_LIB_DEPENDS=libGraphicsMagick.so:${PORTSDIR}/graphics/GraphicsMagick13
GRAPHMAGICK_CMAKE_OFF= -DUSE_GRAPHICSMAGICK:BOOL=OFF
LUA_USES= lua
LUA_CMAKE_OFF= -DUSE_LUA:BOOL=OFF
NLS_USES= gettext
NLS_CMAKE_OFF= -DUSE_NLS:BOOL=OFF
OPENEXR_LIB_DEPENDS= libIlmImf.so:${PORTSDIR}/graphics/OpenEXR
OPENEXR_CMAKE_OFF= -DUSE_OPENEXR:BOOL=OFF
OPENJPEG_LIB_DEPENDS= libopenjpeg.so:${PORTSDIR}/graphics/openjpeg15
OPENJPEG_CMAKE_OFF= -DUSE_OPENJPEG:BOOL=OFF
RAWSPEED_CMAKE_OFF= -DDONT_USE_RAWSPEED:BOOL=ON
SLIDESHOW_USE= GL=gl SDL=sdl
SLIDESHOW_CMAKE_OFF= -DBUILD_SLIDESHOW:BOOL=OFF
SQUISH_BUILD_DEPENDS= ${LOCALBASE}/lib/libsquish.a:${PORTSDIR}/graphics/squish
SQUISH_CMAKE_OFF= -DUSE_SQUISH:BOOL=OFF
WEBP_LIB_DEPENDS= libwebp.so:${PORTSDIR}/graphics/webp
WEBP_CMAKE_OFF= -DUSE_WEBP:BOOL=OFF
.include <bsd.port.options.mk>
.if ${OSVERSION} < 1000000
USE_GCC= yes
.endif
post-patch:
@${REINPLACE_CMD} -e 's,__APPLE__,__${OPSYS}__,' \
${WRKSRC}/src/common/utility.c
# Do not install useless (to end-user) documentation; adjust manpages path
@${REINPLACE_CMD} -e '/DOC_FILES/d ; s,share/man/man1,man/man1,' \
${WRKSRC}/doc/CMakeLists.txt
.if defined(WITH_DEBUG)
CMAKE_BUILD_TYPE?= RelWithDebInfo
STRIP=
.endif
post-install:
.if ! ${PORT_OPTIONS:MDOCS}
@${RM} ${STAGEDIR}${DOCSDIR}/darktablerc.html
@${RMDIR} ${STAGEDIR}${DOCSDIR}
.endif
.if ! ${PORT_OPTIONS:MRAWSPEED}
@${REINPLACE_CMD} -e '/rawspeed/d' ${TMPPLIST}
.endif
.if ! ${PORT_OPTIONS:MNLS}
@${REINPLACE_CMD} -e '/LC_MESSAGES/d' ${TMPPLIST}
post-install:
${RM} ${STAGEDIR}${DOCSDIR}/AUTHORS
${RM} ${STAGEDIR}${DOCSDIR}/LICENSE
${RM} ${STAGEDIR}${DOCSDIR}/README
${RM} ${STAGEDIR}${DOCSDIR}/TRANSLATORS
${RM} ${STAGEDIR}${DOCSDIR}/darktablerc.html
${RMDIR} ${STAGEDIR}${DOCSDIR}
.endif
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View File

@ -1,17 +1,24 @@
bin/darktable
bin/darktable-cli
bin/darktable-cltest
%%SLIDESHOW%%bin/darktable-viewer
lib/darktable/libdarktable.so
lib/darktable/plugins/imageio/format/libcopy.so
%%OPENEXR%%lib/darktable/plugins/imageio/format/libexr.so
%%OPENJPEG%%lib/darktable/plugins/imageio/format/libj2k.so
lib/darktable/plugins/imageio/format/libjpeg.so
lib/darktable/plugins/imageio/format/libpfm.so
lib/darktable/plugins/imageio/format/libpng.so
lib/darktable/plugins/imageio/format/libppm.so
lib/darktable/plugins/imageio/format/libtiff.so
%%WEBP%%lib/darktable/plugins/imageio/format/libwebp.so
lib/darktable/plugins/imageio/storage/libdisk.so
lib/darktable/plugins/imageio/storage/libemail.so
%%FB_PICASA%%lib/darktable/plugins/imageio/storage/libfacebook.so
%%FLICKR%%lib/darktable/plugins/imageio/storage/libflickr.so
lib/darktable/plugins/imageio/storage/libgallery.so
lib/darktable/plugins/imageio/storage/liblatex.so
%%FB_PICASA%%lib/darktable/plugins/imageio/storage/libpicasa.so
lib/darktable/plugins/libatrous.so
lib/darktable/plugins/libbasecurve.so
lib/darktable/plugins/libbilat.so
@ -70,6 +77,8 @@ lib/darktable/plugins/libvignette.so
lib/darktable/plugins/libwatermark.so
lib/darktable/plugins/libzonesystem.so
lib/darktable/plugins/lighttable/libbackgroundjobs.so
%%GPHOTO%%lib/darktable/plugins/lighttable/libcamera.so
%%GPHOTO%%lib/darktable/plugins/lighttable/libcapture.so
lib/darktable/plugins/lighttable/libcollect.so
lib/darktable/plugins/lighttable/libcolorlabels.so
lib/darktable/plugins/lighttable/libcolorpicker.so
@ -78,6 +87,7 @@ lib/darktable/plugins/lighttable/libdarktable_label.so
lib/darktable/plugins/lighttable/libexport.so
lib/darktable/plugins/lighttable/libfilmstrip.so
lib/darktable/plugins/lighttable/libfilter.so
%%GEO%%lib/darktable/plugins/lighttable/libgeotagging.so
lib/darktable/plugins/lighttable/libglobal_toolbox.so
lib/darktable/plugins/lighttable/libhinter.so
lib/darktable/plugins/lighttable/libhistogram.so
@ -85,6 +95,9 @@ lib/darktable/plugins/lighttable/libhistory.so
lib/darktable/plugins/lighttable/libimage.so
lib/darktable/plugins/lighttable/libimport.so
lib/darktable/plugins/lighttable/liblighttable_mode.so
%%GPHOTO%%lib/darktable/plugins/lighttable/liblive_view.so
%%GEO%%lib/darktable/plugins/lighttable/liblocation.so
%%GEO%%lib/darktable/plugins/lighttable/libmap_settings.so
lib/darktable/plugins/lighttable/libmasks.so
lib/darktable/plugins/lighttable/libmetadata.so
lib/darktable/plugins/lighttable/libmetadata_view.so
@ -100,8 +113,10 @@ lib/darktable/plugins/lighttable/libstyles.so
lib/darktable/plugins/lighttable/libtagging.so
lib/darktable/plugins/lighttable/libview_toolbox.so
lib/darktable/plugins/lighttable/libviewswitcher.so
%%GPHOTO%%lib/darktable/views/libcapture.so
lib/darktable/views/libdarkroom.so
lib/darktable/views/liblighttable.so
%%GEO%%lib/darktable/views/libmap.so
man/man1/darktable-cli.1.gz
man/man1/darktable.1.gz
share/appdata/darktable.appdata.xml
@ -132,6 +147,8 @@ share/applications/darktable.desktop
%%DATADIR%%/kernels/sharpen.cl
%%DATADIR%%/kernels/soften.cl
%%DATADIR%%/latex/photobook.cls
%%LUA%%%%DATADIR%%/lua/darktable/debug.lua
%%LUA%%%%DATADIR%%/luarc
%%DATADIR%%/pixmaps/dt_logo_128x128.png
%%DATADIR%%/pixmaps/idbutton-2.png
%%DATADIR%%/pixmaps/idbutton.png
@ -187,8 +204,8 @@ share/applications/darktable.desktop
%%DATADIR%%/pixmaps/plugins/darkroom/vignette.png
%%DATADIR%%/pixmaps/plugins/darkroom/watermark.png
%%DATADIR%%/pixmaps/plugins/darkroom/zonesystem.png
%%DATADIR%%/rawspeed/cameras.xml
%%DATADIR%%/rawspeed/showcameras.xsl
%%RAWSPEED%%%%DATADIR%%/rawspeed/cameras.xml
%%RAWSPEED%%%%DATADIR%%/rawspeed/showcameras.xsl
%%DATADIR%%/style/bullet.gif
%%DATADIR%%/style/close.gif
%%DATADIR%%/style/closelabel.gif
@ -205,6 +222,10 @@ share/applications/darktable.desktop
%%DATADIR%%/watermarks/darktable.svg
%%DATADIR%%/watermarks/hasselblad.svg
%%DATADIR%%/watermarks/promo.svg
%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/TRANSLATORS
%%PORTDOCS%%%%DOCSDIR%%/darktablerc.html
share/icons/hicolor/16x16/apps/darktable.png
share/icons/hicolor/22x22/apps/darktable.png
@ -215,40 +236,40 @@ share/icons/hicolor/48x48/apps/darktable.png
share/icons/hicolor/64x64/apps/darktable.png
share/icons/hicolor/scalable/apps/darktable-2.svg
share/icons/hicolor/scalable/apps/darktable.svg
share/locale/cs/LC_MESSAGES/darktable.mo
share/locale/da/LC_MESSAGES/darktable.mo
share/locale/de/LC_MESSAGES/darktable.mo
share/locale/el/LC_MESSAGES/darktable.mo
share/locale/es/LC_MESSAGES/darktable.mo
share/locale/fr/LC_MESSAGES/darktable.mo
share/locale/it/LC_MESSAGES/darktable.mo
share/locale/ja/LC_MESSAGES/darktable.mo
share/locale/nl/LC_MESSAGES/darktable.mo
share/locale/pl/LC_MESSAGES/darktable.mo
share/locale/pt_BR/LC_MESSAGES/darktable.mo
share/locale/pt_PT/LC_MESSAGES/darktable.mo
share/locale/ru/LC_MESSAGES/darktable.mo
share/locale/sq/LC_MESSAGES/darktable.mo
share/locale/sv/LC_MESSAGES/darktable.mo
share/locale/uk/LC_MESSAGES/darktable.mo
%%PORTDOCS%%@dirrmtry %%DOCSDIR%%
@dirrmtry %%DATADIR%%/watermarks
@dirrmtry %%DATADIR%%/style
@dirrmtry %%DATADIR%%/rawspeed
%%NLS%%share/locale/cs/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/da/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/de/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/el/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/es/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/fr/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/it/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/ja/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/nl/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/pl/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/pt_BR/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/pt_PT/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/ru/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/sq/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/sv/LC_MESSAGES/darktable.mo
%%NLS%%share/locale/uk/LC_MESSAGES/darktable.mo
@dirrmtry lib/darktable/plugins/imageio/format
@dirrmtry lib/darktable/plugins/imageio/storage
@dirrmtry lib/darktable/plugins/imageio
@dirrmtry lib/darktable/plugins/lighttable
@dirrmtry lib/darktable/plugins
@dirrmtry lib/darktable/views
@dirrmtry lib/darktable
@dirrmtry share/appdata
@dirrmtry %%DATADIR%%/js
@dirrmtry %%DATADIR%%/kernels
@dirrmtry %%DATADIR%%/latex
%%LUA%%@dirrmtry %%DATADIR%%/lua/darktable
%%LUA%%@dirrmtry %%DATADIR%%/lua
@dirrmtry %%DATADIR%%/pixmaps/plugins/darkroom
@dirrmtry %%DATADIR%%/pixmaps/plugins
@dirrmtry %%DATADIR%%/pixmaps
@dirrmtry %%DATADIR%%/lua/darktable
@dirrmtry %%DATADIR%%/lua
@dirrmtry %%DATADIR%%/latex
@dirrmtry %%DATADIR%%/kernels
@dirrmtry %%DATADIR%%/js
%%RAWSPEED%%@dirrmtry %%DATADIR%%/rawspeed
@dirrmtry %%DATADIR%%/style
@dirrmtry %%DATADIR%%/watermarks
@dirrmtry %%DATADIR%%
@dirrmtry share/appdata
@dirrmtry lib/darktable/views
@dirrmtry lib/darktable/plugins/lighttable
@dirrmtry lib/darktable/plugins/imageio/storage
@dirrmtry lib/darktable/plugins/imageio/format
@dirrmtry lib/darktable/plugins/imageio
@dirrmtry lib/darktable/plugins
@dirrmtry lib/darktable
%%PORTDOCS%%@dirrmtry %%DOCSDIR%%