Fix .deb package: bundle full conda environment with all dependencies
- Build workflow now bundles the entire pixi/conda environment for .deb - This includes all shared libraries (xerces, Qt, Python, etc.) - Wrapper scripts updated with additional env vars (QT_QPA_PLATFORM_PLUGIN_PATH, XDG_DATA_DIRS, GI_TYPELIB_PATH) - Wrapper scripts now handle both FreeCAD and freecad binary names - Removes unnecessary files (headers, cmake, pycache) to reduce size
This commit is contained in:
@@ -137,13 +137,48 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Prepare bundled environment for .deb
|
||||
shell: bash
|
||||
run: |
|
||||
# Create a bundled environment with all dependencies (like AppImage)
|
||||
# The .deb needs all libraries bundled since we can't rely on system packages
|
||||
BUNDLE_DIR="build/release/bundle"
|
||||
mkdir -p "${BUNDLE_DIR}"
|
||||
|
||||
# Copy the entire pixi/conda environment
|
||||
cp -a .pixi/envs/default/* "${BUNDLE_DIR}/"
|
||||
|
||||
# Remove unnecessary files to reduce size
|
||||
rm -rf "${BUNDLE_DIR}/include"
|
||||
rm -rf "${BUNDLE_DIR}/conda-meta"
|
||||
rm -rf "${BUNDLE_DIR}/doc"
|
||||
rm -rf "${BUNDLE_DIR}/share/gtk-doc"
|
||||
rm -rf "${BUNDLE_DIR}/lib/cmake"
|
||||
find "${BUNDLE_DIR}" -name "*.a" -delete
|
||||
find "${BUNDLE_DIR}" -name "*.h" -delete
|
||||
find "${BUNDLE_DIR}" -name "*.cmake" -delete
|
||||
find "${BUNDLE_DIR}" -path "*/__pycache__/*" -delete
|
||||
find "${BUNDLE_DIR}" -name "*.pyc" -delete
|
||||
|
||||
# Keep only necessary binaries
|
||||
if [ -d "${BUNDLE_DIR}/bin" ]; then
|
||||
mv "${BUNDLE_DIR}/bin" "${BUNDLE_DIR}/bin_tmp"
|
||||
mkdir "${BUNDLE_DIR}/bin"
|
||||
for bin in FreeCAD FreeCADCmd freecad freecadcmd python python3 ccx gmsh dot pip; do
|
||||
[ -f "${BUNDLE_DIR}/bin_tmp/${bin}" ] && cp "${BUNDLE_DIR}/bin_tmp/${bin}" "${BUNDLE_DIR}/bin/" || true
|
||||
done
|
||||
rm -rf "${BUNDLE_DIR}/bin_tmp"
|
||||
fi
|
||||
|
||||
echo "Bundle size: $(du -sh ${BUNDLE_DIR} | cut -f1)"
|
||||
|
||||
- name: Build .deb package
|
||||
shell: bash
|
||||
run: |
|
||||
# Build .deb package from installed files
|
||||
# Build .deb package from bundled environment
|
||||
# The build-deb.sh script handles version conversion to Debian format
|
||||
# (e.g., weekly-2025.01.28 -> 0~weekly.2025.01.28)
|
||||
./package/debian/build-deb.sh build/release/install build/release
|
||||
./package/debian/build-deb.sh build/release/bundle build/release
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: https://github.com/actions/upload-artifact@v3
|
||||
|
||||
37644
logs/build-build-704.log
37644
logs/build-build-704.log
File diff suppressed because one or more lines are too long
10710
logs/build-build-705.log
10710
logs/build-build-705.log
File diff suppressed because one or more lines are too long
@@ -99,9 +99,21 @@ cat > "${STAGING_DIR}/usr/bin/kindred-create" << 'WRAPPER'
|
||||
export KINDRED_CREATE_HOME="/opt/kindred-create"
|
||||
export LD_LIBRARY_PATH="${KINDRED_CREATE_HOME}/lib:${LD_LIBRARY_PATH:-}"
|
||||
export QT_PLUGIN_PATH="${KINDRED_CREATE_HOME}/lib/qt6/plugins:${QT_PLUGIN_PATH:-}"
|
||||
export QT_QPA_PLATFORM_PLUGIN_PATH="${KINDRED_CREATE_HOME}/lib/qt6/plugins/platforms:${QT_QPA_PLATFORM_PLUGIN_PATH:-}"
|
||||
export PYTHONHOME="${KINDRED_CREATE_HOME}"
|
||||
export PYTHONPATH="${KINDRED_CREATE_HOME}/lib/python3.11:${KINDRED_CREATE_HOME}/lib/python3.11/site-packages:${PYTHONPATH:-}"
|
||||
exec "${KINDRED_CREATE_HOME}/bin/FreeCAD" "$@"
|
||||
export XDG_DATA_DIRS="${KINDRED_CREATE_HOME}/share:${XDG_DATA_DIRS:-/usr/share}"
|
||||
export GI_TYPELIB_PATH="${KINDRED_CREATE_HOME}/lib/girepository-1.0:${GI_TYPELIB_PATH:-}"
|
||||
|
||||
# Try different binary names (FreeCAD or freecad depending on build)
|
||||
if [ -x "${KINDRED_CREATE_HOME}/bin/FreeCAD" ]; then
|
||||
exec "${KINDRED_CREATE_HOME}/bin/FreeCAD" "$@"
|
||||
elif [ -x "${KINDRED_CREATE_HOME}/bin/freecad" ]; then
|
||||
exec "${KINDRED_CREATE_HOME}/bin/freecad" "$@"
|
||||
else
|
||||
echo "Error: Cannot find FreeCAD binary in ${KINDRED_CREATE_HOME}/bin/" >&2
|
||||
exit 1
|
||||
fi
|
||||
WRAPPER
|
||||
chmod 755 "${STAGING_DIR}/usr/bin/kindred-create"
|
||||
|
||||
@@ -111,7 +123,16 @@ export KINDRED_CREATE_HOME="/opt/kindred-create"
|
||||
export LD_LIBRARY_PATH="${KINDRED_CREATE_HOME}/lib:${LD_LIBRARY_PATH:-}"
|
||||
export PYTHONHOME="${KINDRED_CREATE_HOME}"
|
||||
export PYTHONPATH="${KINDRED_CREATE_HOME}/lib/python3.11:${KINDRED_CREATE_HOME}/lib/python3.11/site-packages:${PYTHONPATH:-}"
|
||||
exec "${KINDRED_CREATE_HOME}/bin/FreeCADCmd" "$@"
|
||||
|
||||
# Try different binary names (FreeCADCmd or freecadcmd depending on build)
|
||||
if [ -x "${KINDRED_CREATE_HOME}/bin/FreeCADCmd" ]; then
|
||||
exec "${KINDRED_CREATE_HOME}/bin/FreeCADCmd" "$@"
|
||||
elif [ -x "${KINDRED_CREATE_HOME}/bin/freecadcmd" ]; then
|
||||
exec "${KINDRED_CREATE_HOME}/bin/freecadcmd" "$@"
|
||||
else
|
||||
echo "Error: Cannot find FreeCADCmd binary in ${KINDRED_CREATE_HOME}/bin/" >&2
|
||||
exit 1
|
||||
fi
|
||||
WRAPPER
|
||||
chmod 755 "${STAGING_DIR}/usr/bin/kindred-create-cmd"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user