Commit 58a3efb3 authored by Jérome Perrin's avatar Jérome Perrin

Fix missing rpaths on components

Because of a bug in `slapos/testcase`, ldd check was not properly reporting several problems, because several components were using system libraries.

These are the changes to profiles, adding the missing rpath and other changes so that components do not use system libraries either by explicitly providing the libraries so that the configure script does not use system development libraries if they are available ( like for zstd ) or by disabling the features at compile time for features we don't use ( like the `--without-icu` for boost )

See merge request !732
parents 5770e533 573b8e26
...@@ -4,6 +4,7 @@ parts = attr ...@@ -4,6 +4,7 @@ parts = attr
[attr] [attr]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true
url = http://download.savannah.gnu.org/releases/attr/attr-2.4.47.src.tar.gz url = http://download.savannah.gnu.org/releases/attr/attr-2.4.47.src.tar.gz
md5sum = 84f58dec00b60f2dc8fd1c9709291cc7 md5sum = 84f58dec00b60f2dc8fd1c9709291cc7
configure-options = configure-options =
......
...@@ -5,6 +5,7 @@ extends = ...@@ -5,6 +5,7 @@ extends =
../bzip2/buildout.cfg ../bzip2/buildout.cfg
../gcc/buildout.cfg ../gcc/buildout.cfg
../zlib/buildout.cfg ../zlib/buildout.cfg
../xz-utils/buildout.cfg
[boost-lib] [boost-lib]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
...@@ -12,14 +13,16 @@ shared = true ...@@ -12,14 +13,16 @@ shared = true
url = http://downloads.sourceforge.net/sourceforge/boost/boost_1_67_0.tar.bz2 url = http://downloads.sourceforge.net/sourceforge/boost/boost_1_67_0.tar.bz2
md5sum = ced776cb19428ab8488774e1415535ab md5sum = ced776cb19428ab8488774e1415535ab
location = @@LOCATION@@ location = @@LOCATION@@
configure-command = ./bootstrap.sh --prefix=${:location} --with-python=${python2.7:location}/bin/python2.7 configure-command = ./bootstrap.sh --prefix=${:location} --with-python=${python2.7:location}/bin/python2.7 --without-icu
make-binary = make-binary =
make-options = make-options =
make-targets = for a in $MAKEFLAGS; do case $a in -j*) j=$a; break;; esac; done; make-targets = for a in $MAKEFLAGS; do case $a in -j*) j=$a; break;; esac; done;
./b2 $j link=shared dll-path=${:location}/lib:${bzip2:location}/lib:${gcc:location}/lib:${gcc:location}/lib64:${zlib:location}/lib install ./b2 $j link=shared dll-path=${:location}/lib:${bzip2:location}/lib:${gcc:location}/lib:${gcc:location}/lib64:${zlib:location}/lib:${xz-utils:location}/lib install
environment = environment =
PATH=${gcc:location}/bin:%(PATH)s PATH=${gcc:location}/bin:%(PATH)s
BZIP2_INCLUDE=${bzip2:location}/include BZIP2_INCLUDE=${bzip2:location}/include
BZIP2_LIBPATH=${bzip2:location}/lib BZIP2_LIBPATH=${bzip2:location}/lib
ZLIB_INCLUDE=${zlib:location}/include ZLIB_INCLUDE=${zlib:location}/include
ZLIB_LIBPATH=${zlib:location}/lib ZLIB_LIBPATH=${zlib:location}/lib
LZMA_INCLUDE=${xz-utils:location}/include
LZMA_LIBRARY_PATH=${xz-utils:location}/lib
\ No newline at end of file
...@@ -13,4 +13,4 @@ environment = ...@@ -13,4 +13,4 @@ environment =
PATH=${sqlite3:location}/bin:%(PATH)s PATH=${sqlite3:location}/bin:%(PATH)s
CPPFLAGS=-I${openssl:location}/include -I${sqlite3:location}/include -I${libevent2:location}/include CPPFLAGS=-I${openssl:location}/include -I${sqlite3:location}/include -I${libevent2:location}/include
CFLAGS=-I${libevent2:location}/include CFLAGS=-I${libevent2:location}/include
LDFLAGS=-L${openssl:location}/lib -Wl,-rpath -Wl,${openssl:location}/lib -L${sqlite3:location}/lib -L${libevent2:location}/lib -Wl,-rpath -Wl,${libevent2:location}/lib LDFLAGS=-L${openssl:location}/lib -Wl,-rpath -Wl,${openssl:location}/lib -L${sqlite3:location}/lib -Wl,-rpath -Wl,${sqlite3:location}/lib -L${libevent2:location}/lib -Wl,-rpath -Wl,${libevent2:location}/lib
...@@ -6,32 +6,23 @@ extends = ...@@ -6,32 +6,23 @@ extends =
parts = libcap parts = libcap
[libcap2] [libcap2]
recipe = slapos.recipe.build recipe = slapos.recipe.cmmi
shared = true
url = http://pkgs.fedoraproject.org/lookaside/pkgs/libcap/libcap-2.22.tar.bz2/ce64058bdb3f086ddbfca8ce6c919845/libcap-2.22.tar.bz2 url = http://pkgs.fedoraproject.org/lookaside/pkgs/libcap/libcap-2.22.tar.bz2/ce64058bdb3f086ddbfca8ce6c919845/libcap-2.22.tar.bz2
md5sum = ce64058bdb3f086ddbfca8ce6c919845 md5sum = ce64058bdb3f086ddbfca8ce6c919845
attr-include = ${attr:location}/include/ location = @@LOCATION@@
attr-lib = ${attr:location}/lib/ configure-command = :
slapos_promise = make-options =
directory:sbin RAISE_SETFCAP=no
directory:include prefix=${:location}
statlib:lib/libcap.a CFLAGS=-I${attr:location}/include/
file:lib/libcap.so LDFLAGS="-L${attr:location}/lib/ -Wl,-rpath=${attr:location}/lib/ -Wl,-rpath=${:location}/lib/"
file:sbin/getcap install
file:sbin/setcap
install = # if lib64 exists, then create a symlink from lib to lib64
import os post-install =
url = self.download(options['url'], options['md5sum']) cd ${:location}
extract_dir = self.extract(url) [ -d lib64 ] && ln -s lib64 lib
workdir = guessworkdir(extract_dir)
cflags = '-I%(attr-include)s' % options
ldflags = '-L%(attr-lib)s -Wl,-rpath=%(attr-lib)s' % options
call(['make', 'CFLAGS=' + cflags, 'LDFLAGS=' + ldflags, 'DESTDIR=' + location, 'RAISE_SETFCAP=no', 'prefix=', 'install'],
cwd=workdir, env=self.environ)
lib64 = os.path.join(location, 'lib64')
lib = os.path.join(location, 'lib')
# XXX: Dirty if case
# if lib64 exists, then create a symlink from lib to lib64
os.path.exists(lib64) and os.symlink(lib64, lib)
[libcap] [libcap]
<= libcap2 <= libcap2
\ No newline at end of file
...@@ -26,4 +26,4 @@ environment = ...@@ -26,4 +26,4 @@ environment =
PATH=${cmake:location}/bin:%(PATH)s PATH=${cmake:location}/bin:%(PATH)s
CMAKE_INCLUDE_PATH=${zlib:location}/include:${bzip2:location}/include CMAKE_INCLUDE_PATH=${zlib:location}/include:${bzip2:location}/include
CMAKE_LIBRARY_PATH=${zlib:location}/lib:${bzip2:location}/lib CMAKE_LIBRARY_PATH=${zlib:location}/lib:${bzip2:location}/lib
LDFLAGS=-L${:location}/lib -Wl,-rpath=${:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib LDFLAGS=-L${:location}/lib -Wl,-rpath=${:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib
...@@ -5,6 +5,7 @@ parts = ...@@ -5,6 +5,7 @@ parts =
[lz4] [lz4]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/lz4/lz4/archive/v1.9.2.tar.gz url = https://github.com/lz4/lz4/archive/v1.9.2.tar.gz
md5sum = 3898c56c82fb3d9455aefd48db48eaad md5sum = 3898c56c82fb3d9455aefd48db48eaad
configure-command = true configure-command = true
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
parts = parts =
nano nano
extends = extends =
../file/buildout.cfg ../file/buildout.cfg
../zlib/buildout.cfg
../ncurses/buildout.cfg ../ncurses/buildout.cfg
[nano] [nano]
...@@ -17,8 +18,8 @@ location = @@LOCATION@@ ...@@ -17,8 +18,8 @@ location = @@LOCATION@@
environment= environment=
PKG_CONFIG=false PKG_CONFIG=false
NCURSESW_CONFIG=${ncurses:location}/bin/ncursesw6-config NCURSESW_CONFIG=${ncurses:location}/bin/ncursesw6-config
CPPFLAGS=-I${file:location}/include CPPFLAGS=-I${file:location}/include -I${zlib:location}/include
LDFLAGS=-L${file:location}/lib/ -Wl,-rpath=${file:location}/lib/ LDFLAGS=-L${file:location}/lib/ -Wl,-rpath=${file:location}/lib/ -L${zlib:location}/lib/ -Wl,-rpath=${zlib:location}/lib/
post-install = post-install =
cd ${:location} && mkdir etc && cd ${:location} && mkdir etc &&
echo include "${:location}/share/nano/*.nanorc" > etc/nanorc echo include "${:location}/share/nano/*.nanorc" > etc/nanorc
[buildout] [buildout]
extends =
../zlib/buildout.cfg
parts = protobuf parts = protobuf
[protobuf] [protobuf]
...@@ -6,9 +9,13 @@ recipe = slapos.recipe.cmmi ...@@ -6,9 +9,13 @@ recipe = slapos.recipe.cmmi
shared = true shared = true
url = https://github.com/google/protobuf/releases/download/v3.4.0/protobuf-python-3.4.0.tar.gz url = https://github.com/google/protobuf/releases/download/v3.4.0/protobuf-python-3.4.0.tar.gz
md5sum = 0820cc2e56d71aef8e99794fcbd184cd md5sum = 0820cc2e56d71aef8e99794fcbd184cd
environment =
LDFLAGS=-Wl,-rpath=${zlib:location}/lib
[protobuf-cpp] [protobuf-cpp]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = https://github.com/google/protobuf/releases/download/v3.4.0/protobuf-cpp-3.4.0.tar.gz url = https://github.com/google/protobuf/releases/download/v3.4.0/protobuf-cpp-3.4.0.tar.gz
md5sum = 6d59dad503bea5ad420fd09ddad84481 md5sum = 6d59dad503bea5ad420fd09ddad84481
environment =
LDFLAGS=-Wl,-rpath=${zlib:location}/lib
\ No newline at end of file
[buildout] [buildout]
extends = ../zlib/buildout.cfg extends =
../zlib/buildout.cfg
../xz-utils/buildout.cfg
../lz4/buildout.cfg
parts = parts =
zstd zstd
[zstd] [zstd]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/facebook/zstd/releases/download/v${:version}/zstd-${:version}.tar.gz url = https://github.com/facebook/zstd/releases/download/v${:version}/zstd-${:version}.tar.gz
version = 1.4.4 version = 1.4.4
md5sum = 487f7ee1562dee7c1c8adf85e2a63df9 md5sum = 487f7ee1562dee7c1c8adf85e2a63df9
shared = true
location = @@LOCATION@@ location = @@LOCATION@@
configure-command = : configure-command = :
environment = environment =
PREFIX=${:location} PREFIX=${:location}
LD_FLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${xz-utils:location}/lib -Wl,-rpath=${xz-utils:location}/lib -L${lz4:location}/lib -Wl,-rpath=${lz4:location}/lib
CFLAGS=-I${zlib:location}/include CFLAGS=-I${zlib:location}/include -I${xz-utils:location}/include -I${lz4:location}/include
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment