lwjgl3-port/Makefile

88 lines
3.0 KiB
Makefile

# Created by: Mia <mia-rain@tuta.io>
PORTNAME= lwjgl3
DISTVERSION= 3.2.4.alpha2
CATEGORIES= games java
MASTER_SITES= https://github.com/JetBrains/kotlin/releases/download/v1.3.61/:compiler https://kurt.mosiejcz.uk/pub/distfiles/:maven
DISTFILES+= kotlin-compiler-1.3.61.zip:compiler lwjgl3-maven-20210208.tar.gz:maven
# these maven libaraies are pulled from openbsd; their original source is https://www.lwjgl.org/customize with mode:maven
# however 3.2.4* is an unoffical release and modifications may have been made to the maven libs
EXTRACT_ONLY= ${DISTNAME}.tar.gz
MAINTAINER= mia-rain@tuta.io
COMMENT= Lightweight Java Game Library v3
LICENSE= BSD3CLAUSE
BROKEN_i386= ld: error: undefined symbol: __stack_smash_handler # openbsd reports this error, however I am unable to test it
BROKEN_java11= java.nio.file.NoSuchFileException: bin/classes/lwjgl/core/module-info.class
# this error seems to come from freebsd as openbsd builds with java 11 fine
ONLY_FOR_ARCHS= amd64 powerpc64 powerpc64le
BUILD_DEPENDS= ant:devel/apache-ant \
unzip:archivers/unzip \
ant:devel/apache-ant \
${PREFIX}/libdata/pkgconfig/bullet.pc:devel/bullet \
${PREFIX}/include/dynload.h:devel/dyncall \
${PREFIX}/openjdk8/jre/lib/jce.jar:java/openjdk8 \
${PREFIX}/libdata/pkgconfig/liblz4.pc:archivers/liblz4
LIB_DEPENDS= libopenal.so:audio/openal-soft \
libopus.so:audio/opus \
liblmdb.so:databases/lmdb \
libglfw.so:graphics/glfw \
libassimp.so:multimedia/assimp \
libxxhash.so:devel/xxhash \
libgtk-3.so:x11-toolkits/gtk30
USES= dos2unix xorg
USE_GITHUB= yes
GH_ACCOUNT= kmosiejczuk
GH_TAGNAME= 3b9d8ce
GH_PROJECT= ${PORTNAME}
# there is a CRKatri fork directly for freebsd that kmosiejczuk's fork cherrypicked from
# future testing will be done with that fork to see if it fixes some issues
DOS2UNIX_REGEX= .*.[^jp][^an][^rg]$
USE_JAVA= yes
USE_ANT= yes
USE_XORG= xcursor xrandr xxf86vm
MAKE_ENV+= LWJGL_BUILD_OFFLINE=true JAVA8_HOME=${PREFIX}/openjdk8/
# openbsd has JAVA8_HOME=${JAVA_HOME}; but this fails as openjdk11/jre is missing
#
ALL_TARGET= compile-templates generate compile release
JAVA_VERSION=8
# upstream changes need to be merged to allow for 15+ compiliation
LWJGL3_HOME= ${JAVASHAREDIR}/lwjgl3
.include <bsd.port.pre.mk>
post-extract:
${MKDIR} ${WRKSRC}/bin/libs
${UNZIP_CMD} -oq -d ${WRKSRC}/bin/libs/ \
${DISTDIR}/kotlin-compiler-1.3.61.zip
${TAR} -C ${WRKSRC}/bin/libs -zxf \
${DISTDIR}/lwjgl3-maven-20210208.tar.gz
pre-configure:
${SED} -i -e 's,/usr/X11R6,${X11BASE},g' \
${WRKSRC}/build.xml
${SED} -i -e 's,/usr/local,${LOCALBASE},g' \
${WRKSRC}/build.xml
:> ${WRKSRC}/bin/libs/touch.txt
do-install:
${SETENV} ${MAKE_ENV} LWJGL_BUILD_OFFLINE=true
${RM} ${WRKSRC}/bin/RELEASE/lwjgl*/lwjgl-*-sources.jar
${MKDIR} ${STAGEDIR}/${LWJGL3_HOME}
for x in ${WRKSRC}/bin/RELEASE/lwjgl*/*.jar; do \
${INSTALL_DATA} $$x ${STAGEDIR}/${LWJGL3_HOME}/; \
done
for x in ${WRKSRC}/bin/RELEASE/lwjgl*/*license.txt; do \
${INSTALL_DATA} $$x ${STAGEDIR}/${LWJGL3_HOME}/; \
done
.include <bsd.port.post.mk>