GNOME Bugzilla – Bug 793437
Add proper PKG_CONFIG_PATH for Debian multiarch
Last modified: 2018-02-23 00:22:48 UTC
Currently in `cerbero/utils/__init__.py`, it is assumed in `add_system_libs()` that one of the pkgconfig paths is always formed with a [arch]-linux-gnu triplet. In Debian, this doesn't apply to architectures such as armel (arm-linux-gnueabi) or armhf (arm-linux-gnueabihf), or to architectures where the arch name in the triplet differs such as arm64 (aarch64-linux-gnu).
Created attachment 368333 [details] [review] Add PKG_CONFIG_PATH paths for Debian multiarch
Review of attachment 368333 [details] [review]: ::: cerbero/utils/__init__.py @@ +395,3 @@ + if Architecture.is_arm(arch) and arch != Architecture.ARM64: + if arch == Architecture.ARM: + search_paths.append(os.path.join(sysroot, 'usr/lib/arm-linux-gnueabi/pkgconfig')) Instead of doing something debian specific like this it should be usr/lib/${host}/pkgconfig and take the host from the config.. And make sure the config has the right host, possibly by adding it to the config/linux.config file
(In reply to Olivier Crête from comment #2) > Review of attachment 368333 [details] [review] [review]: > > ::: cerbero/utils/__init__.py > @@ +395,3 @@ > + if Architecture.is_arm(arch) and arch != Architecture.ARM64: > + if arch == Architecture.ARM: > + search_paths.append(os.path.join(sysroot, > 'usr/lib/arm-linux-gnueabi/pkgconfig')) > > Instead of doing something debian specific like this it should be > usr/lib/${host}/pkgconfig and take the host from the config.. And make sure > the config has the right host, possibly by adding it to the > config/linux.config file The entire point was to make it work out of the box on debian architecture.
Review of attachment 368333 [details] [review]: I would keep it in a way that make it works for Debian, but the code is a bit of a spaghetti. Try a construction like this instead maybe ? arch_path = None if arch == Architecture.ARM: arch_path = 'usr/lib/arm-linux-gnueabi/pkgconfig' elif arch == Architecture.ARM64: arch_path = 'usr/lib/aarch64-linux-gnueabi/pkgconfig' elif Architecture.is_arm(arch): arch_path = 'usr/lib/arm-linux-gnueabihf/pkgconfig' else: arch_path = 'usr/lib/%s-linux-gnu/pkgconfig' % arch search_paths.append(os.path.join(sysroot, arch_path))
Maybe also make change arch_path into host, to reduce even more the redundant strings ?
Created attachment 368720 [details] [review] Fix pkgconfig path for Debian multiarch
^ This patch worked after starting a build from scratch. Let me know if still needs more work
Review of attachment 368720 [details] [review]: Theres a typo in one of the if statements...will submit new patch with fix
Created attachment 368733 [details] [review] Fix pkgconfig path for Debian multiarch
Review of attachment 368733 [details] [review]: Looks good and clean now.
Note, I had to remove some leading white spaces, careful next time ;-P Thanks for the patch ! Attachment 368733 [details] pushed as 4fd3fe6 - Fix pkgconfig path for Debian multiarch
Thanks! Sorry about that...just configured my vim to make sure this isn't a problem in the future :p