Bug 169369 - multimedia/libvpx fails to build on systems with non UTF-8 locale
multimedia/libvpx fails to build on systems with non UTF-8 locale
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Ashish SHUKLA
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-24 12:50 UTC by Pawel Pekala
Modified: 2013-10-25 08:20 UTC (History)
0 users

See Also:


Attachments
file.diff (497 bytes, patch)
2012-06-24 12:50 UTC, Pawel Pekala
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Pekala freebsd_committer 2012-06-24 12:50:05 UTC
Build fails due to tr(1) hackery in ${WRKSRC}/build/make/rtcd.sh file.
This is probably caused by feeding UTF-8 encoded strings to tr(1) while systems locale is not UTF-8 and outcome in ${WRKSRC}/vpx_rtcd.h is garbled to the compiler.

Error log:

cc  -O2 -pipe -fno-strict-aliasing -m32 -fomit-frame-pointer -O3 -fPIC -D_FORTIFY_SOURCE=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wdeclaration-after-statement -Wdisabled-optimization -Wpointer-arith -Wcast-qual -Wimplicit-function-declaration -Wuninitialized -Wunused-variable -Wno-unused-function -I. -I"/usr/ports/multimedia/libvpx/work/libvpx-v1.1.0" -c -o vp8/common/rtcd.c.o vp8/common/rtcd.c
In file included from vp8/common/rtcd.c:12:
./vpx_rtcd.h:1:14: warning: extra tokens at end of #ifndef directive
./vpx_rtcd.h:2:14: warning: missing whitespace after the macro name
cc  -O2 -pipe -fno-strict-aliasing -m32 -fomit-frame-pointer -O3 -fPIC -D_FORTIFY_SOURCE=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wdeclaration-after-statement -Wdisabled-optimization -Wpointer-arith -Wcast-qual -Wimplicit-function-declaration -Wuninitialized -Wunused-variable -Wno-unused-function -I. -I"/usr/ports/multimedia/libvpx/work/libvpx-v1.1.0" -c -o vp8/common/loopfilter.c.o vp8/common/loopfilter.c
In file included from vp8/common/rtcd.c:12:
./vpx_rtcd.h: In function 'vpx_rtcd':
./vpx_rtcd.h:559: error: 'HAS_MMY' undeclared (first use in this function)
./vpx_rtcd.h:559: error: (Each undeclared identifier is reported only once
./vpx_rtcd.h:559: error: for each function it appears in.)
gmake[1]: *** [vp8/common/rtcd.c.o] Błąd 1
gmake[1]: *** Oczekiwanie na niezakończone zadania....
In file included from vp8/common/loopfilter.c:13:
./vpx_rtcd.h:1:14: warning: extra tokens at end of #ifndef directive
./vpx_rtcd.h:2:14: warning: missing whitespace after the macro name
gmake: *** [.DEFAULT] Błąd 2
*** [do-build] Error code 1

Stop in /usr/ports/multimedia/libvpx.
[corn:ports/multimedia/libvpx]# echo $LANG
pl_PL.ISO8859-2

Port builds fine with LANG=pl_PL.UTF-8

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer 2012-06-24 12:50:16 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ashish

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter freebsd_committer 2012-09-27 19:51:30 UTC
Author: pawel
Date: Thu Sep 27 18:51:21 2012
New Revision: 304971
URL: http://svn.freebsd.org/changeset/ports/304971

Log:
  Fix build on systems with non UTF-8 locale
  
  PR:		ports/169369
  Submitted by:	myself
  Approved by:	maintainer timeout (3 months)

Added:
  head/multimedia/libvpx/files/patch-build_make_rtcd.sh   (contents, props changed)

