aboutsummaryrefslogtreecommitdiffstats
path: root/x11-themes
diff options
context:
space:
mode:
authormarino <marino@FreeBSD.org>2016-08-18 14:02:13 +0800
committermarino <marino@FreeBSD.org>2016-08-18 14:02:13 +0800
commit94ab8709332fcbbe64cbd1ac41b1472349c3255c (patch)
tree5f42409dd945a341494c5eb5f13aec3a246a5e6d /x11-themes
parent8355d180929f6f4b7d25b962a22cdd289ed89125 (diff)
downloadfreebsd-ports-graphics-94ab8709332fcbbe64cbd1ac41b1472349c3255c.tar.gz
freebsd-ports-graphics-94ab8709332fcbbe64cbd1ac41b1472349c3255c.tar.zst
freebsd-ports-graphics-94ab8709332fcbbe64cbd1ac41b1472349c3255c.zip
x11-themes/slim-themes: fix invalid option definitions
Defining PORT_OPTIONS directly, especially after makefile fragment inclusions, is not valid and results in missing options values (yet masked when they are evaluated later after they are needed). Rework the automagic to function as intended with the exception of removing the redundant and potentially misleading "ALL_THEMES" option. All the themes are already set on by default and to change that required the extra step of unchecking ALL_THEMES (without doing so still resulted in all being selected even when options are unchecked which is confusing). Finally, use the option framework to enforce one choice with MULTI option rather than roll-your-own logic. PR: 211569 Approved by: maintainer timeout Discovered by: Synth sanity check failure
Diffstat (limited to 'x11-themes')
-rw-r--r--x11-themes/slim-themes/Makefile38
1 files changed, 14 insertions, 24 deletions
diff --git a/x11-themes/slim-themes/Makefile b/x11-themes/slim-themes/Makefile
index 6a81b4a8171..e90f5b8aa7a 100644
--- a/x11-themes/slim-themes/Makefile
+++ b/x11-themes/slim-themes/Makefile
@@ -3,6 +3,7 @@
PORTNAME= slim-themes
PORTVERSION= 1.0.1
+PORTREVISION= 1
CATEGORIES= x11-themes
MASTER_SITES= http://dist.codelabs.ru/fbsd/ports/slim-themes/:new_themes \
http://dist.codelabs.ru/fbsd/ports/slim-themes/:old_themes \
@@ -12,11 +13,6 @@ DISTFILES=
MAINTAINER= rea@FreeBSD.org
COMMENT= Theme pack for SLiM login app
-# But that's not all, see below.
-OPTIONS_DEFINE= ALL_THEMES
-OPTIONS_DEFAULT= ALL_THEMES
-ALL_THEMES_DESC= Include all themes
-
NO_BUILD= yes
NO_WRKSUBDIR= yes
SHAREMODE= 644
@@ -24,6 +20,11 @@ THEMEDIR_REL= share/slim/themes
THEMEDIR= ${PREFIX}/${THEMEDIR_REL}
PLIST_SUB+= THEMEDIR=${THEMEDIR_REL}
+OPTIONS_DEFINE= # empty
+OPTIONS_MULTI= THEME # enforces at least one choice
+OPTIONS_SUB= yes
+THEME_DESC= Available SLiM Themes
+
# Format is 'variable name%description%archive name%unpacked dir%dest
# dir%master site tag'
# I am substituting ' ' -> '+' because make in 6.x isn't able to properly
@@ -67,34 +68,23 @@ ${n}_DIST:= ${d}:${mtag}
.endif
${n}_SDIR:= ${sdir}
${n}_DDIR:= ${ddir}
-OPTIONS_DEFINE:= ${OPTIONS_DEFINE} ${n}
+OPTIONS_MULTI_THEME:= ${OPTIONS_MULTI_THEME} ${n}
A+= ${n}
${n}_DESC:= ${desc}
NEWTHEMES:= ${ALLTHEMES} ${n}
ALLTHEMES:= ${NEWTHEMES}
.endfor # t in ${THEMELIST}
-.include <bsd.port.pre.mk>
+OPTIONS_DEFAULT= ${OPTIONS_MULTI_THEME}
+
+.include <bsd.port.options.mk>
.for n in ${ALLTHEMES}
-.if ${PORT_OPTIONS:MALL_THEMES} || ${PORT_OPTIONS:M${n}}
-.if ! ${PORT_OPTIONS:M${n}}
-PORT_OPTIONS+= ${n}
-.endif
+. if ${PORT_OPTIONS:M${n}}
NEWDISTFILES:= ${DISTFILES} ${${n}_DIST}
DISTFILES:= ${NEWDISTFILES}
-SEEN_THEMES= yes
-NEWPLIST_SUB:= ${PLIST_SUB} ${n}=""
-PLIST_SUB:= ${NEWPLIST_SUB}
-.else
-NEWPLIST_SUB:= ${PLIST_SUB} ${n}="@comment "
-PLIST_SUB:= ${NEWPLIST_SUB}
-.endif # ${PORT_OPTIONS:MALL_THEMES} || ${PORT_OPTIONS:M${n}}
-.endfor # n in ${THEMELIST}
-
-.if !defined(SEEN_THEMES)
-IGNORE= at least one theme must be selected
-.endif
+. endif
+.endfor
.if ${PORT_OPTIONS:MPARALLEL_DIMS}
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-parallel-dimensions-slim.theme
@@ -114,4 +104,4 @@ do-install:
.endif # ${PORT_OPTIONS:M${n}}
.endfor # t in ${THEMELIST}
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>