Skip to content

Commit

Permalink
fix(extensions): add blas and lapack to library paths
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Schvezov <[email protected]>
  • Loading branch information
sergiusens committed May 27, 2024
1 parent 2bcbe84 commit bc4ba44
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
5 changes: 5 additions & 0 deletions extensions/desktop/kde-neon-6/launcher-specific
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ append_dir PATH "$SNAP_DESKTOP_RUNTIME/usr/games"
# Qt Libs
prepend_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH"

# blas
append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/blas"
# lapack
append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/lapack"

# Add QT_PLUGIN_PATH (Qt Modules).
append_dir QT_PLUGIN_PATH "$SNAP/usr/lib/$ARCH/qt6/plugins"
append_dir QT_PLUGIN_PATH "$SNAP/usr/lib/$ARCH"
Expand Down
18 changes: 15 additions & 3 deletions snapcraft/extensions/kde_neon_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Generic KDE NEON extension to support core22 and onwards."""

import dataclasses
import functools
import re
Expand Down Expand Up @@ -222,12 +223,23 @@ def get_part_snippet(self, *, plugin_name: str) -> Dict[str, Any]:
"LD_LIBRARY_PATH": prepend_to_env(
"LD_LIBRARY_PATH",
[
# Qt6 arch specific libs
f"/snap/{qt6_sdk_snap}/current/usr/lib/"
f"${{CRAFT_ARCH_TRIPLET_BUILD_FOR}}",
f"/snap/{kf6_sdk_snap}/current/usr/lib/"
f"${{CRAFT_ARCH_TRIPLET_BUILD_FOR}}",
"${CRAFT_ARCH_TRIPLET_BUILD_FOR}",
# Qt6 libs
f"/snap/{qt6_sdk_snap}/current/usr/lib",
# kf6 arch specific libs
f"/snap/{kf6_sdk_snap}/current/usr/lib/"
"${CRAFT_ARCH_TRIPLET_BUILD_FOR}",
# blas
f"/snap/{kf6_sdk_snap}/current/usr/lib/"
"${CRAFT_ARCH_TRIPLET_BUILD_FOR}/blas",
# lapack
f"/snap/{kf6_sdk_snap}/current/usr/lib/"
"${CRAFT_ARCH_TRIPLET_BUILD_FOR}/lapack",
# kf6 libs
f"/snap/{kf6_sdk_snap}/current/usr/lib",
# Staged libs
"$CRAFT_STAGE/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}",
"$CRAFT_STAGE/usr/lib",
"$CRAFT_STAGE/lib/",
Expand Down
10 changes: 8 additions & 2 deletions tests/unit/extensions/test_kde_neon_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,12 @@ def assert_get_part_snippet(kde_neon_6_instance):
{
"LD_LIBRARY_PATH": (
"/snap/kde-qt6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:"
"/snap/kf6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:"
"/snap/kde-qt6-core22-sdk/current/usr/lib:"
"/snap/kf6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:"
"/snap/kf6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}"
"/blas:"
"/snap/kf6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}"
"/lapack:"
"/snap/kf6-core22-sdk/current/usr/lib:"
"$CRAFT_STAGE/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:"
"$CRAFT_STAGE/usr/lib:"
Expand Down Expand Up @@ -283,8 +287,10 @@ def test_get_part_snippet_with_external_sdk(kde_neon_6_extension_with_build_snap
{
"LD_LIBRARY_PATH": (
"/snap/kde-qt6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:"
"/snap/kf6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:"
"/snap/kde-qt6-core22-sdk/current/usr/lib:"
"/snap/kf6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:"
"/snap/kf6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/blas:"
"/snap/kf6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/lapack:"
"/snap/kf6-core22-sdk/current/usr/lib:"
"$CRAFT_STAGE/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:"
"$CRAFT_STAGE/usr/lib:"
Expand Down

0 comments on commit bc4ba44

Please sign in to comment.