Hello, The diff below adds sparc64 support to www/luakit. Probably also to other archs.
Changes: * Use luajit only for archs that support it * Switch to -fPIC for all archs (fixes sparc64 and doesn't hurt others) I also cleaned up the Makefile to match the template and aligned the tabs. port-lib-depends-check on sparc64 reports: LIB_DEPENDS STEM->=8,<9:lang/gcc/8,-libs not needed for lang/python/3.8,-main ? luakit-2.3p0v1(www/luakit): Extra: estdc++.19 I don't know how to fix it, because the libs are not referenced in the Makefile. I assume "COMPILER = base-clang ports-gcc" pulls them in on gcc archs. Hints on how to fix it are welcome. Tested on amd64 and sparc64. Note: Two tests fail on the test target. This is not new and manually testing undoclose works. Best Regards, Stefan Index: Makefile =================================================================== RCS file: /cvs/ports/www/luakit/Makefile,v retrieving revision 1.29 diff -u -p -u -p -r1.29 Makefile --- Makefile 21 Mar 2021 14:16:21 -0000 1.29 +++ Makefile 17 Jul 2021 10:03:41 -0000 @@ -6,28 +6,49 @@ GH_ACCOUNT = luakit GH_PROJECT = luakit GH_TAGNAME = 2.3 +REVISION = 0 EPOCH = 1 CATEGORIES = www -MAINTAINER = Stefan Hagen <sh+po...@codevoid.de> - HOMEPAGE = https://luakit.github.io +MAINTAINER = Stefan Hagen <sh+po...@codevoid.de> + # GPLv3 PERMIT_PACKAGE = Yes -USE_GMAKE = Yes - COMPILER = base-clang ports-gcc -WANTLIB += atk-1.0 c cairo cairo-gobject gdk-3 gdk_pixbuf-2.0 -WANTLIB += gio-2.0 glib-2.0 gobject-2.0 gthread-2.0 gtk-3 harfbuzz -WANTLIB += intl javascriptcoregtk-4.0 luajit-5.1 pango-1.0 -WANTLIB += pangocairo-1.0 pthread soup-2.4 sqlite3 webkit2gtk-4.0 - MODULES = lang/lua +# archs supported by lang/luajit +.if ${MACHINE_ARCH} == "arm" \ + || ${MACHINE_ARCH} == "amd64" \ + || ${MACHINE_ARCH} == "i386" \ + || ${MACHINE_ARCH} == "powerpc" +HAS_LUAJIT = 1 +.else +HAS_LUAJIT = 0 +.endif + +MODLUA_VERSION= 5.1 + +WANTLIB += atk-1.0 c cairo cairo-gobject gdk-3 gdk_pixbuf-2.0 +WANTLIB += gio-2.0 glib-2.0 gobject-2.0 gthread-2.0 gtk-3 harfbuzz +WANTLIB += intl javascriptcoregtk-4.0 pango-1.0 pangocairo-1.0 +WANTLIB += pthread soup-2.4 sqlite3 webkit2gtk-4.0 + +.if ${MACHINE_ARCH} == "sparc64" +WANTLIB += m +.endif + +.if ${HAS_LUAJIT} +WANTLIB += luajit-5.1 +.else +WANTLIB += ${MODLUA_WANTLIB} +.endif + BUILD_DEPENDS = devel/help2man \ devel/luafs @@ -36,18 +57,21 @@ RUN_DEPENDS = devel/desktop-file-utils \ net/luasocket \ textproc/lua-markdown -LIB_DEPENDS = lang/luajit \ - www/webkitgtk4 - -TEST_DEPENDS = devel/luassert \ - devel/luacheck - -TEST_TARGET = run-tests - # webkit browsing RUN_DEPENDS += multimedia/gstreamer1/plugins-good \ multimedia/gstreamer1/plugins-libav +LIB_DEPENDS = www/webkitgtk4 + +.if ${HAS_LUAJIT} +LIB_DEPENDS += lang/luajit +.else +LIB_DEPENDS += ${MODLUA_LIB_DEPENDS} +.endif + +TEST_DEPENDS = devel/luassert \ + devel/luacheck + MAKE_FLAGS += LUA_BIN_NAME=${MODLUA_BIN} \ XDGPREFIX=${PREFIX}/share/examples \ DOCDIR=${PREFIX}/share/doc/luakit \ @@ -55,6 +79,11 @@ MAKE_FLAGS += LUA_BIN_NAME=${MODLUA_BIN} PIXMAPDIR=${PREFIX}/share/pixmaps/ \ APPDIR=${PREFIX}/share/applications/ \ PREFIX=${PREFIX} \ + USE_LUAJIT=${HAS_LUAJIT} \ DEVELOPMENT_PATHS=0 + +USE_GMAKE = Yes + +TEST_TARGET = run-tests .include <bsd.port.mk> Index: patches/patch-Makefile =================================================================== RCS file: /cvs/ports/www/luakit/patches/patch-Makefile,v retrieving revision 1.4 diff -u -p -u -p -r1.4 patch-Makefile --- patches/patch-Makefile 9 Feb 2019 17:55:27 -0000 1.4 +++ patches/patch-Makefile 17 Jul 2021 10:03:41 -0000 @@ -1,4 +1,7 @@ $OpenBSD: patch-Makefile,v 1.4 2019/02/09 17:55:27 abieber Exp $ + +Fix manpage location and switch to -fPIC for sparc64 + Index: Makefile --- Makefile.orig +++ Makefile @@ -12,8 +15,9 @@ Index: Makefile $(EXT_OBJS) : %.o : %.c - @echo $(CC) -c $< -o $@ -+ @echo $(CC) -c $(CFLAGS) -DLUAKIT_WEB_EXTENSION -fpic $(CPPFLAGS) $< -o $@ - @$(CC) -c $(CFLAGS) -DLUAKIT_WEB_EXTENSION -fpic $(CPPFLAGS) $< -o $@ +- @$(CC) -c $(CFLAGS) -DLUAKIT_WEB_EXTENSION -fpic $(CPPFLAGS) $< -o $@ ++ @echo $(CC) -c $(CFLAGS) -DLUAKIT_WEB_EXTENSION -fPIC $(CPPFLAGS) $< -o $@ ++ @$(CC) -c $(CFLAGS) -DLUAKIT_WEB_EXTENSION -fPIC $(CPPFLAGS) $< -o $@ widgets/webview.o: $(wildcard widgets/webview/*.c) @@ -37,3 +41,12 @@ Index: Makefile mkdir -p resources find resources -type d -exec install -d $(DESTDIR)$(PREFIX)/share/luakit/'{}' \; find resources -type f -exec sh -c 'f="{}"; install -m644 "$$f" "$(DESTDIR)$(PREFIX)/share/luakit/$$(dirname $$f)"' \; +@@ -126,7 +126,7 @@ uninstall: + rm -rf $(DESTDIR)$(APPDIR)/luakit.desktop $(DESTDIR)$(PIXMAPDIR)/luakit.png + + tests/util.so: tests/util.c Makefile +- $(CC) -fpic $(CFLAGS) $(CPPFLAGS) -shared $< $(LDFLAGS) -o $@ ++ $(CC) -fPIC $(CFLAGS) $(CPPFLAGS) -shared $< $(LDFLAGS) -o $@ + + run-tests: luakit luakit.so tests/util.so + @$(LUA_BIN_NAME) tests/run_test.lua