Hi Again,

On 11/3/22 21:31, Bojan Smojver via devel wrote:
> This may be a trivial question, but my friend Google is not showing me any 
> obvious answers, so I will ask here at my own peril.
> 
> Say one needs to configure and build the same source with two (or more) 
> different sets of options that generate different binary RPMs, but which have 
> files in exactly the same place. This is to support different hardware. The 
> end result would be mutually conflicting binary packages that users then 
> install etc.
> 
> Sure, it is easy enough to configure/build repeatedly and stash the results 
> into non-conflicting paths of buildroot, but how does one then package this 
> in %files sections into exactly the same paths?
> 
> If there is an example floating somewhere, that would be very useful.

I just realized that my IPU6 plans might be useful for you
regardless of if that is your use case too.

So the IPU6 userspace bits consist of a bunch of closed source
.so files in 2 different variants for 2 different hw generations.

Against this a libcamerahal.so gets build, which build is
also hw generation specific.

And then there is a gstreamer-1.0 plugin which consumes
libcamerahal.so, but which build is not hw generation specific
(AFAICT, still need to verify this).

I want support for both hw generations to be installed
at the same time, rather then have 2 conflicting subpackages
because I don't want users to have to know which generation
they exactly have. And I want this to work with a read-only
/usr.

So here is what I've come up with (from my own notes,
so might be a bit cryptic):

  -Rename libcamerahal.so to libcamerahal-ipu6<ver>.so and patch in a rpath
   to /usr/lib64/ipu6<ver> for the other libs, then make libcamerahal.so
   a symlink to /run/libcamerahal.so which is a symlink to the one we
   actual want; and have udev-rules dynamically set /run/libcamerahal.so
   symlink
  -See: https://github.com/Linuxbrew/legacy-linuxbrew/issues/7 for ideas to set
   the rpath
  -Needs something to allow building on non IPU6 systems -> hack .pc file
   to just always point to the plain (tgl) ipu6 version
  -Patch hal s|share/defaults/etc|share/defaults/etc/ipu6| for different etc 
dirs per
   IPU6 version

Maybe the rpath tricks + making the actual lib (or binary) a link to /run/foo
and then have a udev rule create /run/foo to point to the right version
depending on the hw it is running on might be useful for you too ?

Regards,

Hans


_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to