From: Bill Erickson Date: Thu, 4 Apr 2019 21:19:13 +0000 (-0400) Subject: LP1817932 Improvements window Linux-base Windows building X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7def73355a994069c7b257762d254ed77669b888;p=working%2FHatch.git LP1817932 Improvements window Linux-base Windows building Update build docs to assume Widnows builds are created on Linux. The Windows instructions could be recovered, but not until there is a way to fetch dependenies or the process is fully documented. For now, it's Linux only. Separte the extracted Windows and Linux Java dependencies so they can live alongside each other. Signed-off-by: Bill Erickson --- diff --git a/.gitignore b/.gitignore index e4c123b876..76160efe67 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,11 @@ lib/ -java-jdk/ -javafx-sdk/ +java-jdk-win/ +javafx-sdk-win/ +java-jdk-linux/ +javafx-sdk-linux/ *.exe +*.exe.md5 *.zip *.dmg *.app diff --git a/fetch-deps.sh b/fetch-deps.sh index 87fdbe54af..3bd52fb620 100755 --- a/fetch-deps.sh +++ b/fetch-deps.sh @@ -27,10 +27,23 @@ JSON_BUILD="20160810" JSON_JAR="json-$JSON_BUILD.jar" JSON_URL="https://search.maven.org/remotecontent?filepath=org/json/json/$JSON_BUILD/$JSON_JAR" +# Confirm the command line param $1 is defined. +if [ -z ${1+x} ]; then + echo "Platform argument required"; + echo "$0 windows | linux"; + exit 1; +fi; + PLATFORM=$1; if [ "$PLATFORM" == "windows" ]; then + # maintain separate directories for Java deps so they can live + # alongside each other (useful for creating Windows builds from + # Linux). + JDK_DIR_SHORT="$JDK_DIR_SHORT-win" + JFX_DIR_SHORT="$JFX_DIR_SHORT-win" + if [ ! -d "$JDK_DIR" ]; then if [ ! -f "$WIN_JDK_ZIP" ]; then wget "$WIN_JDK_URL"; @@ -47,6 +60,9 @@ if [ "$PLATFORM" == "windows" ]; then elif [ "$PLATFORM" == "linux" ]; then + JDK_DIR_SHORT="$JDK_DIR_SHORT-linux" + JFX_DIR_SHORT="$JFX_DIR_SHORT-linux" + if [ ! -d "$JDK_DIR" ]; then if [ ! -f "$LINUX_JDK_TAR" ]; then wget "$LINUX_JDK_URL"; @@ -60,9 +76,9 @@ elif [ "$PLATFORM" == "linux" ]; then fi; $UNZIP "$LINUX_JFX_ZIP" fi; - else - echo "Platform argument required"; + + echo "Valid platform argument required"; echo "$0 windows | linux"; exit 1; fi; @@ -78,10 +94,9 @@ mv "$JDK_DIR" "$JDK_DIR_SHORT"; mv "$JFX_DIR" "$JFX_DIR_SHORT"; if [ "$PLATFORM" == "windows" ]; then - echo "Please remove the downloaded ZIP files before completing the Windows build" + echo "Please remove all .zip / .tar.gz files before completing the Windows build!" echo - echo "rm $WIN_JDK_ZIP" - echo "rm $WIN_JFX_ZIP" + ls *.tar.gz *.zip 2> /dev/null echo fi; diff --git a/hatch.bat b/hatch.bat index faa6452689..3d9e52259c 100755 --- a/hatch.bat +++ b/hatch.bat @@ -3,11 +3,11 @@ REM Windows Hatch Execution Script REM @echo off required for STDIO to work with the browser. REM Use the locally extracted Java/JFX libs -SET JAVA_HOME=java-jdk +SET JAVA_HOME=java-jdk-win SET JAVA=%JAVA_HOME%\bin\java SET JAVAC=%JAVA_HOME%\bin\javac SET JAR=%JAVA_HOME%\bin\jar -SET JAVAFX_HOME=javafx-sdk +SET JAVAFX_HOME=javafx-sdk-win SET JAVAFX_MODS=javafx.base,javafx.graphics,javafx.web REM %~1 means to strip %1 of any surrounding quotes. diff --git a/hatch.sh b/hatch.sh index 598a068caa..fc48ca0af8 100755 --- a/hatch.sh +++ b/hatch.sh @@ -3,8 +3,8 @@ # Linux/Mac Hatch Execution Script # Reference local JDK/JFX bundles. -JAVA_HOME="./java-jdk" -JAVAFX_HOME="./javafx-sdk" +JAVA_HOME="./java-jdk-linux" +JAVAFX_HOME="./javafx-sdk-linux" JAFAFX_MODS="--module-path $JAVAFX_HOME/lib --add-modules=javafx.base,javafx.graphics,javafx.web" JAVA=$JAVA_HOME/bin/java diff --git a/installer/windows/README.adoc b/installer/windows/README.adoc index 24799c9cd0..53afe886d5 100644 --- a/installer/windows/README.adoc +++ b/installer/windows/README.adoc @@ -1,80 +1,45 @@ [[hatch---java-print-storage-etc-service]] -Hatch - Java Print / Storage / Etc Service ------------------------------------------- += Hatch - Java Print Service Windows Installer -[[hatch-download-sources]] -Hatch Download sources -^^^^^^^^^^^^^^^^^^^^^^ +== Building on Linux -http://git.evergreen-ils.org/?p=working/Hatch.git;a=summary - -[[requirements]] -Requirements -~~~~~~~~~~~~ - -1. NSIS -2. OpenJDK and OpenJFX v. 1.11 or higher - - -[[pre-installation]] -Pre-Installation -~~~~~~~~~~~~~~~~ - -Download the OpenJDK and OpenJFX bundles for Windows since they -are added directly to the installer. +=== Install NSIS [source,sh] ----------------------------------------------------------------------------- - +sudo apt-get install nsis ----------------------------------------------------------------------------- +=== Download Hatch Sources -[[compiling-hatch]] -Compiling Hatch -^^^^^^^^^^^^^^^ - -Before installing, Hatch will need to be properly compiled. - -Windows: -++++++++ - -.... -C:\> hatch.bat compile -.... - -Linux: -++++++ - -.... -$ ./hatch.sh compile -.... +[source,sh] +----------------------------------------------------------------------------- +git clone git://git.evergreen-ils.org/Hatch.git +cd Hatch +----------------------------------------------------------------------------- -More detail on this process and testing it can be found in -INSTALL.adoc. +=== Download Java Dependencies for Compilation +NOTE: Dependencies for Windows and Linux are fetched since Linux is +handling the Java compilation step. -[[adding-contact-information]] -Adding Contact Information -^^^^^^^^^^^^^^^^^^^^^^^^^^ +[source,sh] +----------------------------------------------------------------------------- +./fetch-deps.sh linux +./fetch-deps.sh windows +----------------------------------------------------------------------------- -Contact Information will be found when a user views the Add/Remove -Programs tool in Windows in order to uninstall or view the information -of an installed program. This information usually consists of an Email, -a URL for updates, and a URL for a description of the program. To set -these, you’ll have to edit defines.nsh, and edit the following fields: +=== Compile Hatch -.... -!define HELPURL "mailto:[your@email.here]" -!define UPDATEURL "http://..." -!define ABOUTURL "http://..." -.... +[source,sh] +----------------------------------------------------------------------------- +./hatch.sh compile +----------------------------------------------------------------------------- -[[updating-version-number]] -Updating Version Number -^^^^^^^^^^^^^^^^^^^^^^^ +=== Updating Version Number -As with above, there may be times you want Hatch to install with a new -version number. In Defines.nsh, edit the following fields: +Modify the following variables in 'defines.nsh' as needed to apply +version numbers to the Hatch installer. .... !define VERSIONMAJOR 2 @@ -82,64 +47,29 @@ version number. In Defines.nsh, edit the following fields: !define VERSIONBUILD 0 .... -[[compile-installer]] -Compile Installer -^^^^^^^^^^^^^^^^^ - -[[windows]] -Windows: -++++++++ +=== Create Windows Build -1. Right click hatch.nsi -> Compile NSIS Script -2. Run the generated installer +From the Hatch checkout base directory. -[[linux]] -Linux: -++++++ - -1. Install NSIS if not already present on your system. -+ -.... -sudo apt-get install nsis -.... +[source,sh] +----------------------------------------------------------------------------- +# Prevent makensis from including these lib dirs +# note: tried to do this in hatch.nsi but eventually gave up +mv java-jdk-linux/lib java-jdk-linux/lib.tmp +mv javafx-sdk-linux/lib javafx-sdk-linux/lib.tmp -2. Navigate to the hatch repo and compile the installer -+ -.... -cd ~/Hatch makensis installer/windows/hatch.nsi -.... -[[running-hatch]] -Running Hatch -~~~~~~~~~~~~~ - -1. Once installed, open Chrome and navigate to chrome://extensions -2. Ensure Developer Mode is ticked, and select ``Load Unpacked -Extensions'' -3. Select [Installation Directory]/extension/app/. -4. In Chrome, navigate to the browser staff URL -(https://HOSTNAME/eg/staff/). -5. Chrome should display a browser action icon along the top right of -the + -browser window (just left of the settings menu) with a letter ``H''. + -** TODO: we can apply an icon of our choosing here during the install. -6. Clicking the ``H'' button should produce a security prompt, click -through + -to allow the requested permissions. -7. Reload the browser client login page. -8. Open the Javascript console. It should show messages like: +# recover original file names +mv java-jdk-linux/lib.tmp java-jdk-linux/lib +mv javafx-sdk-linux/lib.tmp javafx-sdk-linux/lib +----------------------------------------------------------------------------- -.... -Loading Hatch relay content script -... -sending to Hatch: {"key":"eg.workstation.all","action":"get","msgid":1} -Hatch responded to message ID 1 -.... +=== Create the MD5 Sum + +[source,sh] +----------------------------------------------------------------------------- +VERSION=0.2.0 # Change to match version +md5sum installer/windows/Hatch-Installer-$VERSION.exe > installer/windows/Hatch-Installer-$VERSION.exe.md5 +----------------------------------------------------------------------------- -1. See if Hatch is able to communicate with your printer… Navigate to + -https://HOSTNAME/eg/staff/admin/workstation/print/config -2. The ``Select Printer'' drop-down should show your printer(s). -3. The various printer attribute selectors should show values -supported + -by the selected printer. diff --git a/installer/windows/hatch.nsi b/installer/windows/hatch.nsi index d74cbdb6e5..f5e9e11cd8 100644 --- a/installer/windows/hatch.nsi +++ b/installer/windows/hatch.nsi @@ -101,8 +101,8 @@ section "install" ; Install directory files - keep these in the same directory ; as the script before compiling. SetOutPath $INSTDIR\ ;Sets output path to our InstallDir - File /r ..\..\java-jdk - File /r ..\..\javafx-sdk + File /r ..\..\java-jdk-win + File /r ..\..\javafx-sdk-win File /r ..\..\lib File /r ..\..\extension File ..\..\hatch.bat