Commit 1de828e3 authored by Jérome Perrin's avatar Jérome Perrin

component/libreoffice-bin: adjust rpath with patchelf WIP

Instead of relying on wrapper script, modify the binary to add the
necessary rpath
parent fa10d969
......@@ -2,7 +2,14 @@
extends =
../cpio/buildout.cfg
../rpm2cpio/buildout.cfg
../cups/buildout.cfg
../dbus/buildout.cfg
../gtk-2/buildout.cfg
../xorg/buildout.cfg
../fontconfig/buildout.cfg
../util-linux/buildout.cfg
../patchelf/buildout.cfg
../defaults.cfg
parts =
libreoffice-bin
......@@ -20,6 +27,8 @@ officedir = libreoffice5.2
install =
import os
import sys
import glob
import subprocess
ARCH_DIR_MAP = { 'x86': 'x86', 'x86-64': 'x86_64' }
platform = guessPlatform()
url = options['url'] % (ARCH_DIR_MAP[platform], platform)
......@@ -42,6 +51,52 @@ install =
os.mkdir(os.path.join(location, 'basis-link'))
os.symlink(os.path.join('..', 'program'),
os.path.join(location, 'basis-link', 'program'))
# ajust rpath on executables (but not on scripts)
rpath = '%s:%s' % (os.path.join(location, 'program'), ':'.join(p.strip() for p in '''${:rpath}'''.splitlines()))
scripts = { 'gengal', 'libpython3.5m.so-gdb.py', 'python', 'sbase', 'scalc', 'sdraw', 'senddoc', 'simpress', 'smath', 'soffice', 'swriter', 'uno', 'unoinfo', 'unopkg', 'unpack_update', }
for binary in glob.glob(os.path.join(location, 'program', '*')):
if os.path.isfile(binary) and os.access(binary, os.X_OK) and os.path.basename(binary) not in scripts:
print("Adjusting rpath on", binary)
try:
subprocess.check_call(['${patchelf:location}/bin/patchelf', '--set-rpath', rpath, binary])
except Exception as e:
print (e)
import pdb; pdb.set_trace()
rpath =
${cairo:location}/lib/
${cups:location}/lib/
${cups:location}/lib64/
${dbus:location}/lib/
${dbus-glib:location}/lib/
${file:location}/lib/
${fontconfig:location}/lib/
${freetype:location}/lib/
${gcc:prefix}/lib/
${gcc:prefix}/lib64/
${glib:location}/lib/
${glu:location}/lib/
${libICE:location}/lib/
${libSM:location}/lib/
${libX11:location}/lib/
${libXau:location}/lib/
${libXdmcp:location}/lib/
${libXext:location}/lib/
${libXinerama:location}/lib/
${libXrender:location}/lib/
${libXrandr:location}/lib/
${libexpat:location}/lib/
${libffi:location}/lib/
${libffi:location}/lib64/
${libpng12:location}/lib/
${libxcb:location}/lib/
${mesa:location}/lib/
${pixman:location}/lib/
${xdamage:location}/lib/
${xfixes:location}/lib/
${zlib:location}/lib/
${util-linux:location}/lib/
# helper binaries
cpio = ${cpio:location}/bin/cpio
......
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