From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19099 invoked by alias); 16 Dec 2019 23:49:14 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 19069 invoked by uid 89); 16 Dec 2019 23:49:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=H*RU:209.85.221.65, HX-Spam-Relays-External:209.85.221.65 X-HELO: mail-wr1-f65.google.com Received: from mail-wr1-f65.google.com (HELO mail-wr1-f65.google.com) (209.85.221.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Dec 2019 23:49:10 +0000 Received: by mail-wr1-f65.google.com with SMTP id y11so9338864wrt.6 for ; Mon, 16 Dec 2019 15:49:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:references:from:autocrypt:organization :message-id:disposition-notification-to:date:user-agent:mime-version :in-reply-to:content-language; bh=rnletV3uMwkOdQBeaBsIOcJS8Sgx0zwzs8DF5Ayq8ZA=; b=M8w4i7iX2/W6HqFeu94xrP9Ygk9xOg0e2eZO7kVzu1Xu1+/4tEYjzNsQQpE/zhioqE us/zcP2fF1vI7nqFptMWaDLJw7Z/P/GgRhsmTpbdaBEYMeluM63bgUULXxg5AqJSGbqA Fee2CFxgjEhBxcRIHXXBi/TUYH3t1pPm05a/Y4bn+IgTigglEYWbsateow0m9L3cxtHX 0BJIb/4Pd+TwrSuE0d9DOZvgkmwBzFiiL1y+PvOhhBfNKAArx7AvgokyPMV+BhlfDvn/ WwxpB1y9BuR1OqjbnVR9Hn3yxMc8cV+0IdighckFYOTiMVjuFrM4Of7DrpBBDhZGcAlt w2ow== Return-Path: Received: from [192.168.1.46] (182.14.119.78.rev.sfr.net. [78.119.14.182]) by smtp.gmail.com with ESMTPSA id u22sm24490005wru.30.2019.12.16.15.49.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Dec 2019 15:49:07 -0800 (PST) Reply-To: ian@sibian.fr Subject: Re: building for jdk / openfx 13 (patch) To: kawa@sourceware.org, Michael Zucchi References: <55c6385c-84ae-439d-0336-abc41085ac82@gmail.com> From: ian Message-ID: <5c6856bd-fdec-8908-902a-4276231eaa18@gmail.com> Date: Mon, 16 Dec 2019 23:49:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <55c6385c-84ae-439d-0336-abc41085ac82@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-q4/txt/msg00012.txt.bz2 Neat, But just to say, openjdk is Oracle's too.... 'Night. ian Le 17/12/2019 à 00:43, Michael Zucchi a écrit : > > Morning, > > Apologies if this should go to the bug tracker, I didn't see any > specific details for patch submission. > > I wanted to have a look at kawa including the javafx parts but I > didn't want to install the oracle jdk as i've moved everything i do to > openjdk.  So I've created a small patch that allows compilation with > openjdk13 and openjfx13 (although it should work with 11+). It is > enabled by adding --with-javafx-sdk=path to configure: > > ./configure --with-javafx-sdk= > > Because of the removal of the java ee modules from java se, 'make > check' fails as java.xml.* has been removed.  But passing > --disable-xml to configure (which i only guess as to be related) > breaks the build in more ways. > > I modified bin/kawa.sh.in to load the javafx modules this option is > used to configure (or if JAVAFX_HOME is set) so the hello example > still works.  I didn't look at build.xml or kawa.bat. > > I guess ideally it should create a modular jar that publishes it's > dependencies particularly if other modular components are included in > the future.  Because javafx.web is very large it may make sense to be > able to exclude it as a build option, but I included it by default. > > Cheers, >  Michael > > > > --- >  ChangeLog                   |  8 ++++++++ >  Make-rules                  |  2 +- >  Makefile.am                 |  5 ++++- >  bin/ChangeLog               |  6 ++++++ >  bin/kawa.sh.in              |  7 +++++-- >  configure.ac                |  7 +++++++ >  doc/ChangeLog               |  5 +++++ >  doc/kawa.texi               | 24 ++++++++++++++++++++++++ >  gnu/kawa/javafx/ChangeLog   |  5 +++++ >  gnu/kawa/javafx/Makefile.am |  4 ++++ >  10 files changed, 69 insertions(+), 4 deletions(-) > > diff --git a/ChangeLog b/ChangeLog > index fb974c2df..9f505d845 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,11 @@ > +2019-12-16  Michael Zucchi  > + > +    * Make-rules (KAWA_COMPILER): Add KAWA_COMPILER_JAVA_FLAGS for jvm > +    flags for compiler. > +    * Makefile.am: Enable JAVAFX_SUBDIRS if --with=javafx-sdk used. > +    * configure.ac: Add support for --with-javafx-sdk=path for modular > +    javafx sdk. > + >  2019-08-06  Per Bothner  > >      * conigure.ac: Change missing Posix find from error to warning. > diff --git a/Make-rules b/Make-rules > index d08811bed..4793d479f 100644 > --- a/Make-rules > +++ b/Make-rules > @@ -15,7 +15,7 @@ java-classes.stamp: $(java_Java) >      echo timestamp > java-classes.stamp >      echo timestamp > $(TO_TOPDIR)/kawa-jar.stamp > > -KAWA_COMPILER = $(JAVA) -classpath "$(CLASSPATH)" kawa.repl -d > $(top_builddir) \ > +KAWA_COMPILER = $(JAVA) -classpath "$(CLASSPATH)" > $(KAWA_COMPILER_JAVA_FLAGS) kawa.repl -d $(top_builddir) \ >    -P `echo $(PACKAGE_FNAME)|sed -e s/-/./g`. > >  scm-classes.stamp: $(java_SCM) > diff --git a/Makefile.am b/Makefile.am > index 859d23c72..e27b38929 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -33,6 +33,9 @@ endif >  if WITH_JAVAFX >  SUBDIRS += $(JAVAFX_SUBDIRS) >  endif > +if WITH_JAVAFX_SDK > +SUBDIRS += $(JAVAFX_SUBDIRS) > +endif > >  DIST_SUBDIRS = $(FIXED_SUBDIRS) \ >    $(ANDROID_SUBDIRS) \ > @@ -120,7 +123,7 @@ dist-kawa.jar: dist >        && ./kawa-$(VERSION)/configure > --with-java-source=$(DEFAULT_JAVA_VERSION) \ >          --with-domterm="@WITH_DOMTERM_ARG@" \ >          --with-jline$(JLINE_VERSION_MAJOR)="@WITH_JLINE_PATH@" \ > -        --with-servlet=@WITH_SERVLET_ARG@ > --with-javafx=@WITH_JAVAFX_ARG@ \ > +        --with-servlet=@WITH_SERVLET_ARG@ > --with-javafx=@WITH_JAVAFX_ARG@ --with-javafx-sdk=@WITH_JAVAFX_SDK_ARG@ \ >        && CLASSPATH=@conf_classpath@.$(CLASSPATH_SEPARATOR)$$CLASSPATH > $(MAKE) all JAVAC="$(JAVAC) -source $(DEFAULT_JAVA_VERSION) -target > $(DEFAULT_JAVA_VERSION)" \ >        && mv lib/kawa.jar ../dist-kawa.jar \ >        && cd .. && rm -rf tmpdir > diff --git a/bin/ChangeLog b/bin/ChangeLog > index 7263f0543..f8cea7ad8 100644 > --- a/bin/ChangeLog > +++ b/bin/ChangeLog > @@ -1,3 +1,9 @@ > +2019-12-16  Michael Zucchi  > + > +    * kawa.sh.in (JAVAFX_HOME, JVM_FLAGS): If JAVAFX_HOME is defined > +    or configure was compiled using --with-javafx-sdk then add javafx > +    modules to module path. > + >  2017-05-03  Per Bothner  > >      * kawa.sh.in:  Avoid needless bash-specific 'type' command. > diff --git a/bin/kawa.sh.in b/bin/kawa.sh.in > index 296ce731f..4252bc026 100644 > --- a/bin/kawa.sh.in > +++ b/bin/kawa.sh.in > @@ -34,6 +34,9 @@ else >      JAVA=${JAVA-java} >  fi > > +JAVAFX_HOME=${JAVAFX_HOME:=@WITH_JAVAFX_SDK_ARG@} > +JVM_FLAGS=${JAVAFX_HOME:+"--module-path=${JAVAFX_HOME}/lib" > --add-modules=javafx.web} > + >  # This ugly duplication is so we only have to use arrays and substrings >  # (which are non-Posix and non-portable) if there is a -D or -J option. >  case "$1" in > @@ -53,9 +56,9 @@ case "$1" in >                  ;; >              esac >          done > -        exec ${JAVA} -Dkawa.command.line="${command_line}" > -Dkawa.command.pid="$$" -Dkawa.home="${kawadir}" "${jvm_args[@]}" > kawa.repl ${no_console} "$@" > +        exec ${JAVA} ${JVM_FLAGS} > -Dkawa.command.line="${command_line}" -Dkawa.command.pid="$$" > -Dkawa.home="${kawadir}" "${jvm_args[@]}" kawa.repl ${no_console} "$@" >          ;; >      *) > -        exec ${JAVA} -Dkawa.command.line="${command_line}" > -Dkawa.command.pid="$$" -Dkawa.home="${kawadir}" kawa.repl > ${no_console} "$@" > +        exec ${JAVA} ${JVM_FLAGS} > -Dkawa.command.line="${command_line}" -Dkawa.command.pid="$$" > -Dkawa.home="${kawadir}" kawa.repl ${no_console} "$@" >          ;; >  esac > diff --git a/configure.ac b/configure.ac > index bd1f8cd37..8e9eb2e53 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -31,6 +31,10 @@ AC_ARG_WITH(javafx, >    AS_HELP_STRING(--with-javafx@<:@=jfxrt.jar@:>@,Enable support for > JavaFX)) >  WITH_JAVAFX_ARG="${with_javafx}" > > +AC_ARG_WITH(javafx-sdk, > +  AS_HELP_STRING(--with-javafx-sdk=path,Enable support for JavaFX SDK > Modules)) > +WITH_JAVAFX_SDK_ARG="${with_javafx_sdk}" > + >  AC_ARG_WITH(lsp4j, >    AS_HELP_STRING(--with-lsp4j=<:@=lsp4j.jar@>)) >  AC_ARG_WITH(lsp4j.jsonrpc, > @@ -196,6 +200,8 @@ AM_CONDITIONAL(WITH_DOMTERM, >    test "$with_domterm" != "" -a "$with_domterm" != "no") >  AM_CONDITIONAL(WITH_JAVAFX, >    test "$with_javafx" != "" -a "$with_javafx" != "no") > +AM_CONDITIONAL(WITH_JAVAFX_SDK, > +  test "$with_javafx_sdk" != "" -a "$with_javafx_sdk" != "no") >  AM_CONDITIONAL(WITH_SWT, test "$with_swt" = "yes") >  AM_CONDITIONAL(WITH_AWT, test "$with_awt" != "no") >  AM_CONDITIONAL(WITH_SAX2, test "$with_sax2" != "no") > @@ -264,6 +270,7 @@ AC_SUBST(pathsep) >  AC_SUBST(filesep) >  AC_SUBST(WITH_SERVLET_ARG) >  AC_SUBST(WITH_JAVAFX_ARG) > +AC_SUBST(WITH_JAVAFX_SDK_ARG) >  AC_SUBST(WITH_JLINE3) >  AC_SUBST(WITH_GSON_PATH) >  AC_SUBST(WITH_JLINE_PATH) > diff --git a/doc/ChangeLog b/doc/ChangeLog > index 0cc771bfe..905d77bdf 100644 > --- a/doc/ChangeLog > +++ b/doc/ChangeLog > @@ -1,3 +1,8 @@ > +2019-12-16  Michael Zucchi  > + > +    * kawa.texi (Building JavaFX applications): Added subsection about > +    JDK11+ JavaFX. > + >  2019-01-17  Per Bothner  > >      * kawa.texi (Arithmetic operations): Document 'expt'. > diff --git a/doc/kawa.texi b/doc/kawa.texi > index d709b7100..2c14825df 100644 > --- a/doc/kawa.texi > +++ b/doc/kawa.texi > @@ -23138,6 +23138,30 @@ The resulting Kawa binary sets up the path to > @code{jfxrt.jar} so you just need >  $ kawa HelloButton1.scm >  @end example > > +@subsection Using JavaFX with JDK 11+ > +Starting with JDK 11, JavaFX has been moved to a separate project and > +is no longer included in the JDK.  The separate project OpenJFX > +provides an SDK that includes modular jar files which can be added to > +the @code{CLASSPATH} or via the @code{--module-path} parameter to > +@code{javac} and @code{java}. > + > +To run the previous @code{HelloButton1.scm} you can do: > +@example > +$ java -cp $KAVA_HOME/kawa.jar --module-path $JAVAFX_HOME/lib \ > +  --add-modules javafx.web HelloButton1.scm > +@end example > + > +If you build Kawa from source you must use an appropriate JDK version > +and enable the modular OpenJFX SDK: > +@example > +$ ./configure --with-javafx-sdk=path-to-sdk ...other-args... > +@end example > +The resulting Kawa binary sets up the module path and the boostrap > +module so you just need to do: > +@example > +$ kawa HelloButton1.scm > +@end example > + >  @node Building for Android >  @section Building for Android > > diff --git a/gnu/kawa/javafx/ChangeLog b/gnu/kawa/javafx/ChangeLog > index 3c8b6d99f..99d2f1f88 100644 > --- a/gnu/kawa/javafx/ChangeLog > +++ b/gnu/kawa/javafx/ChangeLog > @@ -1,3 +1,8 @@ > +2019-12-16  Michael Zucchi  > + > +    * Makefile.am (KAVA_COMPILER_JAVA_FLAGS): Add support for modular > +    javafx sdk. > + >  2017-05-13  Per Bothner  > >      * MakeScene.scm (add): Don't set root. > diff --git a/gnu/kawa/javafx/Makefile.am b/gnu/kawa/javafx/Makefile.am > index 5d0325aad..80de370e5 100644 > --- a/gnu/kawa/javafx/Makefile.am > +++ b/gnu/kawa/javafx/Makefile.am > @@ -2,6 +2,10 @@ > >  include $(top_srcdir)/Make-rules > > +if WITH_JAVAFX_SDK > +KAWA_COMPILER_JAVA_FLAGS=--module-path $(WITH_JAVAFX_SDK_ARG)/lib > --add-modules javafx.web > +endif > + >  java_sources= > >  java_SCM = GroupObjectBuilder.scm MakeScene.scm defs.scm > > -- -- ian@sibian.fr -- Développeur compulsif