- Fix build without NLS (missing gettext-tools dependency) and without EXAMPLES (broken patching)

- Convert patching to options helpers, silence, fix whitespace and make more future proof

Approved by:	portmgr blanket
This commit is contained in:
Dmitry Marakasov
2020-08-04 16:00:43 +00:00
parent 36277f5f08
commit 80c9c3936b
2 changed files with 16 additions and 15 deletions

View File

@@ -39,6 +39,7 @@ OPTIONS_DEFINE= DOCS NLS EXAMPLES
USES+= gettext
PLIST_SUB+= NLS=""
.else
USES+= gettext-tools
PLIST_SUB+= NLS="@comment "
.endif
@@ -61,26 +62,26 @@ PLIST_SUB+= BABEL="@comment "
.endif
pre-configure:
${REINPLACE_CMD} -e 's|$$datadir/doc/$$PACKAGE/examples|${EXAMPLESDIR}|' \
@${REINPLACE_CMD} -e 's|$$datadir/doc/$$PACKAGE/examples|${EXAMPLESDIR}|' \
-e 's| CFLAGS="-O2"|#CFLAGS="-O2"|;s|Werror ansi pedantic-errors||' \
-e 's| FCFLAGS="-O2"|FCFLAGS=${FFLAGS}|;s|$${docdir}/examples|${EXAMPLESDIR}|' \
${WRKSRC}/${CONFIGURE_SCRIPT}
.if ! ${PORT_OPTIONS:MNLS}
${REINPLACE_CMD} -e 's| po ||' \
pre-configure-NLS-off:
@${REINPLACE_CMD} -e '/^ po /d' \
${WRKSRC}/Makefile.in
.endif
.if ! ${PORT_OPTIONS:MDOCS}
${REINPLACE_CMD} -e 's|Documentation||' \
pre-configure-DOCS-off:
@${REINPLACE_CMD} -e '/^ Documentation/d' \
${WRKSRC}/Makefile.in
.endif
.if ! ${PORT_OPTIONS:MEXAMPLES}
${REINPLACE_CMD} -e 's|pixmaps \\|pixmaps|;s|examples$$||' \
pre-configure-EXAMPLES-off:
@${REINPLACE_CMD} -e '/^ examples/d' \
${WRKSRC}/Makefile.in
${FIND} ${WRKSRC}/lib/plug-ins -name Makefile.in | ${XARGS} \
${REINPLACE_CMD} -e \
's|install-v_simexamplesDATA install-v_simpixmapsDATA|install-v_simpixmapsDATA|'
${REINPLACE_CMD} -e 's|: install-v_simexamplesDATA|:|' \
@${FIND} ${WRKSRC}/lib/plug-ins -name Makefile.in | ${XARGS} \
${REINPLACE_CMD} -e \
's|install-v_simexamplesDATA install-v_simpixmapsDATA|install-v_simpixmapsDATA|'
@${REINPLACE_CMD} -e 's|: install-v_simexamplesDATA|:|' \
${WRKSRC}/lib/python/Makefile.in
.endif
.include <bsd.port.mk>

View File

@@ -186,7 +186,7 @@ share/icons/hicolor/24x24/apps/v_sim.png
share/icons/hicolor/32x32/apps/v_sim.png
share/icons/hicolor/48x48/apps/v_sim.png
share/icons/hicolor/scalable/apps/v_sim.svg
share/locale/fr/LC_MESSAGES/v_sim.mo
%%NLS%%share/locale/fr/LC_MESSAGES/v_sim.mo
share/pixmaps/v_sim.xpm
%%DATADIR%%/pixmaps/axes-angles.png
%%DATADIR%%/pixmaps/axes-box.png