pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/54500: devel/lua-Bitop broken on macOS patch



>Number:         54500
>Category:       pkg
>Synopsis:       devel/lua-Bitop broken on macOS patch
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 29 05:40:00 +0000 2019
>Originator:     clement bouvier
>Release:        current
>Organization:
>Environment:
macOS mojave 10.14.6
>Description:
===> Building for lua52-BitOp-1.0.2nb1
/Applications/Xcode.app/Contents/Developer/usr/bin/gnumake all "SOCC=MACOSX_DEPLOYMENT_TARGET=10.4 gcc -dynamiclib -single_module -undefined dynamic_lookup"
gcc -fPIC -O2 -fomit-frame-pointer -Wall   -O2 -pipe -I/Users/cbouvier/pkg/include/lua-5.2 -c -o bit.o bit.c
MACOSX_DEPLOYMENT_TARGET=10.4 gcc -dynamiclib -single_module -undefined dynamic_lookup -fPIC -L/Users/cbouvier/pkg/lib -L/usr/lib -o bit.so bit.o
ld: library not found for -lgcc_s.10.4
>How-To-Repeat:
build the package
>Fix:
The target macosx provided claims MACOSX_DEPLOYMENT_TARGET=10.4 and uses gcc as compiler.
Recent version of macos cannot build the package, MACOSX_DEPLOYMENT_TARGET=10.4 is too old and native toolchain has moved to clang/LLVM.

The patch :
* Remove a make variable unused
* Use the common target to build under macosx (and remove the specific part in the pkg Makefile)
* Use libtool to build and link on the common target.

test Target are passed.

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/lua-BitOp/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- Makefile	16 Sep 2017 19:53:50 -0000	1.6
+++ Makefile	29 Aug 2019 05:36:06 -0000
@@ -14,17 +14,11 @@
 LUA_VERSIONS_INCOMPATIBLE=	53
 
 NO_CONFIGURE=	yes
+USE_LIBTOOL=	yes
 USE_TOOLS+=	gmake
 MAKE_FLAGS+=	LUA_CDIR=${LUA_CDIR}
 MAKE_FLAGS+=	LUA_DOCDIR=${LUA_DOCDIR}
 MAKE_FLAGS+=	_LUA_DOT_VERSION=${_LUA_DOT_VERSION}
-MAKE_FLAGS+=	INSTALLPATH=${DESTDIR}${PREFIX}/${LUA_CDIR}
-
-.include "../../mk/bsd.prefs.mk"
-
-.if ${OPSYS} == "Darwin"
-BUILD_TARGET=   macosx
-.endif
 
 INSTALLATION_DIRS+=	${LUA_CDIR} ${LUA_DOCDIR}
 
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/devel/lua-BitOp/PLIST,v
retrieving revision 1.1
diff -u -r1.1 PLIST
--- PLIST	3 May 2014 13:02:38 -0000	1.1
+++ PLIST	29 Aug 2019 05:36:06 -0000
@@ -1,5 +1,5 @@
 @comment $NetBSD: PLIST,v 1.1 2014/05/03 13:02:38 alnsn Exp $
-${LUA_CDIR}/bit.so
+${LUA_CDIR}/bit.la
 ${LUA_DOCDIR}/api.html
 ${LUA_DOCDIR}/bluequad-print.css
 ${LUA_DOCDIR}/bluequad.css
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/devel/lua-BitOp/distinfo,v
retrieving revision 1.4
diff -u -r1.4 distinfo
--- distinfo	20 Aug 2016 12:43:40 -0000	1.4
+++ distinfo	29 Aug 2019 05:36:06 -0000
@@ -4,4 +4,4 @@
 RMD160 (LuaBitOp-1.0.2.tar.gz) = 6b5a44515022ed1f4edb9d966b8ea3aa9c38a892
 SHA512 (LuaBitOp-1.0.2.tar.gz) = a652050ea5c6fbeb8a28b05e2bc4a3550c854cc45f7f42c8c1b0a81f5b76773cdf061e6a839cdb339614118169e578b6e3efa5a3efbe59a2f01874b2fa2b4f2e
 Size (LuaBitOp-1.0.2.tar.gz) = 23127 bytes
-SHA1 (patch-Makefile) = 5b484bdbaa2cc94b1b73177f3eeb0a686f7e897d
+SHA1 (patch-Makefile) = 662f40d7b09d1f47a1f5976ecebd4bad7e960009
Index: patches/patch-Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/lua-BitOp/patches/patch-Makefile,v
retrieving revision 1.3
diff -u -r1.3 patch-Makefile
--- patches/patch-Makefile	20 Aug 2016 12:43:40 -0000	1.3
+++ patches/patch-Makefile	29 Aug 2019 05:36:06 -0000
@@ -1,6 +1,7 @@
 $NetBSD: patch-Makefile,v 1.3 2016/08/20 12:43:40 alnsn Exp $
 
 Install tweaks.
+Use Libtool
 
 --- Makefile.orig	2012-05-08 19:15:00.000000000 +0000
 +++ Makefile
@@ -13,21 +14,32 @@
  
  DEFINES=
  # Use this for the old ARM ABI with swapped FPA doubles.
-@@ -11,7 +11,7 @@ DEFINES=
+@@ -11,9 +11,9 @@ DEFINES=
  #DEFINES= -DSWAPPED_DOUBLE
  
  # Lua executable name. Used to find the install path and for testing.
 -LUA= lua
 +LUA= lua${_LUA_DOT_VERSION}
  
- CC= gcc
+-CC= gcc
++#CC= gcc 
  CCOPT= -O2 -fomit-frame-pointer
-@@ -39,7 +39,8 @@ $(MODSO): $(MODNAME).o
- 	$(SOCC) $(SOLDFLAGS) -o $@ $<
+ CCWARN= -Wall
+ SOCC= $(CC) -shared
+@@ -33,13 +33,14 @@ macosx:
+ 	$(MAKE) all "SOCC=MACOSX_DEPLOYMENT_TARGET=10.4 $(CC) -dynamiclib -single_module -undefined dynamic_lookup"
+ 
+ $(MODNAME).o: $(MODNAME).c
+-	$(CC) $(SOCFLAGS) -c -o $@ $<
++	${LIBTOOL} --tag=CC --mode=compile $(CC) $(SOCFLAGS) -c -o ${@:.o=.lo} $<
+ 
+ $(MODSO): $(MODNAME).o
+-	$(SOCC) $(SOLDFLAGS) -o $@ $<
++	${LIBTOOL} --tag=CC --mode=link $(CC) $(SOLDFLAGS) -o ${@:.so=.la} ${<:.o=.lo} -rpath ${PREFIX}/${LUA_CDIR} -shared -module -avoid-version -export-dynamic
  
  install: $(MODSO)
 -	$(INSTALL) $< `$(INSTALLPATH) $(MODNAME)`
-+	${BSD_INSTALL_LIB} ${MODSO} ${DESTDIR}${PREFIX}/${LUA_CDIR}
++	${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} $(MODSO:.so=.la) ${DESTDIR}${PREFIX}/${LUA_CDIR}
 +	cp -r doc/* ${DESTDIR}${PREFIX}/${LUA_DOCDIR}
  
  test: $(MODSO)



Home | Main Index | Thread Index | Old Index