-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
213 additions
and
518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ Cargo.lock | |
vendor/ | ||
gtk4-rs/ | ||
.vs/ | ||
*.zip | ||
*.zip | ||
*.AppImage | ||
*.lrsmod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
#!/usr/bin/env bash | ||
|
||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) | ||
|
||
pushd $SCRIPT_DIR | ||
|
||
# | ||
# Build Project | ||
# | ||
|
||
BUILD_DIR="target" | ||
BIN="$BUILD_DIR/release/logicrs" | ||
|
||
cargo build --release | ||
|
||
if [ ! -f $BIN ]; then | ||
echo "Release build was not successful." | ||
exit 1 | ||
fi | ||
|
||
# | ||
# Create AppDir | ||
# | ||
|
||
APP_DIR="$BUILD_DIR/appimage/logicrs.AppDir" | ||
if [ -d $APP_DIR ]; then | ||
rm -rf $APP_DIR | ||
fi | ||
|
||
mkdir -p $APP_DIR/usr/{bin,lib,share/icons} | ||
cp $BIN $APP_DIR/usr/bin/logicrs | ||
|
||
# Copy binary | ||
sed -i -e 's#/usr#././#g' $APP_DIR/usr/bin/logicrs | ||
|
||
# Collect libraries | ||
mkdir -p $APP_DIR/usr/lib | ||
|
||
LIB_PATH="/usr/lib64" | ||
IFS=' ' read -ra LIBRARIES <<< $(pkg-config --libs gtk4 libadwaita-1) | ||
for i in "${LIBRARIES[@]}"; do | ||
LIB_FILE="lib${i:2}.so" | ||
if [ ! -f $LIB_PATH/$LIB_FILE ]; then | ||
echo "could not find \`$LIB_FILE\` in \`$LIB_PATH\`" | ||
fi | ||
cp $LIB_PATH/$LIB_FILE $APP_DIR/usr/lib/$LIB_FILE | ||
done | ||
|
||
# Patch binaries | ||
pushd $APP_DIR/usr/lib | ||
find . -type f -exec sed -i -e 's#/usr#././#g' {} \; | ||
popd | ||
|
||
# | ||
# Generate Icons | ||
# | ||
|
||
DIR_ICON=".DirIcon" | ||
|
||
RELEASE_ICON_FILE="style/icons/hicolor/com.spydr06.logicrs.svg" | ||
DEBUG_ICON_FILE="style/icons/hicolor/com.spydr06.logicrs.Devel.svg" | ||
ICON_FILE=$DEBUG_ICON_FILE | ||
|
||
inkscape -z -w 256 -h 256 "$ICON_FILE" -o $APP_DIR/$DIR_ICON.png | ||
if [ ! -f $APP_DIR/$DIR_ICON.png ]; then | ||
echo "Icon generation was not successful." | ||
exit 1 | ||
fi | ||
mv $APP_DIR/$DIR_ICON.png $APP_DIR/$DIR_ICON | ||
|
||
cp $ICON_FILE $APP_DIR/logicrs.svg | ||
|
||
ICONS_DIR=$APP_DIR/usr/share/icons | ||
mkdir -p $ICONS_DIR | ||
cp $ICON_FILE $ICONS_DIR/logicrs.svg | ||
|
||
SNIPPETS_DIR="snippets" | ||
|
||
# | ||
# Prepare AppDir | ||
# | ||
|
||
# Copy desktop file | ||
DESKTOP_FILE="com.spydr06.logicrs.desktop" | ||
cp $SNIPPETS_DIR/$DESKTOP_FILE $APP_DIR/$DESKTOP_FILE | ||
|
||
# Create build directory | ||
BUILD_DIR="target/appimage" | ||
mkdir -p $BUILD_DIR | ||
|
||
# | ||
# Generate AppImage | ||
# | ||
|
||
RECIPE_FILE="$SNIPPETS_DIR/AppImageBuilder.yml" | ||
appimage-builder --recipe $RECIPE_FILE --appdir $APP_DIR --build-dir $BUILD_DIR | ||
|
||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: 1 | ||
|
||
AppDir: | ||
path: ./logicrs.AppDir | ||
|
||
app_info: | ||
id: com.spydr06.logicrs | ||
name: logicrs | ||
icon: logicrs | ||
version: '0.1' | ||
exec: usr/bin/logicrs | ||
|
||
AppImage: | ||
arch: x86_64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
SELF=$(readlink -f "$0") | ||
HERE=${SELF%/*} | ||
|
||
export PATH="${HERE}/usr/bin/:${HERE}/usr/sbin/:${HERE}/usr/games/:${HERE}/bin/:${HERE}/sbin/${PATH:+:$PATH}" | ||
export LD_LIBRARY_PATH="${HERE}/usr/lib/:${HERE}/usr/lib/i386-linux-gnu/:${HERE}/usr/lib/x86_64-linux-gnu/:${HERE}/usr/lib32/:${HERE}/usr/lib64/:${HERE}/lib/:${HERE}/lib/i386-linux-gnu/:${HERE}/lib/x86_64-linux-gnu/:${HERE}/lib32/:${HERE}/lib64/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" | ||
export PYTHONPATH="${HERE}/usr/share/pyshared/${PYTHONPATH:+:$PYTHONPATH}" | ||
export XDG_DATA_DIRS="${HERE}/usr/share/${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}" | ||
export PERLLIB="${HERE}/usr/share/perl5/:${HERE}/usr/lib/perl5/${PERLLIB:+:$PERLLIB}" | ||
export GSETTINGS_SCHEMA_DIR="${HERE}/usr/share/glib-2.0/schemas/${GSETTINGS_SCHEMA_DIR:+:$GSETTINGS_SCHEMA_DIR}" | ||
export QT_PLUGIN_PATH="${HERE}/usr/lib/qt4/plugins/:${HERE}/usr/lib/i386-linux-gnu/qt4/plugins/:${HERE}/usr/lib/x86_64-linux-gnu/qt4/plugins/:${HERE}/usr/lib32/qt4/plugins/:${HERE}/usr/lib64/qt4/plugins/:${HERE}/usr/lib/qt5/plugins/:${HERE}/usr/lib/i386-linux-gnu/qt5/plugins/:${HERE}/usr/lib/x86_64-linux-gnu/qt5/plugins/:${HERE}/usr/lib32/qt5/plugins/:${HERE}/usr/lib64/qt5/plugins/${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH}" | ||
|
||
EXEC=${HERE}/usr/bin/logicrs | ||
exec "${EXEC}" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Desktop Entry] | ||
Version=1.0 | ||
Type=Application | ||
Name=LogicRs | ||
GenericName=LogicRs | ||
Comment=Logic Simulator | ||
Exec=AppRun | ||
Icon=logicrs | ||
Terminal=false | ||
Categories=X-programming;X-coding;X-education; | ||
Keywords=math;logic;programming;coding;education; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.