summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authordarmac <xiaojun2@hisilicon.com>2021-02-07 10:49:42 +0800
committerGitHub <noreply@github.com>2021-02-07 02:49:42 +0000
commit7020c8687450b5dc16e1e35c257aa8998db9ddc6 (patch)
treed8c5d4be52fa075b987d623d79ce404c7e859a91 /var
parentf3f8a72bbdea3568196771d9b19e222836013084 (diff)
downloadspack-7020c8687450b5dc16e1e35c257aa8998db9ddc6.tar.gz
spack-7020c8687450b5dc16e1e35c257aa8998db9ddc6.tar.bz2
spack-7020c8687450b5dc16e1e35c257aa8998db9ddc6.tar.xz
spack-7020c8687450b5dc16e1e35c257aa8998db9ddc6.zip
r-rmariadb: add mariadb library path (#21406)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/r-rmariadb/configure_add_rpath.patch13
-rw-r--r--var/spack/repos/builtin/packages/r-rmariadb/package.py9
2 files changed, 22 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/r-rmariadb/configure_add_rpath.patch b/var/spack/repos/builtin/packages/r-rmariadb/configure_add_rpath.patch
new file mode 100644
index 0000000000..a5c865400f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r-rmariadb/configure_add_rpath.patch
@@ -0,0 +1,13 @@
+diff --git a/configure b/configure
+index 6c0f43c..bd7f627 100755
+--- a/configure
++++ b/configure
+@@ -29,7 +29,7 @@ fi
+ if [ "$INCLUDE_DIR" ] || [ "$LIB_DIR" ]; then
+ echo "Found INCLUDE_DIR and/or LIB_DIR!"
+ PKG_CFLAGS="-I$INCLUDE_DIR $PKG_CFLAGS"
+- PKG_LIBS="-L$LIB_DIR $PKG_LIBS"
++ PKG_LIBS="-L$LIB_DIR -Wl,-rpath,$LIB_DIR $PKG_LIBS"
+ elif [ "$PKGCONFIG_CFLAGS" ] || [ "$PKGCONFIG_LIBS" ]; then
+ echo "Found mysql_config/mariadb_config cflags and libs!"
+ PKG_CFLAGS=${PKGCONFIG_CFLAGS}
diff --git a/var/spack/repos/builtin/packages/r-rmariadb/package.py b/var/spack/repos/builtin/packages/r-rmariadb/package.py
index c7c818a817..251e8c0be9 100644
--- a/var/spack/repos/builtin/packages/r-rmariadb/package.py
+++ b/var/spack/repos/builtin/packages/r-rmariadb/package.py
@@ -29,3 +29,12 @@ class RRmariadb(RPackage):
depends_on('r-bh', type=('build', 'run'))
depends_on('r-plogr', type=('build', 'run'))
depends_on('mariadb-client')
+
+ patch('configure_add_rpath.patch')
+
+ def configure_vars(self):
+ lib_dir = self.spec['mariadb-client'].prefix.lib.mariadb
+ inc_dir = self.spec['mariadb-client'].prefix.include.mariadb
+ args = ['LIB_DIR={0}'.format(lib_dir),
+ 'INCLUDE_DIR={0}'.format(inc_dir)]
+ return args