This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
kicad-builder-docker/build-docker.sh

54 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
cd "$1"
BUILD_TYPE="$2"
if [ -z "$BUILD_TYPE" ]; then
BUILD_TYPE="Debug"
fi
mkdir build
cd build
rm -rf AppDir
cmake \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=/usr \
-DKICAD_SCRIPTING_PYTHON3=on \
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=on \
../
make -j$(nproc) --output-sync
if [ $? -ne 0 ]; then
exit 10
fi
make install DESTDIR=AppDir
mkdir -p AppDir/usr/lib/python3/dist-packages/
cp -r /usr/lib/python3/dist-packages/wx \
/usr/lib/python3/dist-packages/wxPython-4.0.4.egg-info \
AppDir/usr/lib/python3/dist-packages/
mv AppDir/usr/bin/kicad AppDir/usr/bin/kicad_bin
cat << "EOF" > AppDir/usr/bin/kicad
#!/bin/sh
HERE="$(dirname "$(readlink -f "${0}")")/../../"
export PYTHON_PATH="${HERE}"/usr/lib/python3:${PYTHON_PATH}
exec "${HERE}/usr/bin/kicad_bin" "$@"
EOF
chmod +x AppDir/usr/bin/kicad
LD_LIBRARY_PATH=$(pwd)/AppDir/usr/lib/x86_64-linux-gnu/ linuxdeploy \
--appimage-extract-and-run \
--appdir AppDir \
-d $(pwd)/AppDir/usr/share/applications/kicad.desktop \
--output appimage
mv KiCad*.AppImage ../KiCad-$(git describe).AppImage