Bug 185899 - [PATCH] Fix building of textproc/luaexpat
Summary: [PATCH] Fix building of textproc/luaexpat
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: David Thiel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-20 00:20 UTC by Ashish SHUKLA
Modified: 2014-01-28 20:20 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (1.70 KB, patch)
2014-01-20 00:20 UTC, Ashish SHUKLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ashish SHUKLA freebsd_committer freebsd_triage 2014-01-20 00:20:00 UTC
Building textproc/luaexpat fails with following error:

λ make
===>   lua51-luaexpat-1.2.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by lua51-luaexpat-1.2.0 for building
===>  Extracting for lua51-luaexpat-1.2.0
=> SHA256 Checksum OK for luaexpat-1.2.0.tar.gz.
===>  Patching for lua51-luaexpat-1.2.0
===>  Applying FreeBSD patches for lua51-luaexpat-1.2.0
===>   lua51-luaexpat-1.2.0 depends on shared library: expat.6 - found
===>   lua51-luaexpat-1.2.0 depends on shared library: lua-5.1.1 - found
===>  Configuring for lua51-luaexpat-1.2.0
===>  Building for lua51-luaexpat-1.2.0
clang -O2 -g -march=corei7 -Wall -pedantic  -Waggregate-return  -Wcast-align  -Wmissing-prototypes  -Wstrict-prototypes  -Wnested-externs  -Wpointer-arith  -Wshadow  -Wwrite-strings -ansi -O2 -I/usr/local/include/lua51  -I/usr/local/lib/lua/5.1 -I/usr/local/include -c src/lxplib.c
export MACOSX_DEPLOYMENT_TARGET="10.3"; clang -o src/lxp.so.1.2.0 -L/usr/local/lib -shared lxplib.o  -lexpat
/usr/bin/ld: lxplib.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
lxplib.o: could not read symbols: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
*** [src/lxp.so.1.2.0] Error code 1
1 error
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** [do-build] Error code 1

Stop in /home/abbe/ports/textproc/luaexpat.
λ make -V CFLAGS
-O2 -g -march=corei7 -fPIC -fstack-protector -fno-strict-aliasing


The attached diff not only fixes the above mentioned issue, but also STAGEifies the port.

Thanks!

Maintainer is CC'ed.

How-To-Repeat: λ sudo make -C /usr/ports/textproc/luaexpat build
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-01-20 00:20:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->lx

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-01-28 20:16:10 UTC
Author: lx
Date: Tue Jan 28 20:16:01 2014
New Revision: 341652
URL: http://svnweb.freebsd.org/changeset/ports/341652
QAT: https://qat.redports.org/buildarchive/r341652/

Log:
  Fix build and STAGEify.
  
  PR:		ports/185899
  Submitted by:	ashish@

Modified:
  head/textproc/luaexpat/Makefile
  head/textproc/luaexpat/files/patch-makefile

Modified: head/textproc/luaexpat/Makefile
==============================================================================
--- head/textproc/luaexpat/Makefile	Tue Jan 28 20:05:49 2014	(r341651)
+++ head/textproc/luaexpat/Makefile	Tue Jan 28 20:16:01 2014	(r341652)
@@ -13,6 +13,7 @@ COMMENT=	LuaExpat is a SAX XML parser ba
 
 LIB_DEPENDS=	expat.6:${PORTSDIR}/textproc/expat2
 
+USES=		gmake
 MAKEFILE=	makefile
 ALL_TARGET=	lib
 USE_LUA=	5.0-5.1
@@ -21,7 +22,6 @@ WANT_LUA_VER=	5.1
 
 CFLAGS+=	-fPIC
 
-NO_STAGE=	yes
 .include <bsd.port.pre.mk>
 
 .if ${LUA_VER} == 5.0

Modified: head/textproc/luaexpat/files/patch-makefile
==============================================================================
--- head/textproc/luaexpat/files/patch-makefile	Tue Jan 28 20:05:49 2014	(r341651)
+++ head/textproc/luaexpat/files/patch-makefile	Tue Jan 28 20:16:01 2014	(r341652)
@@ -1,6 +1,9 @@
---- makefile.orig	2009-06-25 06:07:16.000000000 +0000
-+++ makefile	2009-06-25 06:23:06.000000000 +0000
-@@ -4,15 +4,11 @@
+
+$FreeBSD$
+
+--- makefile.orig
++++ makefile
+@@ -4,10 +4,6 @@
  
  include $(CONFIG)
  
@@ -11,9 +14,20 @@
  OBJS= src/lxplib.o $(COMPAT_O)
  lib: src/$(LIBNAME)
  
- src/$(LIBNAME) : $(OBJS)
--	export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) -o src/$(LIBNAME) $(LIB_OPTION) $(OBJS) -lexpat
-+	export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) -o src/$(LIBNAME) $(LIB_OPTION) lxplib.o $(COMPAT_O) -lexpat
- 
- $(COMPAT_DIR)/compat-5.1.o: $(COMPAT_DIR)/compat-5.1.c
+@@ -18,11 +14,11 @@
  	$(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c
+ 
+ install:
+-	mkdir -p $(LUA_LIBDIR)
+-	cp src/$(LIBNAME) $(LUA_LIBDIR)
+-	cd $(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so
+-	mkdir -p $(LUA_DIR)/$T
+-	cp src/$T/lom.lua $(LUA_DIR)/$T
++	mkdir -p $(DESTDIR)$(LUA_LIBDIR)
++	cp src/$(LIBNAME) $(DESTDIR)$(LUA_LIBDIR)
++	cd $(DESTDIR)$(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so
++	mkdir -p $(DESTDIR)$(LUA_DIR)/$T
++	cp src/$T/lom.lua $(DESTDIR)$(LUA_DIR)/$T
+ 
+ clean:
+ 	rm -f src/$(LIBNAME) $(OBJS)
_______________________________________________
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 David Thiel freebsd_committer freebsd_triage 2014-01-28 20:16:15 UTC
State Changed
From-To: open->closed

Committed, thanks!