pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
dzen-git: fix pkglint warnings about SUBST blocks
Module Name: pkgsrc-wip
Committed By: Roland Illig <rillig%NetBSD.org@localhost>
Pushed By: rillig
Date: Sat Mar 17 22:44:39 2018 +0000
Changeset: 7cf15be083e9decf1dc8e9274517faf7b8830f9f
Modified Files:
dzen-git/options.mk
Log Message:
dzen-git: fix pkglint warnings about SUBST blocks
Pkglint doesn't like SUBST blocks that span several paragraphs. In this
case, the code can be written much clearer by introducing two additional
variables. It is also better to address the lines by their content than
by their line number, which was especially fragile because there is a
patch for config.mk.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=7cf15be083e9decf1dc8e9274517faf7b8830f9f
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
dzen-git/options.mk | 34 ++++++++++++++++------------------
1 file changed, 16 insertions(+), 18 deletions(-)
diffs:
diff --git a/dzen-git/options.mk b/dzen-git/options.mk
index 9844fbe09f..e0a4f4db86 100644
--- a/dzen-git/options.mk
+++ b/dzen-git/options.mk
@@ -7,26 +7,28 @@ PKG_SUGGESTED_OPTIONS= xpm xinerama
.include "../../mk/bsd.options.mk"
-SUBST_CLASSES+= config
+SUBST_CLASSES+= config
SUBST_STAGE.config= pre-build
-SUBST_MESSAGE.config= Adapting config.mk to pkgsrc, according to package options
+SUBST_MESSAGE.config= Adapting config.mk to pkgsrc, according to package options
SUBST_FILES.config= config.mk
+SUBST_SED.config= -e '/^CFLAGS =/ s|$$|'${DZEN_CFLAGS:Q}'|'
+SUBST_SED.config+= -e '/^LIBS =/ s|$$|'${DZEN_LIBS:Q}'|'
+
+DZEN_CFLAGS= # none
+DZEN_LIBS= # none
###
### Enable XFT support
###
.if !empty(PKG_OPTIONS:Mxft)
-# append to CFLAGS line
-SUBST_SED.config+= -e '22 s|$$| -DDZEN_XFT|'
-
-# NetBSD-specific thing
-.if ${OPSYS} == "NetBSD"
-SUBST_SED.config+= -e '22 s|$$| -I${X11BASE}/include/freetype2|'
-.endif
+DZEN_CFLAGS+= -DDZEN_XFT
+. if ${OPSYS} == "NetBSD"
+DZEN_CFLAGS+= -I${X11BASE}/include/freetype2
+. endif
# append to LIBS line
-SUBST_SED.config+= -e '21 s|$$| -lXft|'
+DZEN_LIBS+= -lXft
.include "../../x11/libXft/buildlink3.mk"
.endif
@@ -34,10 +36,8 @@ SUBST_SED.config+= -e '21 s|$$| -lXft|'
### Enable XPM support
###
.if !empty(PKG_OPTIONS:Mxpm)
-# append to CFLAGS line
-SUBST_SED.config+= -e '22 s|$$| -DDZEN_XPM|'
-# append to LIBS line
-SUBST_SED.config+= -e '21 s|$$| -lXpm|'
+DZEN_CFLAGS+= -DDZEN_XPM
+DZEN_LIBS+= -lXpm
.include "../../x11/libXpm/buildlink3.mk"
.endif
@@ -45,9 +45,7 @@ SUBST_SED.config+= -e '21 s|$$| -lXpm|'
### Enable XINERAMA support
###
.if !empty(PKG_OPTIONS:Mxpm)
-# append to CFLAGS line
-SUBST_SED.config+= -e '22 s|$$| -DDZEN_XINERAMA|'
-# append to LIBS line
-SUBST_SED.config+= -e '21 s|$$| -lXinerama|'
+DZEN_CFLAGS+= -DDZEN_XINERAMA
+DZEN_LIBS+= -lXinerama
.include "../../x11/libXinerama/buildlink3.mk"
.endif
Home |
Main Index |
Thread Index |
Old Index