Added: head/multimedia/libvpx/files/patch-build_make_rtcd.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/libvpx/files/patch-build_make_rtcd.sh	Thu Sep 27 18:51:21 2012	(r304971)
@@ -0,0 +1,9 @@
+--- build/make/rtcd.sh.orig	2012-06-24 13:12:00.000000000 +0200
++++ build/make/rtcd.sh	2012-06-24 13:13:01.000000000 +0200
+@@ -1,5 +1,6 @@
+ #!/bin/sh
+ self=$0
++LANG=C
+ 
+ usage() {
+   cat <<EOF >&2
\ No newline at end of file
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Pawel Pekala freebsd_committer 2012-09-27 19:51:56 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 4 dfilter freebsd_committer 2013-10-25 08:11:31 UTC
Author: ashish
Date: Fri Oct 25 07:11:22 2013
New Revision: 331559
URL: http://svnweb.freebsd.org/changeset/ports/331559

Log:
  - Add staging support
  - Fix ownership of installed files[0]
  - Fix building on systems with non UTF-8 locale[1]
  - Fix building on 10.x and later
  
  PR:		ports/182693[0], ports/169369[1]
  Submitted by:	Herbert J. Skuhra <h.skuhra@gmail.com> (via private mail)[1]

Added:
  head/multimedia/libvpx/files/patch-build_make_Makefile   (contents, props changed)
Deleted:
  head/multimedia/libvpx/files/patch-build_make_rtcd.sh
Modified:
  head/multimedia/libvpx/Makefile
  head/multimedia/libvpx/distinfo   (contents, props changed)
  head/multimedia/libvpx/files/patch-libs.mk   (contents, props changed)
  head/multimedia/libvpx/pkg-plist   (contents, props changed)

Modified: head/multimedia/libvpx/Makefile
==============================================================================
--- head/multimedia/libvpx/Makefile	Fri Oct 25 06:28:14 2013	(r331558)
+++ head/multimedia/libvpx/Makefile	Fri Oct 25 07:11:22 2013	(r331559)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	libvpx
-PORTVERSION=	1.1.0
+PORTVERSION=	1.2.0
 CATEGORIES=	multimedia
 MASTER_SITES=	GOOGLE_CODE
 DISTNAME=	${PORTNAME}-v${PORTVERSION}
@@ -10,6 +10,9 @@ DISTNAME=	${PORTNAME}-v${PORTVERSION}
 MAINTAINER=	ashish@FreeBSD.org
 COMMENT=	VP8 Codec SDK
 
+LICENSE=	BSD
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
 BUILD_DEPENDS=	bash:${PORTSDIR}/shells/bash \
 		yasm:${PORTSDIR}/devel/yasm
 
@@ -20,9 +23,6 @@ HAS_CONFIGURE=	yes
 USE_PERL5=	build
 USE_LDCONFIG=	yes
 
-LICENSE=	BSD
-LICENSE_FILE=	${WRKSRC}/LICENSE
-
 OPTIONS_DEFINE=	DEBUG POSTPROC RUNTIME THREADS SHARED
 OPTIONS_DEFAULT=	POSTPROC RUNTIME THREADS SHARED
 POSTPROC_DESC=	Enable postprocessing
@@ -31,11 +31,15 @@ SHARED_DESC=	Enable shared-library suppo
 
 ALL_TARGET=
 CONFIGURE_ARGS+=	--enable-pic --disable-install-srcs --enable-vp8 --disable-install-docs
-MAKE_ARGS+=	DIST_DIR=${PREFIX} verbose=yes
+MAKE_ARGS+=	DIST_DIR=${PREFIX} verbose=yes DESTDIR=${STAGEDIR}
+MAKE_ENV=	LC_ALL=C
 
-NO_STAGE=	yes
 .include <bsd.port.options.mk>
 
+.if ${OSVERSION} >= 1000000
+CONFIGURE_ARGS+=	--disable-unit-tests
+.endif
+
 .if ${PORT_OPTIONS:MDEBUG}
 CONFIGURE_ARGS+=	--enable-debug
 .endif
@@ -76,6 +80,8 @@ IGNORE=	no support for ${ARCH} the momen
 post-patch:
 	@${REINPLACE_CMD} 's|\(link_with_cc\)=gcc|\1=$${CC}|' \
 		${WRKSRC}/build/make/configure.sh
+	@${REINPLACE_CMD} -e 's|%%DESTDIR%%|${STAGEDIR}|g' \
+	       	${WRKSRC}/build/make/Makefile ${WRKSRC}/libs.mk
 	@${GREP} -Rl '^#!/bin/bash' ${WRKSRC} |${XARGS} ${REINPLACE_CMD} \
 		-e 's,#!/bin/bash,#!/usr/bin/env bash,g'
 	@${GREP} -Rl -- '-l\?pthread' ${WRKSRC} |${XARGS} ${REINPLACE_CMD} -E \

Modified: head/multimedia/libvpx/distinfo
==============================================================================
--- head/multimedia/libvpx/distinfo	Fri Oct 25 06:28:14 2013	(r331558)
+++ head/multimedia/libvpx/distinfo	Fri Oct 25 07:11:22 2013	(r331559)
@@ -1,2 +1,2 @@
-SHA256 (libvpx-v1.1.0.tar.bz2) = 9ce074cf4b3bcd9a49ff93e05485b71c273bfc3685a305e55a0e7fa51beb72c5
-SIZE (libvpx-v1.1.0.tar.bz2) = 1653485
+SHA256 (libvpx-v1.2.0.tar.bz2) = 5ef0c650b2daa62085eb8105a7a4273f3e987db53c5ec97fd51d1b6511e5aa06
+SIZE (libvpx-v1.2.0.tar.bz2) = 1714121

Added: head/multimedia/libvpx/files/patch-build_make_Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/libvpx/files/patch-build_make_Makefile	Fri Oct 25 07:11:22 2013	(r331559)
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- build/make/Makefile.orig
++++ build/make/Makefile
+@@ -230,8 +230,8 @@
+ define install_map_template
+ $(DIST_DIR)/$(1): $(2)
+ 	$(if $(quiet),@echo "    [INSTALL] $$@")
+-	$(qexec)mkdir -p $$(dir $$@)
+-	$(qexec)cp -p $$< $$@
++	$(qexec)install -d %%DESTDIR%%$$(dir $$@)
++	$(qexec)install -p $$< %%DESTDIR%%$$(dir $$@)
+ endef
+ 
+ define archive_template

Modified: head/multimedia/libvpx/files/patch-libs.mk
==============================================================================
--- head/multimedia/libvpx/files/patch-libs.mk	Fri Oct 25 06:28:14 2013	(r331558)
+++ head/multimedia/libvpx/files/patch-libs.mk	Fri Oct 25 07:11:22 2013	(r331559)
@@ -3,9 +3,18 @@ $FreeBSD$
 
 --- libs.mk.orig
 +++ libs.mk
-@@ -242,8 +242,8 @@
- 	$(qexec)echo 'Conflicts:' >> $@
+@@ -209,7 +209,7 @@
+     $(addprefix $(BUILD_PFX),$(notdir $(LIBVPX_SO_SYMLINKS))),\
+     $(BUILD_PFX)$(LIBVPX_SO)))
+ $(eval $(call libvpx_symlink_template,\
+-    $(addprefix $(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\
++    $(addprefix $(DESTDIR)/$(DIST_DIR)/,$(LIBVPX_SO_SYMLINKS)),\
+     $(DIST_DIR)/$(LIBSUBDIR)/$(LIBVPX_SO)))
+ 
+ INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBVPX_SO_SYMLINKS)
+@@ -232,8 +232,8 @@
  	$(qexec)echo 'Libs: -L$${libdir} -lvpx' >> $@
+ 	$(qexec)echo 'Libs.private: -lm -pthread' >> $@
  	$(qexec)echo 'Cflags: -I$${includedir}' >> $@
 -INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc
 -INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc

Modified: head/multimedia/libvpx/pkg-plist
==============================================================================
--- head/multimedia/libvpx/pkg-plist	Fri Oct 25 06:28:14 2013	(r331558)
+++ head/multimedia/libvpx/pkg-plist	Fri Oct 25 07:11:22 2013	(r331559)
@@ -15,6 +15,6 @@ lib/libvpx.a
 libdata/pkgconfig/vpx.pc
 %%SHARED%%lib/libvpx.so
 %%SHARED%%lib/libvpx.so.1
-%%SHARED%%lib/libvpx.so.1.1
-%%SHARED%%lib/libvpx.so.1.1.0
+%%SHARED%%lib/libvpx.so.1.2
+%%SHARED%%lib/libvpx.so.1.2.0
 @dirrm include/vpx
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"