On 2021/02/08 08:39, Kurt Mosiejczuk wrote: > Here's a new port for lwjgl3. It's a new port since there are existing > things that use the lwjgl 2.x version we already have. > > Upstream is not interested in supporting BSD and has expressed hope that > someone would fork the code for BSD support (so they don't have to deal > with it). So this is based upon my fork with OpenBSD support added. > (https://github.com/kmosiejczuk/lwjgl3) > > I added most of the code to support OpenBSD with some help from pamela > and phessler. octeep (https://github.com/octeep/lwjgl3) figured out the > last couple of bits that eluded me for so long. Thank you! > > The build will try and download needed things to build, including a specific > version of the kotlin compiler and some java libraries from maven. Thus the > tricks of adding them in. I just bundled the maven libraries and put the > distfile on a server of mine. > > phessler and pamela helped some with the port (blame the sins on me though) > and both helped test. > > This isn't especially pretty, but it works. The delay for the last couple > of weeks has been... testing... with current versions of Minecraft. ;) > > I figured I'd send this here for a little more review since I am pulling > some ugly tricks and there may be better ways to handle it. > > --Kurt >
; # $OpenBSD: Makefile,v 1.10 2019/09/23 15:17:35 kurt Exp $ ; ; COMMENT = lightweight game library for java ; ; V = 3.2.4alpha1 ; DISTNAME = lwjgl3-${V} ; ; KOTLIN_V = 1.3.61 ; ; .if ${MACHINE_ARCH} == "i386" ; M_ARCH = "" ; .elif ${MACHINE_ARCH} == "amd64" ; M_ARCH = 64 ; .endif ; ; LWJGL3_HOME = ${PREFIX}/share/lwjgl3 ; ; CATEGORIES = games devel ; ; HOMEPAGE = https://lwjgl.org ; ; MAINTAINER = Kurt Mosiejczuk <k...@openbsd.org> ; ; COMPILER = base-clang ports-gcc ; ; EXTRACT_ONLY = ${DISTNAME}.tar.gz ; ; # Build downloads kotlin compiler and libraries from maven if not available ; ; DISTFILES += ${DISTNAME}.tar.gz \ ; kotlin-compiler-1.3.61.zip:1 \ can use a version variable here ^^ ; lwjgl3-maven.tar.gz:2 might be better to add a version/date into that filename, as a clue to use a different name if/when it's updated ; MASTER_SITES = \ ; https://github.com/kmosiejczuk/lwjgl3/releases/download/3.2.4alpha1/ and here ^^ ; MASTER_SITES1 = \ ; https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_V}/ ; MASTER_SITES2 = https://filedump.se.rit.edu/pub/distfiles/ ; ; # BSD ; PERMIT_PACKAGE = Yes ; ; # GL listed here as it is dlopen()d by the lib ; WANTLIB += ${COMPILER_LIBCXX} GL X11 Xcursor Xext Xrandr Xxf86vm assimp \ ; glfw glib-2.0 gobject-2.0 gtk-3 lmdb lz4 m openal \ ; opus pthread xxhash ; ; MODULES = java ; MODJAVA_VER = 11 ; MODJAVA_BUILD = ant ; ; BUILD_DEPENDS = devel/bullet \ ; devel/dyncall ; LIB_DEPENDS = archivers/lz4 \ ; audio/openal \ ; audio/opus \ ; databases/lmdb \ ; graphics/glfw \ ; multimedia/assimp \ ; sysutils/xxhash \ ; x11/gtk+3 ; ; PORTHOME = ${WRKDIR} ; ; NO_TEST = Yes ; ; SUBST_VARS += M_ARCH ; ; pre-configure: ; perl -pi -e 's,/usr/X11R6,${X11BASE},g' \ ; ${WRKSRC}/build.xml ; perl -pi -e 's,/usr/local,${LOCALBASE},g' \ ; ${WRKSRC}/build.xml ; mkdir -p ${WRKSRC}/bin/libs ; touch ${WRKSRC}/bin/libs/touch.txt ; unzip -oq -d ${WRKSRC}/bin/libs/ \ ; ${FULLDISTDIR}/kotlin-compiler-${KOTLIN_V}.zip ; tar -C ${WRKSRC}/bin/libs -zxf ${FULLDISTDIR}/lwjgl3-maven.tar.gz i would prefer to do those unzip/tar in post-extract (doesn't matter hugely here i guess, but if it ever needs to be patched then it's in the right place) ; ; do-build: ; ${MODJAVA_BUILD_TARGET} ; cd ${MODJAVA_BUILD_DIR} && \ ; ${SETENV} ${MAKE_ENV} LWJGL_BUILD_OFFLINE=true \ ; JAVA8_HOME=${LOCALBASE}/jdk-11 ${LOCALBASE}/bin/ant \ ; -buildfile ${MODJAVA_BUILD_FILE} release ${MODJAVA_BUILD_ARGS} ; ; do-install: ; ${INSTALL_DATA_DIR} ${LWJGL3_HOME} ; rm ${WRKSRC}/bin/RELEASE/lwjgl*/lwjgl-*-sources.jar ; for x in ${WRKSRC}/bin/RELEASE/lwjgl*/*.jar; do \ ; ${INSTALL_DATA} $$x ${LWJGL3_HOME}/; \ ; done ; for x in ${WRKSRC}/bin/RELEASE/lwjgl*/*license.txt; do \ ; ${INSTALL_DATA} $$x ${LWJGL3_HOME}/; \ ; done ; ; .include <bsd.port.mk> i'll go with "that isn't terrible". ;) also "it's way better than the 'process' i have for rebuilding snappy-java".