Re: [libvirt] [jenkins-ci PATCH 01/17] guests: Deal with multilib path

2019-10-02 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano FidĂȘncio wrote:
> +# Add the multilib path to the LD_LIBRARY_PATH, PKG_CONFIG_PATH, and 
> GI_TYPELIB_PATH
> +# The multilib path can be discovered either using `dpkg-architecture` (on 
> Debian based
> +# machines) or by calling `rpm --eval '%{_lib}'` (on rpm based machines).

This comment is a bit verbose and basically describes the code below
step by step which is unnecessary, so I've rewritten it to read

  These search paths need to encode the OS architecture in some way
  in order to work, so use the appropriate tool to obtain this
  information and adjust them accordingly

and pushed the patch with my

  Reviewed-by: Andrea Bolognani 

I'll review the rest of the series as time permits.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [jenkins-ci PATCH 01/17] guests: Deal with multilib path

2019-10-01 Thread Fabiano FidĂȘncio
When building a project using Meson, the project will be installed
respecting the multi-library path.

In order to get the right path we should do:
- Debian based machines:
  - Use the value of `dpkg-architecture -q DEB_TARGET_MULTIARCH`
- RPM based machines:
  - Use the value of `rpm --eval '%{_lib}'`

Signed-off-by: Fabiano FidĂȘncio 
---
 guests/playbooks/update/templates/bashrc.j2 | 17 +
 1 file changed, 17 insertions(+)

diff --git a/guests/playbooks/update/templates/bashrc.j2 
b/guests/playbooks/update/templates/bashrc.j2
index 1f39cf2..794398c 100644
--- a/guests/playbooks/update/templates/bashrc.j2
+++ b/guests/playbooks/update/templates/bashrc.j2
@@ -14,6 +14,23 @@ export 
XDG_DATA_DIRS="$VIRT_PREFIX/share:/usr/share:/usr/local/share"
 export GI_TYPELIB_PATH="$VIRT_PREFIX/lib/girepository-1.0"
 export OSINFO_SYSTEM_DIR="$VIRT_PREFIX/share/osinfo"
 
+# Add the multilib path to the LD_LIBRARY_PATH, PKG_CONFIG_PATH, and 
GI_TYPELIB_PATH
+# The multilib path can be discovered either using `dpkg-architecture` (on 
Debian based
+# machines) or by calling `rpm --eval '%{_lib}'` (on rpm based machines).
+
+package_format="{{ package_format }}"
+if test "$package_format" = "deb"; then
+multilib=$(dpkg-architecture -q DEB_TARGET_MULTIARCH)
+export LD_LIBRARY_PATH="$VIRT_PREFIX/lib/$multilib:$LD_LIBRARY_PATH"
+export 
PKG_CONFIG_PATH="$VIRT_PREFIX/lib/$multilib/pkgconfig:$PKG_CONFIG_PATH"
+export 
GI_TYPELIB_PATH="$VIRT_PREFIX/lib/$multilib/girepository-1.0:$GI_TYPELIB_PATH"
+elif test "$package_format" = "rpm"; then
+multilib=$(rpm --eval '%{_lib}')
+export LD_LIBRARY_PATH="$VIRT_PREFIX/$multilib:$LD_LIBRARY_PATH"
+export PKG_CONFIG_PATH="$VIRT_PREFIX/$multilib/pkgconfig:$PKG_CONFIG_PATH"
+export 
GI_TYPELIB_PATH="$VIRT_PREFIX/$multilib/girepository-1.0:$GI_TYPELIB_PATH"
+fi
+
 # We need to ask Perl for this information, since it's used to
 # construct installation paths
 plarch=$(perl -e 'use Config; print $Config{archname}')
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list