Organize linux build scripts, and create AppImage build scripts
This commit is contained in:
parent
ca859671c3
commit
47f885ec9a
11 changed files with 285 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
cmake_minimum_required(VERSION 3.27.0)
|
cmake_minimum_required(VERSION 3.27.0)
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
|
||||||
project(infinipaint)
|
project(infinipaint)
|
||||||
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
|
@ -189,12 +190,18 @@ if(WIN32)
|
||||||
"windowsinstall/app.rc")
|
"windowsinstall/app.rc")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(ANDROID)
|
||||||
|
add_library(main SHARED ${sources})
|
||||||
|
else()
|
||||||
|
add_executable(main ${sources})
|
||||||
|
endif()
|
||||||
|
|
||||||
# Get libraries
|
# Get libraries
|
||||||
find_package(ICU 77.1 REQUIRED COMPONENTS uc)
|
|
||||||
|
|
||||||
if(NO_CONAN_BUILD)
|
if(NO_CONAN_BUILD)
|
||||||
set(SKIA_INCLUDE "modules/skia" CACHE PATH "Path to Skia root directory")
|
set(SKIA_INCLUDE "modules/skia" CACHE PATH "Path to Skia root directory")
|
||||||
set(SKIA_LIB_PATH "modules/skia/out/Static" CACHE PATH "Path to Skia libs")
|
set(SKIA_LIB_PATH "modules/skia/out/Static" CACHE PATH "Path to Skia libs")
|
||||||
|
|
||||||
find_library(SKIA_LIB skia PATHS ${SKIA_LIB_PATH})
|
find_library(SKIA_LIB skia PATHS ${SKIA_LIB_PATH})
|
||||||
find_library(SKIA_SVG_LIB svg PATHS ${SKIA_LIB_PATH})
|
find_library(SKIA_SVG_LIB svg PATHS ${SKIA_LIB_PATH})
|
||||||
find_library(SKIA_RESOURCES_LIB skresources PATHS ${SKIA_LIB_PATH})
|
find_library(SKIA_RESOURCES_LIB skresources PATHS ${SKIA_LIB_PATH})
|
||||||
|
|
@ -213,6 +220,8 @@ else()
|
||||||
find_package(clipper2 REQUIRED)
|
find_package(clipper2 REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package(ICU 77.1 REQUIRED COMPONENTS uc)
|
||||||
|
|
||||||
if(NOT EMSCRIPTEN)
|
if(NOT EMSCRIPTEN)
|
||||||
if((NOT ANDROID) AND (NOT LINUX))
|
if((NOT ANDROID) AND (NOT LINUX))
|
||||||
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3-shared)
|
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3-shared)
|
||||||
|
|
@ -237,12 +246,6 @@ find_package(zstd REQUIRED)
|
||||||
message("Skia root: " ${SKIA_INCLUDE})
|
message("Skia root: " ${SKIA_INCLUDE})
|
||||||
message("Build type: " ${CMAKE_BUILD_TYPE})
|
message("Build type: " ${CMAKE_BUILD_TYPE})
|
||||||
|
|
||||||
if(ANDROID)
|
|
||||||
add_library(main SHARED ${sources})
|
|
||||||
else()
|
|
||||||
add_executable(main ${sources})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT ANDROID)
|
if(NOT ANDROID)
|
||||||
set_target_properties(main PROPERTIES OUTPUT_NAME "infinipaint")
|
set_target_properties(main PROPERTIES OUTPUT_NAME "infinipaint")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -402,6 +405,8 @@ elseif(LINUX)
|
||||||
set(SDL_WAYLAND ON CACHE BOOL "Compile SDL for Wayland")
|
set(SDL_WAYLAND ON CACHE BOOL "Compile SDL for Wayland")
|
||||||
set(SDL_X11 ON CACHE BOOL "Compile SDL for X11")
|
set(SDL_X11 ON CACHE BOOL "Compile SDL for X11")
|
||||||
set(SDL_AUDIO OFF CACHE BOOL "Compile SDL Audio")
|
set(SDL_AUDIO OFF CACHE BOOL "Compile SDL Audio")
|
||||||
|
set(SDL_STATIC ON CACHE BOOL "Compile SDL statically")
|
||||||
|
set(SDL_SHARED OFF CACHE BOOL "Compile SDL dynamically")
|
||||||
add_subdirectory(deps/SDL EXCLUDE_FROM_ALL)
|
add_subdirectory(deps/SDL EXCLUDE_FROM_ALL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
5
linuxinstall/AppRun
Executable file
5
linuxinstall/AppRun
Executable 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" "$@"
|
||||||
13
linuxinstall/appimage_infinipaint.desktop
Normal file
13
linuxinstall/appimage_infinipaint.desktop
Normal 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
|
||||||
5
linuxinstall/appimagebuilddir/.gitignore
vendored
Normal file
5
linuxinstall/appimagebuilddir/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
AppDir
|
||||||
|
buildarea
|
||||||
|
builddir
|
||||||
|
InfiniPaint-x86_64.AppImage
|
||||||
|
appimagetool.AppImage
|
||||||
7
linuxinstall/appimagebuilddir/cleanup_build.sh
Executable file
7
linuxinstall/appimagebuilddir/cleanup_build.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
rm -rf builddir
|
||||||
|
rm -rf buildarea
|
||||||
|
rm -rf AppDir
|
||||||
6
linuxinstall/appimagebuilddir/create_appimage.sh
Executable file
6
linuxinstall/appimagebuilddir/create_appimage.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
rm -rf AppDir
|
||||||
|
./create_appimage_appdir.sh
|
||||||
|
./appimagetool.AppImage AppDir
|
||||||
38
linuxinstall/appimagebuilddir/create_appimage_appdir.sh
Executable file
38
linuxinstall/appimagebuilddir/create_appimage_appdir.sh
Executable 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
|
||||||
186
linuxinstall/appimagebuilddir/setup_and_compile.sh
Executable file
186
linuxinstall/appimagebuilddir/setup_and_compile.sh
Executable 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
|
||||||
|
|
@ -12,7 +12,8 @@ modules:
|
||||||
subdir: source
|
subdir: source
|
||||||
build-commands:
|
build-commands:
|
||||||
- chmod +x runConfigureICU configure install-sh
|
- 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 -j$(nproc)
|
||||||
- make install
|
- make install
|
||||||
sources:
|
sources:
|
||||||
|
|
@ -126,7 +127,7 @@ cleanup:
|
||||||
- /bin/proto*
|
- /bin/proto*
|
||||||
- /lib/*.a
|
- /lib/*.a
|
||||||
- /lib/libicui18n*
|
- /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/zstd*
|
||||||
- /bin/unzstd
|
- /bin/unzstd
|
||||||
|
|
||||||
|
|
|
||||||
4
linuxinstall/flatpakbuilddir/.gitignore
vendored
Normal file
4
linuxinstall/flatpakbuilddir/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
repo
|
||||||
|
builddir
|
||||||
|
.flatpak-builder
|
||||||
|
infinipaint.flatpak
|
||||||
5
linuxinstall/flatpakbuilddir/create_flatpak.sh
Executable file
5
linuxinstall/flatpakbuilddir/create_flatpak.sh
Executable 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue