Organize linux build scripts, and create AppImage build scripts

This commit is contained in:
Yousef Khadadeh 2026-07-09 15:21:42 +03:00
parent ca859671c3
commit 47f885ec9a
11 changed files with 285 additions and 10 deletions

5
linuxinstall/AppRun Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
HERE="$(dirname "$(readlink -f "$0")")"
export LD_LIBRARY_PATH="$HERE/usr/lib:$HERE/usr/lib64:$LD_LIBRARY_PATH"
exec "$HERE/usr/bin/infinipaint" "$@"

View file

@ -0,0 +1,13 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=InfiniPaint
Comment=Infinite canvas program
Categories=Graphics;VectorGraphics;2DGraphics
Keywords=paint;whiteboard;notes;drawing;draw;paint;painting;infinite;canvas;graphics;zoom
Icon=infinipaint
Terminal=false
MimeType=application/x-com.infinipaint.infinipaint.infpnt

View file

@ -0,0 +1,5 @@
AppDir
buildarea
builddir
InfiniPaint-x86_64.AppImage
appimagetool.AppImage

View file

@ -0,0 +1,7 @@
#!/bin/bash
cd "$(dirname "$0")"
rm -rf builddir
rm -rf buildarea
rm -rf AppDir

View file

@ -0,0 +1,6 @@
#!/bin/bash
cd "$(dirname "$0")"
rm -rf AppDir
./create_appimage_appdir.sh
./appimagetool.AppImage AppDir

View file

