build for linux

This commit is contained in:
Bane Stojkovic
2025-03-24 11:25:28 +01:00
parent cd4694c207
commit 5e70bbe898
5 changed files with 75 additions and 67 deletions
@@ -1,26 +1,25 @@
#!/bin/bash
#set -x # Enable debug mode
HERE="$(dirname "$(readlink -f "$0")")"
# Get the AppImage directory
if [ -n "$APPDIR" ]; then
HERE="$APPDIR/usr/bin"
else
HERE="$(cd "$(dirname "$0")" && pwd)"
fi
echo "diylc.sh: Running from directory: $HERE"
# Check if Java is available
if [ -d "$HERE/jre" ]; then
export JAVA_HOME="$HERE/jre"
export PATH="$JAVA_HOME/bin:$PATH"
JAVA="$JAVA_HOME/bin/java"
echo "diylc.sh: Using bundled JRE: $JAVA"
else
JAVA="$(which java)"
echo "diylc.sh: Using system Java: $JAVA"
fi
# Debug: Check Java existence
if [ ! -x "$JAVA" ]; then
echo "diylc.sh: ERROR - Java binary not found or not executable!"
# Use system Java
JAVA="$(which java)"
if [ -z "$JAVA" ] || [ ! -x "$JAVA" ]; then
echo "diylc.sh: ERROR - System Java not found or not executable!"
echo "diylc.sh: Please install Java 17 or later"
exit 1
fi
echo "diylc.sh: Using system Java: $JAVA"
cd "$HERE"
echo "diylc.sh: Current working directory: $(pwd)"
@@ -28,11 +27,9 @@ echo "diylc.sh: Current working directory: $(pwd)"
echo "diylc.sh: Executing DIYLCStarter with Java"
exec "$JAVA" \
-Xms512m \
-Xms1024m \
-Xmx4096m \
-cp "$HERE/../lib/diylc.jar" \
--add-exports java.desktop/com.apple.eawt.event=ALL-UNNAMED \
--add-exports java.desktop/com.apple.eio=ALL-UNNAMED \
-cp "$APPDIR/usr/lib/diylc.jar" \
--add-opens java.base/java.util=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.text=ALL-UNNAMED \
+31 -31
View File
@@ -350,38 +350,38 @@
<copy file="${project.basedir}/deploy/linux/appimage/com.diy_fever.DIYLayoutCreator.metainfo.xml"
todir="${appdir.dir}/usr/share/metainfo" />
<!-- Download and extract JRE for Linux -->
<!-- Ensure clean jre folders -->
<delete dir="${jre.dest.linux}" />
<mkdir dir="${jre.dest.linux}" />
<mkdir dir="${project.build.directory}/downloads" />
<!-- Download JRE 17 if not already present -->
<get src="${jdk.url.linux}"
dest="${project.build.directory}/downloads/${jdk.archive.linux}"
usetimestamp="true" />
<!-- Extract JRE -->
<untar src="${project.build.directory}/downloads/${jdk.archive.linux}"
dest="${jre.dest.linux}"
compression="gzip" />
<!-- Move extracted folder into AppImage location -->
<mkdir dir="${appdir.dir}/usr/bin/jre" />
<move todir="${appdir.dir}/usr/bin/jre">
<fileset dir="${jre.dest.linux}/jdk-${jdk.version}-jre" />
</move>
<!-- Clean up temporary directory -->
<delete dir="${jre.dest.linux}" />
<echo message="JRE 17 bundled into ${appdir.dir}/usr/bin/jre" />
<!-- &lt;!&ndash; Download and extract JRE for Linux &ndash;&gt;-->
<!-- &lt;!&ndash; Ensure clean jre folders &ndash;&gt;-->
<!-- <delete dir="${jre.dest.linux}" />-->
<!-- <mkdir dir="${jre.dest.linux}" />-->
<!-- <mkdir dir="${project.build.directory}/downloads" />-->
<!-- -->
<!-- &lt;!&ndash; Download JRE 17 if not already present &ndash;&gt;-->
<!-- <get src="${jdk.url.linux}" -->
<!-- dest="${project.build.directory}/downloads/${jdk.archive.linux}" -->
<!-- usetimestamp="true" />-->
<!-- -->
<!-- &lt;!&ndash; Extract JRE &ndash;&gt;-->
<!-- <untar src="${project.build.directory}/downloads/${jdk.archive.linux}" -->
<!-- dest="${jre.dest.linux}" -->
<!-- compression="gzip" />-->
<!-- -->
<!-- &lt;!&ndash; Move extracted folder into AppImage location &ndash;&gt;-->
<!-- <mkdir dir="${appdir.dir}/usr/bin/jre" />-->
<!-- <move todir="${appdir.dir}/usr/bin/jre">-->
<!-- <fileset dir="${jre.dest.linux}/jdk-${jdk.version}-jre" />-->
<!-- </move>-->
<!-- -->
<!-- &lt;!&ndash; Clean up temporary directory &ndash;&gt;-->
<!-- <delete dir="${jre.dest.linux}" />-->
<!-- -->
<!-- <echo message="JRE 17 bundled into ${appdir.dir}/usr/bin/jre" />-->
<!-- Update the launch script to use the correct JRE path -->
<replace file="${appdir.dir}/usr/bin/diylc.sh">
<replacetoken>JAVA_HOME="$APPDIR/usr/lib/jre"</replacetoken>
<replacevalue>JAVA_HOME="$APPDIR/usr/bin/jre"</replacevalue>
</replace>
<!-- &lt;!&ndash; Update the launch script to use the correct JRE path &ndash;&gt;-->
<!-- <replace file="${appdir.dir}/usr/bin/diylc.sh">-->
<!-- <replacetoken>JAVA_HOME="$APPDIR/usr/lib/jre"</replacetoken>-->
<!-- <replacevalue>JAVA_HOME="$APPDIR/usr/bin/jre"</replacevalue>-->
<!-- </replace>-->
<echo message="AppDir structure created successfully at: ${appdir.dir}" />
</target>