Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a precompiled version of luxcore #108

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions snap/local/snap-setup-mod/Init.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ def configure_mod_mesh():
if not param.GetString("gmshExe", ""):
param.SetString("gmshExe", "/snap/freecad/current/usr/bin/gmsh")

def configure_mod_raytracing():
import FreeCAD
param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Raytracing")
if not param.GetString("PovrayExecutable", ""):
param.SetString("PovrayExecutable", "/snap/freecad/current/usr/bin/povray")

def configure_mod_render():
import FreeCAD
param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Render")
if not param.GetString("LuxCorePath", ""):
param.SetString("LuxCorePath", "/snap/freecad/current/usr/bin/luxcoreui")

def fix_theme():
import FreeCAD
param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Bitmaps/Theme")
Expand All @@ -23,4 +35,6 @@ def fix_theme():

add_snap_pythonpath()
configure_mod_mesh()
configure_mod_raytracing()
configure_mod_render()
fix_theme()
24 changes: 20 additions & 4 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ plugs:
target: $SNAP/kf5

environment:
LD_LIBRARY_PATH: "$SNAP/usr/lib/:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/:$SNAP/kf5/usr/lib/$CRAFT_ARCH_TRIPLET/:$SNAP/kf5/usr/lib:/$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/blas:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/lapack:$LD_LIBRARY_PATH"
LD_LIBRARY_PATH: "$SNAP/lib:$SNAP/usr/lib:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET:$SNAP/kf5/usr/lib/$CRAFT_ARCH_TRIPLET:$SNAP/kf5/usr/lib:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/blas:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/lapack:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/dri:$LD_LIBRARY_PATH"
LD_PRELOAD: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/libstubchown.so
FREECAD_USER_HOME: $SNAP_USER_COMMON
GIT_EXEC_PATH: $SNAP/usr/lib/git-core
Expand Down Expand Up @@ -274,7 +274,7 @@ parts:

python-packages:
plugin: python
source: .
source: docs # avoid spurious rebuild
source-type: local
build-packages:
- libsuitesparse-dev
Expand Down Expand Up @@ -306,14 +306,30 @@ parts:
/usr/lib/${CRAFT_ARCH_TRIPLET}/graphviz/config* \
${CRAFT_PART_INSTALL}/usr/lib/${CRAFT_ARCH_TRIPLET}/graphviz/

luxcore:
plugin: dump
source: https://github.com/LuxCoreRender/LuxCore/releases/download/latest/luxcorerender-latest-linux64.tar.bz2
source-type: tar
organize:
luxcoreui: usr/bin/luxcoreui
scenes : usr/share/luxcore/scenes
'*.so*': usr/lib/$CRAFT_ARCH_TRIPLET/
stage-packages:
- libgtk-3-0
- libyaml-cpp0.7 # Missing when applying materials
stage:
- etc/
- usr/
- -usr/lib/$CRAFT_ARCH_TRIPLET/libtbb.so*

cleanup:
after: [stub-chown, freecad, python-packages, snap-setup-mod, graphviz]
after: [stub-chown, freecad, python-packages, snap-setup-mod, graphviz, luxcore]
plugin: nil
build-snaps: [kf5-5-108-qt-5-15-10-core22-sdk]
override-prime: |
set -eux
for snap in "kf5-5-108-qt-5-15-10-core22-sdk"; do # List all content-snaps you're using here
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$CRAFT_PRIME/{}" "$CRAFT_PRIME/usr/{}" \;
cd "/snap/$snap/current" && find . -type f,l -not -name 'libgif*.so*' -exec rm -f "$CRAFT_PRIME/{}" "$CRAFT_PRIME/usr/{}" \;
done
for cruft in bug lintian man; do
rm -rf $CRAFT_PRIME/usr/share/$cruft
Expand Down