2020-03-20 09:54:15 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-04-27 13:23:42 -05:00
|
|
|
set -e
|
2020-03-13 00:57:06 -05:00
|
|
|
set -x
|
2020-03-20 09:54:15 -05:00
|
|
|
|
|
|
|
APPDIR=target/NB.AppDir
|
|
|
|
mkdir -p ${APPDIR}
|
2020-03-13 00:57:06 -05:00
|
|
|
|
2020-04-27 13:23:42 -05:00
|
|
|
|
|
|
|
BUILD_OPENJ9="false"
|
|
|
|
if [ "$1" = "--with-openj9" ]
|
|
|
|
then
|
|
|
|
BUILD_OPENJ9="true"
|
|
|
|
printf "using openj9 for build\n"
|
|
|
|
shift;
|
|
|
|
fi
|
|
|
|
|
2020-03-13 00:57:06 -05:00
|
|
|
if [ ! -f target/nb.jar ]
|
|
|
|
then
|
2020-04-27 13:23:42 -05:00
|
|
|
printf "target/nb.jar does not exist"
|
2020-03-13 00:57:06 -05:00
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
#if [ -x "target/nb" ]
|
|
|
|
#then
|
|
|
|
# printf "Removing stale target/nb...\n"
|
|
|
|
# rm target/nb
|
|
|
|
#fi
|
|
|
|
|
2020-03-20 09:54:15 -05:00
|
|
|
rsync -av appimage/skel/ "${APPDIR}/"
|
|
|
|
cp target/nb.jar "${APPDIR}/usr/bin/nb.jar"
|
2021-12-21 16:44:32 -06:00
|
|
|
JAVA_VERSION="17"
|
2020-03-13 00:57:06 -05:00
|
|
|
|
2020-12-08 11:33:36 -06:00
|
|
|
mkdir -p "${APPDIR}/usr/bin/jre"
|
|
|
|
|
2021-12-21 16:44:32 -06:00
|
|
|
|
|
|
|
if [ "$JAVA_VERSION" == "17" ]
|
2020-03-13 00:57:06 -05:00
|
|
|
then
|
2021-12-21 16:44:32 -06:00
|
|
|
if [ ! -d "cache/jdk17" ] ; then
|
|
|
|
printf "getting jdk17 once into cache/jdk17\n";
|
2020-12-08 11:33:36 -06:00
|
|
|
mkdir -p cache
|
|
|
|
(cd cache && (
|
2021-12-21 16:44:32 -06:00
|
|
|
wget -c https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz
|
|
|
|
tar -xf OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz
|
|
|
|
mv jdk-17.0.1+12 jdk17
|
|
|
|
rm OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz
|
2020-12-08 11:33:36 -06:00
|
|
|
))
|
|
|
|
fi
|
2021-12-21 16:44:32 -06:00
|
|
|
rsync -av cache/jdk17/ "${APPDIR}/usr/bin/jre/"
|
2020-12-08 11:33:36 -06:00
|
|
|
else
|
|
|
|
printf "Unknown java version indicated in $0"
|
|
|
|
exit 2
|
2020-03-13 00:57:06 -05:00
|
|
|
fi
|
|
|
|
|
2020-03-20 09:54:15 -05:00
|
|
|
if [ ! -f "${APPDIR}/AppRun" ]
|
2020-03-13 00:57:06 -05:00
|
|
|
then
|
2020-03-20 09:54:15 -05:00
|
|
|
( cd ${APPDIR} && (
|
2020-03-13 00:57:06 -05:00
|
|
|
printf "Linking AppRun...\n";
|
|
|
|
ln -s usr/bin/nb AppRun
|
|
|
|
))
|
|
|
|
fi
|
|
|
|
|
|
|
|
printf "getting appimage tool and building image...\n";
|
|
|
|
|
|
|
|
( cd target && (
|
|
|
|
if [ ! -x "appimagetool-x86_64.AppImage" ]
|
|
|
|
then
|
|
|
|
wget -c https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage
|
|
|
|
chmod +x appimagetool-x86_64.AppImage
|
|
|
|
fi
|
|
|
|
|
|
|
|
ARCH=x86_64 ./appimagetool-x86_64.AppImage NB.AppDir nb
|
|
|
|
# && chmod +x nb
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
if [ -x "target/nb" ]
|
|
|
|
then
|
|
|
|
printf "nosqlbench AppImage binary was built at target/nb\n";
|
|
|
|
fi
|
|
|
|
|