aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2013-03-18 11:40:04 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2013-03-18 11:40:04 +0000
commite7b0f977880ef8195d7b8ce851146f778c158ba1 (patch)
tree6b707abf8d8621e9bcb4f385129f5e95769e9154 /Mk
parent320c5b87e065a7e118c8bfd65faf7ccc7d3b8310 (diff)
downloadports-e7b0f977880ef8195d7b8ce851146f778c158ba1.tar.gz
ports-e7b0f977880ef8195d7b8ce851146f778c158ba1.zip
Fix a long standing bug of lib/charset.alias being overwritten, modified, and badly tracked by ports.
Make lib/charset.alias a file only provided by converters/libiconv Create a new USES: charsetfix, that will modify in post patch the Makefile.in to prevent a port from modifying/overwritting the charset.alias file during make install. Prevent devel/gettext from installing that files. Fix a couple of ports that actually touch charset.alias during the build phase. Based on a patch by ale (http://lists.freebsd.org/pipermail/freebsd-gnome/2012-October/027747.html) Approved by: kwm (gnome) Exp-run by: miwi
Notes
Notes: svn path=/head/; revision=314556
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/charsetfix.mk29
1 files changed, 29 insertions, 0 deletions
diff --git a/Mk/Uses/charsetfix.mk b/Mk/Uses/charsetfix.mk
new file mode 100644
index 000000000000..06aca3b1f394
--- /dev/null
+++ b/Mk/Uses/charsetfix.mk
@@ -0,0 +1,29 @@
+# $FreeBSD$
+#
+# Lookup in Makefile.in to prevent a package from installing/modifying charset.alias
+#
+# MAINTAINER: portmgr@FreeBSD.org
+#
+# Feature: charsetfix
+# Usage: USES=charsetfix
+# Valid ARGS: does not require args
+#
+#
+.if !defined(_INCLUDE_USES_CHARSETFIX_MK)
+_INCLUDE_USES_CHARSETFIX_MK= yes
+
+.if defined(charsetfix_ARGS)
+IGNORE= USES=charsetfix does not require args
+.endif
+
+CHARSETFIX_MAKEFILEIN?= Makefile.in
+
+post-patch: charsetfix-post-patch
+
+charsetfix-post-patch:
+ @${FIND} ${WRKSRC} -name "${CHARSETFIX_MAKEFILEIN}" -type f | ${XARGS} ${REINPLACE_CMD} \
+ -e 's|need_charset_alias=true|need_charset_alias=false|g ; \
+ s|test -f $$(charset_alias)|false|g ;\
+ s|test -f $$(DESTDIR)$$(libdir)/charset.alias|false|g'
+
+.endif