mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
mavenization
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
#set -x # Enable debug mode (prints each command before execution)
|
||||
|
||||
HERE="$(dirname "$(readlink -f "$0")")"
|
||||
echo "AppRun: Running from directory: $HERE"
|
||||
echo "AppRun: Executing $HERE/usr/bin/diylc.sh with args: $@"
|
||||
|
||||
exec "$HERE/usr/bin/diylc.sh" "$@"
|
||||
@@ -0,0 +1,39 @@
|
||||
# Base Image
|
||||
FROM ubuntu:22.04
|
||||
|
||||
# Set non-interactive mode for apt
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
wget \
|
||||
fuse \
|
||||
libfuse2 \
|
||||
ca-certificates \
|
||||
openjdk-17-jdk \
|
||||
xz-utils \
|
||||
tree \
|
||||
file \
|
||||
gpg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set Java Home
|
||||
ENV JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
|
||||
ENV PATH="${JAVA_HOME}/bin:${PATH}"
|
||||
|
||||
# Download and install appimagetool
|
||||
RUN wget -O /usr/local/bin/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage && \
|
||||
chmod +x /usr/local/bin/appimagetool
|
||||
|
||||
RUN apt-get update && apt-get install -y appstream
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /build
|
||||
|
||||
# Debugging and running AppImage build
|
||||
CMD echo "DEBUG: Checking if appimagetool exists..." && \
|
||||
ls -lh /usr/local/bin/appimagetool && \
|
||||
echo "DEBUG: Listing /build/AppDir structure..." && \
|
||||
tree /build/AppDir || ls -R /build/AppDir && \
|
||||
echo "DEBUG: Running appimagetool..." && \
|
||||
ARCH=x86_64 /usr/local/bin/appimagetool /build/AppDir /build/DIYLC-x86_64.AppImage
|
||||
@@ -0,0 +1,113 @@
|
||||
<project name="diylc-swing-appimage" basedir="../../..">
|
||||
|
||||
<import file="../../../build.xml"/>
|
||||
|
||||
<property name="appdir" value="build/AppDir" />
|
||||
<property name="appimagetool" value="${basedir}/tools/appimagetool-x86_64.AppImage" />
|
||||
<property name="wsl.command" value="wsl bash -c"/>
|
||||
|
||||
<target name="setup-wsl">
|
||||
|
||||
<!-- Install necessary Linux dependencies inside WSL -->
|
||||
<exec executable="cmd.exe" failonerror="true">
|
||||
<arg line="/c ${wsl.command} "sudo apt update && sudo apt install -y wget libfuse2 fuse"" />
|
||||
</exec>
|
||||
|
||||
<!-- Download AppImageTool into WSL -->
|
||||
<exec executable="cmd.exe" failonerror="true">
|
||||
<arg line="/c ${wsl.command} "wget -O ~/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage && chmod +x ~/appimagetool"" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="build-appimage">
|
||||
|
||||
<mkdir dir="${appdir}/usr/bin" />
|
||||
<mkdir dir="${appdir}/usr/share/icons/hicolor/512x512/apps" />
|
||||
<mkdir dir="${appdir}/usr/share/metainfo" />
|
||||
|
||||
<!-- Copy app files -->
|
||||
<copy file="${jar.dir}/diylc.jar" todir="${appdir}/usr/lib" />
|
||||
<copy todir="${appdir}/usr/lib/lib">
|
||||
<fileset dir="${jar.dir}/lib">
|
||||
<include name="*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${appdir}/usr/lib/library">
|
||||
<fileset dir="${jar.dir}/library">
|
||||
<include name="*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${appdir}/usr/bin/templates">
|
||||
<fileset dir="${basedir}/templates">
|
||||
<include name="*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${appdir}/usr/bin/themes">
|
||||
<fileset dir="${basedir}/themes">
|
||||
<include name="*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${appdir}/usr/bin/fonts">
|
||||
<fileset dir="${basedir}/fonts">
|
||||
<include name="*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${appdir}/usr/bin/lang">
|
||||
<fileset dir="${basedir}/lang">
|
||||
<include name="*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy file="appimage/diylc.sh" tofile="${appdir}/usr/bin/diylc.sh" />
|
||||
<copy file="appimage/AppRun" tofile="${appdir}/AppRun" />
|
||||
<copy file="deploy/splash.png" todir="${appdir}/usr/bin" />
|
||||
<chmod file="${appdir}/AppRun" perm="755" />
|
||||
|
||||
<!-- Copy icons and desktop file -->
|
||||
<copy file="icons/icon_512x512.png" tofile="${appdir}/usr/share/icons/hicolor/512x512/apps/com.diy_fever.DIYLayoutCreator.png" />
|
||||
<copy file="icons/icon_512x512.png" tofile="${appdir}/com.diy_fever.DIYLayoutCreator.png" />
|
||||
<!--<copy file="appimage/com.diy_fever.DIYLayoutCreator.desktop" todir="${appdir}/usr/share/applications" />-->
|
||||
<copy file="appimage/com.diy_fever.DIYLayoutCreator.desktop" todir="${appdir}" />
|
||||
<copy file="appimage/com.diy_fever.DIYLayoutCreator.metainfo.xml" todir="${appdir}/usr/share/metainfo" />
|
||||
|
||||
<exec executable="cmd.exe" failonerror="true">
|
||||
<arg line="/c wsl echo 'WSL is available'"/>
|
||||
</exec>
|
||||
|
||||
<exec executable="cmd.exe">
|
||||
<arg line="/c wsl rm -rf /tmp/AppDir"/>
|
||||
</exec>
|
||||
|
||||
<exec executable="cmd.exe">
|
||||
<arg line="/c wsl cp -r "$(wslpath -u '${appdir}')" /tmp/AppDir"/>
|
||||
</exec>
|
||||
|
||||
<!--<exec executable="cmd.exe" failonerror="true">
|
||||
<arg line="/c wsl tree /tmp/AppDir"/>
|
||||
</exec>-->
|
||||
|
||||
<!-- Convert to Unix line endings -->
|
||||
<exec executable="cmd.exe" failonerror="true">
|
||||
<arg line="/c ${wsl.command} "sed -i 's/\r$//' /tmp/AppDir/com.diy_fever.DIYLayoutCreator.desktop""/>
|
||||
</exec>
|
||||
<exec executable="cmd.exe" failonerror="true">
|
||||
<arg line="/c ${wsl.command} "sed -i 's/\r$//' /tmp/AppDir/AppRun""/>
|
||||
</exec>
|
||||
<exec executable="cmd.exe" failonerror="true">
|
||||
<arg line="/c ${wsl.command} "sed -i 's/\r$//' /tmp/AppDir/usr/bin/diylc.sh""/>
|
||||
</exec>
|
||||
|
||||
<echo message="Starting AppImage build process using WSL..."/>
|
||||
|
||||
<exec executable="cmd.exe" failonerror="true">
|
||||
<arg line="/c ${wsl.command} "cd /tmp && ~/appimagetool /tmp/AppDir /tmp/${appimage.output.file}""/>
|
||||
</exec>
|
||||
|
||||
<echo message="AppImage created successfully in WSL! Copying back to Windows..."/>
|
||||
|
||||
<exec executable="cmd.exe" failonerror="true">
|
||||
<arg line="/c wsl bash -c "cp /tmp/${appimage.output.file} $(wslpath -u 'build\\${appimage.output.file}')""/>
|
||||
</exec>
|
||||
|
||||
<echo message="AppImage build completed successfully! Output: ${appimage.output.file}"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,6 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=DIY Layout Creator
|
||||
Exec=diylc
|
||||
Icon=com.diy_fever.DIYLayoutCreator
|
||||
Categories=Graphics;Electronics;
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>com.diy_fever.DIYLayoutCreator</id>
|
||||
<name>DIY Layout Creator</name>
|
||||
<summary>Design and create DIY electronics layouts</summary>
|
||||
<description>
|
||||
<p>DIY Layout Creator (DIYLC) is an open-source, Java-based software for designing layouts for electronics projects. It provides an easy-to-use interface for designing circuits, stripboard layouts, and other DIY electronics designs.</p>
|
||||
</description>
|
||||
<launchable type="desktop-id">com.diy_fever.DIYLayoutCreator.desktop</launchable>
|
||||
<developer_name>Branislav Stojkovic</developer_name>
|
||||
<url type="homepage">https://github.com/bancika/diy-layout-creator</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://diy-fever.com/wordpress/wp-content/gallery/diylc/slo.png</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://diy-fever.com/wordpress/wp-content/gallery/diylc/travelcaster.png</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://diy-fever.com/wordpress/wp-content/gallery/diylc/iic.png</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://diy-fever.com/wordpress/wp-content/gallery/diylc/split.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<!-- <releases>
|
||||
<release version="4.0.0" date="2025-03-04">
|
||||
<description>
|
||||
<p>Major UI overhaul, improved export options, and new components added.</p>
|
||||
</description>
|
||||
</release>
|
||||
</releases>-->
|
||||
</component>
|
||||
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
#set -x # Enable debug mode
|
||||
|
||||
HERE="$(dirname "$(readlink -f "$0")")"
|
||||
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!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$HERE"
|
||||
echo "diylc.sh: Current working directory: $(pwd)"
|
||||
|
||||
# Debug: Print command before execution
|
||||
echo "diylc.sh: Executing DIYLCStarter with Java"
|
||||
|
||||
exec "$JAVA" \
|
||||
-javaagent:"$HERE/../lib/lib/jar-loader.jar" \
|
||||
-Xms128m \
|
||||
-Xmx4096m \
|
||||
-cp "$HERE/../lib/diylc.jar:$HERE/../lib/lib/*" \
|
||||
--add-exports java.desktop/com.apple.eawt.event=ALL-UNNAMED \
|
||||
--add-exports java.desktop/com.apple.eio=ALL-UNNAMED \
|
||||
--add-opens java.base/java.util=ALL-UNNAMED \
|
||||
--add-opens java.base/java.lang=ALL-UNNAMED \
|
||||
--add-opens java.base/java.text=ALL-UNNAMED \
|
||||
--add-opens java.desktop/java.awt=ALL-UNNAMED \
|
||||
--add-opens java.desktop/java.awt.font=ALL-UNNAMED \
|
||||
--add-opens java.desktop/java.awt.geom=ALL-UNNAMED \
|
||||
-Dorg.diylc.scriptRun=true \
|
||||
org.diylc.DIYLCStarter "$@"
|
||||
@@ -0,0 +1,75 @@
|
||||
# 🚀 Setting up WSL and AppImage Builder
|
||||
|
||||
This script sets up **WSL (Windows Subsystem for Linux)** and installs the necessary dependencies for building AppImages.
|
||||
|
||||
---
|
||||
|
||||
## 📜 Installation Script
|
||||
|
||||
```batch
|
||||
@echo off
|
||||
echo ========================================
|
||||
echo 🚀 Setting up WSL and AppImage Builder
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
:: Check if WSL is installed
|
||||
wsl --version >nul 2>&1
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo 🔧 Installing WSL...
|
||||
wsl --install -d Ubuntu22.04
|
||||
echo ✅ WSL installed! Please restart your computer and re-run this script.
|
||||
exit /b
|
||||
)
|
||||
|
||||
echo 🔧 Ensuring Ubuntu is set as default WSL distribution...
|
||||
wsl --set-default Ubuntu
|
||||
|
||||
:: Check if WSL is running
|
||||
wsl echo "WSL is running..."
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo ❌ ERROR: WSL is not running. Please restart your system and try again.
|
||||
exit /b
|
||||
)
|
||||
|
||||
:: Update and install dependencies inside WSL
|
||||
echo 🔧 Installing dependencies inside WSL...
|
||||
wsl sudo apt update && sudo apt install -y ^
|
||||
wget ^
|
||||
fuse ^
|
||||
libfuse2 ^
|
||||
ca-certificates ^
|
||||
xz-utils ^
|
||||
file ^
|
||||
appstream ^
|
||||
gpg ^
|
||||
libc6 ^
|
||||
binfmt-support ^
|
||||
tree
|
||||
|
||||
wsl sudo apt update && sudo apt install -y libfuse2
|
||||
|
||||
echo ✅ Dependencies installed!
|
||||
|
||||
:: Download AppImageTool inside WSL
|
||||
echo 🔧 Downloading AppImageTool...
|
||||
wsl bash -c "wget -O ~/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage && chmod +x ~/appimagetool"
|
||||
|
||||
:: Verify AppImageTool installation
|
||||
echo 🔧 Verifying AppImageTool installation...
|
||||
wsl bash -c "~/appimagetool --version"
|
||||
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo ❌ ERROR: AppImageTool failed to execute.
|
||||
echo Please check if WSL is running properly and try again.
|
||||
exit /b
|
||||
)
|
||||
|
||||
echo ✅ WSL is now ready for ANT to build AppImages!
|
||||
echo.
|
||||
|
||||
:: Optional: Open WSL shell for user confirmation
|
||||
echo 🔧 Opening WSL shell...
|
||||
wsl
|
||||
|
||||
exit /b
|
||||
@@ -0,0 +1,67 @@
|
||||
@echo off
|
||||
echo ========================================
|
||||
echo 🚀 Setting up WSL and AppImage Builder
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
:: Check if WSL is installed
|
||||
wsl --version >nul 2>&1
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo 🔹 Installing WSL...
|
||||
wsl --install -d Ubuntu22.04
|
||||
echo ✅ WSL installed! Please restart your computer and re-run this script.
|
||||
exit /b
|
||||
)
|
||||
|
||||
echo 🔹 Ensuring Ubuntu is set as default WSL distribution...
|
||||
wsl --set-default Ubuntu
|
||||
|
||||
:: Check if WSL is running
|
||||
wsl echo "WSL is running..."
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo � ERROR: WSL is not running. Please restart your system and try again.
|
||||
exit /b
|
||||
)
|
||||
|
||||
:: Update and install dependencies inside WSL
|
||||
echo 🔹 Installing dependencies inside WSL...
|
||||
wsl sudo apt update && sudo apt install -y \
|
||||
wget \
|
||||
fuse \
|
||||
libfuse2 \
|
||||
ca-certificates \
|
||||
xz-utils \
|
||||
file \
|
||||
appstream \
|
||||
gpg \
|
||||
libc6 \
|
||||
binfmt-support \
|
||||
tree
|
||||
|
||||
wsl sudo apt update && sudo apt install -y libfuse2
|
||||
|
||||
echo ✅ Dependencies installed!
|
||||
|
||||
:: Download AppImageTool inside WSL
|
||||
echo 🔹 Downloading AppImageTool...
|
||||
wsl bash -c "wget -O ~/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage && chmod +x ~/appimagetool"
|
||||
|
||||
:: Verify AppImageTool installation
|
||||
echo 🔹 Verifying AppImageTool installation...
|
||||
wsl bash -c "~/appimagetool --version"
|
||||
|
||||
|
||||
if %ERRORLEVEL% NEQ 0 (
|
||||
echo � ERROR: AppImageTool failed to execute.
|
||||
echo Please check if WSL is running properly and try again.
|
||||
exit /b
|
||||
)
|
||||
set
|
||||
echo ✅ WSL is now ready for ANT to build AppImages!
|
||||
echo.
|
||||
|
||||
:: Optional: Open WSL shell for user confirmation
|
||||
echo 🔹 Opening WSL shell...
|
||||
wsl
|
||||
|
||||
exit /b
|
||||
Reference in New Issue
Block a user