aboutsummaryrefslogtreecommitdiffstats
path: root/java/openjfx8-devel/Makefile
blob: c99297f0a87344b54d68be8b119d5bc0d7e33dae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Created by: Tobias Kortkamp <t@tobik.me>
# $FreeBSD$

PORTNAME=   openjfx8
DISTVERSION=    8u172-b03
PORTEPOCH=  1
CATEGORIES= java x11-toolkits devel
MASTER_SITES=   https://github.com/t6/openjfx/releases/download/release/ \
        http://hg.openjdk.java.net/openjfx/8u/rt/archive/${DISTVERSION}${EXTRACT_SUFX}?dummy=/
PKGNAMESUFFIX=  -devel

MAINTAINER= tobik@FreeBSD.org
COMMENT=    JavaFX SDK overlay for OpenJDK 8

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKSRC}/LICENSE

ONLY_FOR_ARCHS= amd64 i386

BUILD_DEPENDS=  apache-ant>0:devel/apache-ant \
        antlr3>0:devel/antlr3 \
        gradle>=4.0:devel/gradle \
        ${JAVALIBDIR}/junit.jar:java/junit
LIB_DEPENDS=    libfontconfig.so:x11-fonts/fontconfig \
        libfreetype.so:print/freetype2

USES=       gettext-runtime jpeg pkgconfig sqlite
USE_GL=     gl
USE_GNOME=  atk cairo gdkpixbuf2 glib20 gtk20 pango
USE_JAVA=   yes
JAVA_VERSION=   1.8
USE_LDCONFIG=   yes
USE_XORG=   x11 xtst xxf86vm

OPTIONS_DEFINE= MEDIA SWT TEST WEBKIT
OPTIONS_DEFAULT=    MEDIA WEBKIT
OPTIONS_SUB=    yes

MEDIA_DESC= Media module
SWT_DESC=   SWT support

MEDIA_LIB_DEPENDS=  libavcodec.so:multimedia/ffmpeg \
            libsndio.so:audio/sndio
MEDIA_USES= gmake
MEDIA_VARS= COMPILE_MEDIA=true

SWT_BUILD_DEPENDS=  swt-devel>0:x11-toolkits/swt-devel
SWT_RUN_DEPENDS=    swt-devel>0:x11-toolkits/swt-devel
SWT_VARS=   COMPILE_SWT=true

TEST_USES=  display:test
TEST_VARS=  AWT_TEST=true FULL_TEST=true

# Gradle calls CMake during the build
WEBKIT_BUILD_DEPENDS=   cmake:devel/cmake
WEBKIT_IMPLIES= MEDIA
WEBKIT_LIB_DEPENDS= libicui18n.so:devel/icu
WEBKIT_USES=    bison compiler:c++14-lang gmake gperf perl5 python:2.7,build
WEBKIT_USE= GNOME=libxslt,libxml2 \
        PERL5=build \
        RUBY=yes \
        XORG=xcomposite,xdamage,xfixes,xrender,xt
WEBKIT_VARS=    RUBY_NO_RUN_DEPENDS=yes COMPILE_WEBKIT=true

# Move Gradle's home below ${WRKDIR} instead of using ${HOME}/.gradle
GRADLE_ENV= GRADLE_USER_HOME=${WRKDIR}/gradle-home \
        CC=${CC} CXX=${CXX}
GRADLE_RUN= ${SETENV} ${GRADLE_ENV} gradle --no-daemon

PLIST_SUB=  ARCH=${ARCH} \
        JAVA_HOME=${JAVA_HOME}
WRKSRC=     ${WRKDIR}/rt-${DISTVERSION}

# NOTE: This port won't build if ${JAVA_HOME}/jre/lib/ext/jfxrt.jar
# already exists on your system.  This is not a problem in Poudriere
# or Synth but something to be aware of if you're trying to build this
# port in a non-pristine environment.

# The BSD Makefiles for GStreamer-lite and Jfxmedia are based on the
# Linux versions.  Prepare the tree, so that we only see the changes
# from Linux's Makefile in our own patches.
pre-patch:
    @${CP} -r ${WRKSRC}/modules/media/src/main/native/jfxmedia/projects/linux \
        ${WRKSRC}/modules/media/src/main/native/jfxmedia/projects/bsd
    @${CP} -r ${WRKSRC}/modules/media/src/main/native/gstreamer/projects/linux \
        ${WRKSRC}/modules/media/src/main/native/gstreamer/projects/bsd

post-patch:
    @${CP} ${FILESDIR}/bsd.gradle ${WRKSRC}/buildSrc
# Add a *BSD native audio sink to GStreamer-lite instead of using the
# bundled ALSA sink.  Currently we add an sndio sink, but this is an extension
# point for eventually adding an OSS backend (or others) as an option as well.
# If you add a new one make sure it registers itself as "bsdaudiosink" as defined
# in modules/media/src/main/native/jfxmedia/platform/gstreamer/GstPipelineFactory.cpp
    @${MKDIR} ${WRKSRC}/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio
    @${CP} ${FILESDIR}/gstsndio.c ${FILESDIR}/sndiosink.c ${FILESDIR}/sndiosink.h \
        ${WRKSRC}/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio
    @cd ${WRKSRC}/modules/media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-base/ext/bsdaudio && \
        ${LN} -s gstsndio.c gstbsdaudio.c && \
        ${LN} -s sndiosink.c bsdaudiosink.c
# Pull Java dependencies from LOCALBASE
    @${REINPLACE_CMD} 's@/usr/local@${LOCALBASE}@g' \
        ${WRKSRC}/build.gradle ${WRKSRC}/buildSrc/build.gradle
# Remove the bundled libicu and libsqlite3.  We use the system's
# versions instead.
    @${RM} -r ${WRKSRC}/modules/web/src/main/native/Source/ThirdParty/icu \
        ${WRKSRC}/modules/web/src/main/native/Source/ThirdParty/sqlite

post-patch-SWT-off:
    @${RM} -r ${WRKSRC}/modules/graphics/src/main/java/com/sun/glass/ui/swt

do-configure:
    @${MKDIR} ${WRKDIR}/gradle-home
    @${ECHO_CMD} "NUM_COMPILE_THREADS = ${MAKE_JOBS_NUMBER}" > ${WRKSRC}/gradle.properties
.for prop in COMPILE_MEDIA COMPILE_WEBKIT AWT_TEST FULL_TEST
    @${ECHO_CMD} "${prop} = ${${prop}:Ufalse}" >> ${WRKSRC}/gradle.properties
.endfor
    @${ECHO_CMD} "BSD.compileSWT = ${COMPILE_SWT:Ufalse};" >> ${WRKSRC}/buildSrc/bsd.gradle

do-build:
    @cd ${WRKSRC} && ${GRADLE_RUN} zips

do-install:
    @${MKDIR} ${STAGEDIR}${JAVA_HOME}
    @${TAR} -C ${STAGEDIR}${JAVA_HOME} \
        -xf ${WRKSRC}/build/bundles/javafx-sdk-overlay.zip
    @${FIND} ${STAGEDIR}${JAVA_HOME}/jre -name '*.so' -exec ${STRIP_CMD} \{\} \;

do-test-TEST-on:
    @cd ${WRKSRC} && ${GRADLE_RUN} check test

.include <bsd.port.mk>