@ -0,0 +1,38 @@
#!/bin/bash
cd "$(dirname "$0")"
mkdir AppDir
mkdir AppDir/usr
cp -r builddir/bin AppDir/usr
cp -r builddir/lib AppDir/usr
mkdir AppDir/usr/share
mkdir AppDir/usr/share/icons
mkdir AppDir/usr/share/icons/hicolor
mkdir AppDir/usr/share/icons/hicolor/scalable
mkdir AppDir/usr/share/icons/hicolor/scalable/apps
cp ../../logo.svg AppDir/usr/share/icons/hicolor/scalable/apps/infinipaint.svg
mkdir AppDir/usr/share/applications
cp ../appimage_infinipaint.desktop AppDir/usr/share/applications/infinipaint.desktop
cp ../AppRun AppDir/AppRun
cd AppDir
ln -s usr/share/applications/infinipaint.desktop infinipaint.desktop
ln -s usr/share/icons/hicolor/scalable/apps/infinipaint.svg infinipaint.svg
# Renaming and cleaning up lib directory
cd usr
rm -rf lib/debug
# - /Skia
# - /include
rm -rf lib/pkgconfig
rm -rf lib/cmake
rm -rf lib/libupb.a
rm -rf bin/proto*
rm -rf lib/*.a
rm -rf lib/libicui18n*
# rm -rf lib/libicudata* # Should just be a stubfile, check the size of the library (should be small, doesn't actually contain data)
rm -rf bin/zstd*
rm -rf bin/unzstd

View file

@ -0,0 +1,186 @@
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")"
if [[ -d builddir ]]; then
echo "builddir exists, skip"
else
mkdir builddir
fi
if [[ -d buildarea ]]; then
echo "buildarea exists, skip"
else
mkdir buildarea
fi
BUILD_AREA=$(realpath buildarea)
BUILD_DIR=$(realpath builddir)
export LD_LIBRARY_PATH="$BUILD_DIR/lib:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export LIBRARY_PATH="$BUILD_DIR/lib:${LIBRARY_PATH:+:$LIBRARY_PATH}"
export CPATH="$BUILD_DIR/include:${CPATH:+:$CPATH}"
export PKG_CONFIG_PATH="$BUILD_DIR/lib/pkgconfig:${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
cd $BUILD_AREA
# ----- ICU -----
if [[ -d icu ]]; then
echo "ICU exists, skip"
else
# download and unpack
wget https://github.com/unicode-org/icu/releases/download/release-77-1/icu4c-77_1-src.tgz
tar -xvzf icu4c-77_1-src.tgz
rm icu4c-77_1-src.tgz
cd icu
# compile and install
cd source
chmod +x runConfigureICU configure install-sh
./runConfigureICU Linux --prefix=$BUILD_DIR --disable-icu-config --disable-icuio --disable-extras --disable-tools --disable-tests --disable-samples --disable-layoutex --disable-layout --with-data-packaging=archive
make -j$(nproc)
make install
# cleanup
cd $BUILD_AREA
fi
# ----- zstd -----
if [[ -d zstd ]]; then
echo "zstd exists, skip"
else
# download
git clone https://github.com/facebook/zstd.git
cd zstd
git checkout f8745da6ff1ad1e7bab384bd1f9d742439278e99
# compile and install
cd build/cmake
cmake -B build -DCMAKE_INSTALL_PREFIX=$BUILD_DIR
cd build
make -j$(nproc)
make install
# cleanup
cd $BUILD_AREA
fi
# ----- libdatachannel -----
if [[ -d libdatachannel ]]; then
echo "libdatachannel exists, skip"
else
# download
git clone https://github.com/paullouisageneau/libdatachannel.git
cd libdatachannel
git checkout 8c31097ea78f051e857d0aa1b2f6efb26cd12b7e
git submodule update --init --recursive
# compile and install
cmake -B build -DCMAKE_INSTALL_PREFIX=$BUILD_DIR -DNO_MEDIA=ON -DCMAKE_BUILD_TYPE=Release
cd build
make -j$(nproc)
make install
# cleanup
cd $BUILD_AREA
fi
# ----- oneTBB -----
if [[ -d oneTBB ]]; then
echo "oneTBB exists, skip"
else
# download
git clone https://github.com/uxlfoundation/oneTBB.git
cd oneTBB
git checkout 0c0ff192a2304e114bc9e6557582dfba101360ff
# compile and install
cmake -B build -DCMAKE_INSTALL_PREFIX=$BUILD_DIR -DTBB_TEST=OFF
cd build
make -j$(nproc)
make install
# cleanup
cd $BUILD_AREA
fi
# ----- Clipper2 -----
if [[ -d Clipper2 ]]; then
echo "Clipper2 exists, skip"
else
# download
git clone https://github.com/AngusJohnson/Clipper2.git
cd Clipper2
git checkout 21ebba05db8894f0c7217ad35ea518080f324946
# compile and install
cd CPP
cmake -B build -DCMAKE_INSTALL_PREFIX=$BUILD_DIR -DCLIPPER2_UTILS=OFF -DCLIPPER2_EXAMPLES=OFF -DCLIPPER2_TESTS=OFF
cd build
make -j$(nproc)
make install
# cleanup
cd $BUILD_AREA
fi
# ----- Skia -----
if [[ -d skia-da51f0d60ea2b14e845a823dc11b405dbeef42d8 ]]; then
echo "skia-da51f0d60ea2b14e845a823dc11b405dbeef42d8 exists, skip"
else
# download
wget https://github.com/google/skia/archive/da51f0d60ea2b14e845a823dc11b405dbeef42d8.zip
unzip da51f0d60ea2b14e845a823dc11b405dbeef42d8.zip
rm da51f0d60ea2b14e845a823dc11b405dbeef42d8.zip
cd skia-da51f0d60ea2b14e845a823dc11b405dbeef42d8
# compile and install
python3 tools/git-sync-deps
bin/gn gen out/Static --args='is_official_build=true skia_use_system_expat=false skia_use_system_freetype2=true skia_use_system_harfbuzz=true skia_use_system_icu=true skia_use_system_libjpeg_turbo=false skia_use_system_libpng=true skia_use_system_libwebp=false skia_use_system_zlib=true skia_use_egl=true skia_use_x11=false'
ninja -C out/Static skia svg skunicode_core skunicode_icu skparagraph skresources skshaper
rm -rf $BUILD_AREA/Skia
mkdir $BUILD_AREA/Skia
mv out $BUILD_AREA/Skia
mv include $BUILD_AREA/Skia
mv src $BUILD_AREA/Skia
mv modules $BUILD_AREA/Skia
# cleanup
cd $BUILD_AREA
fi
# ----- InfiniPaint -----
# compile and install
if [[ -d infinipaint-build ]]; then
echo "infinipaint-build exists, skip mkdir"
else
mkdir infinipaint-build
fi
cd ../../..
cmake -B $BUILD_AREA/infinipaint-build -DCMAKE_INSTALL_PREFIX=$BUILD_DIR \
-DCMAKE_PREFIX_PATH=$BUILD_DIR \
-DNO_CONAN_BUILD=ON \
-DSKIA_INCLUDE=$BUILD_AREA/Skia \
-DSKIA_LIB=$BUILD_AREA/Skia/out/Static/libskia.a \
-DSKIA_SVG_LIB=$BUILD_AREA/Skia/out/Static/libsvg.a \
-DSKIA_RESOURCES_LIB=$BUILD_AREA/Skia/out/Static/libskresources.a \
-DSKIA_SHAPER_LIB=$BUILD_AREA/Skia/out/Static/libskshaper.a \
-DSKIA_UNICODE_ICU_LIB=$BUILD_AREA/Skia/out/Static/libskunicode_core.a \
-DSKIA_UNICODE_CORE_LIB=$BUILD_AREA/Skia/out/Static/libskunicode_icu.a \
-DSKIA_PARAGRAPH_LIB=$BUILD_AREA/Skia/out/Static/libskparagraph.a \
-DCMAKE_BUILD_TYPE=Release \
-DGRAPHICS_BACKEND=OpenGL3.3
cd $BUILD_AREA/infinipaint-build
make -j$(nproc)
make install
# cleanup
cd $BUILD_AREA

View file

@ -12,7 +12,8 @@ modules:
subdir: source
build-commands:
- chmod +x runConfigureICU configure install-sh
- ./runConfigureICU Linux --prefix=/app --disable-icu-config --disable-icuio --disable-extras --disable-tools --disable-tests --disable-samples --disable-layoutex --disable-layout
# adding --with-data-packaging=archive to prevent creation of .so dat file. Still has to link to a .so dat file though (stubfile)
- ./runConfigureICU Linux --prefix=/app --disable-icu-config --disable-icuio --disable-extras --disable-tools --disable-tests --disable-samples --disable-layoutex --disable-layout --with-data-packaging=archive
- make -j$(nproc)
- make install
sources:
@ -126,7 +127,7 @@ cleanup:
- /bin/proto*
- /lib/*.a
- /lib/libicui18n*
- /lib/libicudata*
#- /lib/libicudata* # Should just be a stubfile, check the size of the library (should be small, doesn't actually contain data)
- /bin/zstd*
- /bin/unzstd

View file

@ -0,0 +1,4 @@
repo
builddir
.flatpak-builder
infinipaint.flatpak

View file

@ -0,0 +1,5 @@
#!/bin/bash
cd "$(dirname "$0")"
flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo builddir ../com.infinipaint.infinipaint.yml
flatpak build-bundle repo infinipaint.flatpak com.infinipaint.infinipaint