Skip to content

Commit

Permalink
test: does $DYLD_LIBRARY_PATH fix python bindings?
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Jan 8, 2024
1 parent 7385e1e commit c5ea761
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
17 changes: 14 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,25 @@ project_description = 'Implementation Guardian of Analysis Algorithms'
# resolve dependencies
fmt_dep = dependency('fmt', version: '>=9.1.0', method: 'pkg-config')
hipo_dep = dependency('hipo4', version: '>=4.0.1', method: 'pkg-config')
full_dep_list = [
fmt_dep,
hipo_dep,
]

# dependency libdirs
dep_lib_paths = []
foreach dep : full_dep_list
dep_lib_paths += dep.get_variable(pkgconfig: 'libdir')
endforeach

# general project vars
project_lib_rpath = '$ORIGIN'
project_inc = include_directories('src')
project_libs = []
project_deps = declare_dependency(dependencies: [ fmt_dep, hipo_dep ])
project_deps = declare_dependency(dependencies: full_dep_list)
project_pkg_vars = [
'dep_pkgconfigdirs=' + ':'.join(get_option('pkg_config_path'))
'dep_pkgconfigdirs=' + ':'.join(get_option('pkg_config_path')),
'dep_libdirs=' + ':'.join(dep_lib_paths),
]

# build and install shared libraries
Expand All @@ -40,7 +51,7 @@ pkg.generate(
name: meson.project_name(),
description: project_description,
libraries: project_libs,
requires: [ fmt_dep, hipo_dep ],
requires: full_dep_list,
variables: project_pkg_vars,
)

Expand Down
9 changes: 9 additions & 0 deletions meson/this_iguana.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ dep_pkgconfigdirs=$(pkg-config --variable dep_pkgconfigdirs iguana)
iguana_pythonpath=$(pkg-config --variable pythonpath iguana)
[ -n "${iguana_pythonpath-}" ] && export PYTHONPATH=$iguana_pythonpath${PYTHONPATH:+:${PYTHONPATH}}

# TEST: hack ld path for mac
for var in libdir dep_libdirs; do
dir=$(pkg-config --variable $var iguana)
# FIXME: support LD_LIBRARY_PATH too
# FIXME: uniqueness of path entries
[ -n "${dir-}" ] && export DYLD_LIBRARY_PATH=$dir${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
done

echo """
Iguana Environment Variables
----------------------------
PKG_CONFIG_PATH = ${PKG_CONFIG_PATH-}
PYTHONPATH = ${PYTHONPATH-}
DYLD_LIBRARY_PATH = ${DYLD_LIBRARY_PATH-}
----------------------------
"""

0 comments on commit c5ea761

Please sign in to comment.