unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How-to solve runpath-errors when splitting packages?
@ 2019-03-05 21:05 Hartmut Goebel
  2019-04-11  8:48 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Hartmut Goebel @ 2019-03-05 21:05 UTC (permalink / raw)
  To: Guix-devel

Hi,

I'm currently packaging zbar (a bar-code scanner suite). zbar includes
"generic" binaries as well as "qt" anf "gtk" ones (zbarcam, zbarcam-qt,
zbarcam-gtk). I want to avoid having qt or gtk or even both as a
dependency of the `zbar` packages, as these would pull in *huge*
dependencies.

I already managed to split the output into several. Here is an the
file-list for zbar:qt:

/gnu/store/…-zbar-0.22-gtk/bin/zbarcam-gtk
/gnu/store/…-zbar-0.22-gtk/lib/libzbargtk.so.0.0.2
/gnu/store/…-zbar-0.22-gtk/lib/libzbargtk.a
/gnu/store/…-zbar-0.22-gtk/lib/libzbargtk.la
/gnu/store/…-zbar-0.22-gtk/include/zbar/zbargtk.h
/gnu/store/…-zbar-0.22-gtk/lib/pkgconfig/zbar-gtk.pc

Obviously zbarcam-gtk should use libzbargtk.so from the same output.

How can I make zbarcam-gtk find the lib? Any ideas?

I already tried:

0) Nothing special: phase "validate-runpath" fails.

1) Setting "#:validate-runpath? #f": build passes, but the program does
not find the lib.

2) Passing the equivalent of "LDFLAGS=-Wl,-rpath=${out_gtk}/lib
-Wl,-rpath=${out_qt}/lib" to configure. This leads to some "recursive
dependency error".

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How-to solve runpath-errors when splitting packages?
  2019-03-05 21:05 How-to solve runpath-errors when splitting packages? Hartmut Goebel
@ 2019-04-11  8:48 ` Ludovic Courtès
  2019-04-13 17:31   ` Timothy Sample
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2019-04-11  8:48 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: Guix-devel

Hi Hartmut,

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> I already managed to split the output into several. Here is an the
> file-list for zbar:qt:
>
> /gnu/store/…-zbar-0.22-gtk/bin/zbarcam-gtk
> /gnu/store/…-zbar-0.22-gtk/lib/libzbargtk.so.0.0.2
> /gnu/store/…-zbar-0.22-gtk/lib/libzbargtk.a
> /gnu/store/…-zbar-0.22-gtk/lib/libzbargtk.la
> /gnu/store/…-zbar-0.22-gtk/include/zbar/zbargtk.h
> /gnu/store/…-zbar-0.22-gtk/lib/pkgconfig/zbar-gtk.pc
>
> Obviously zbarcam-gtk should use libzbargtk.so from the same output.
>
> How can I make zbarcam-gtk find the lib? Any ideas?

Normally, the build system (QMake I suppose?) should take care of it.

In GNU configure parlance, if you do:

  ./configure --libdir=/some/thing/lib

then the build system will ensure that executables, once installed, have
/some/thing/lib in their RUNPATH.

IOW, instead of adding a post-install phase that moves files around,
make sure to pass the right libdir option to QMake or whatever.

HTH!

Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How-to solve runpath-errors when splitting packages?
  2019-04-11  8:48 ` Ludovic Courtès
@ 2019-04-13 17:31   ` Timothy Sample
  0 siblings, 0 replies; 3+ messages in thread
From: Timothy Sample @ 2019-04-13 17:31 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: Guix-devel

Hi Hartmut,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi Hartmut,
>
> Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:
>
>> I already managed to split the output into several. Here is an the
>> file-list for zbar:qt:
>>
>> /gnu/store/…-zbar-0.22-gtk/bin/zbarcam-gtk
>> /gnu/store/…-zbar-0.22-gtk/lib/libzbargtk.so.0.0.2
>> /gnu/store/…-zbar-0.22-gtk/lib/libzbargtk.a
>> /gnu/store/…-zbar-0.22-gtk/lib/libzbargtk.la
>> /gnu/store/…-zbar-0.22-gtk/include/zbar/zbargtk.h
>> /gnu/store/…-zbar-0.22-gtk/lib/pkgconfig/zbar-gtk.pc
>>
>> Obviously zbarcam-gtk should use libzbargtk.so from the same output.
>>
>> How can I make zbarcam-gtk find the lib? Any ideas?
>
> Normally, the build system (QMake I suppose?) should take care of it.
>
> In GNU configure parlance, if you do:
>
>   ./configure --libdir=/some/thing/lib
>
> then the build system will ensure that executables, once installed, have
> /some/thing/lib in their RUNPATH.
>
> IOW, instead of adding a post-install phase that moves files around,
> make sure to pass the right libdir option to QMake or whatever.

I learned a bit about this when splitting up some GNOME packages.  There
is a general problem.  Many GNOME packages don’t split things along
“libdir”/“bindir” lines, but rather core library, GUI library, and GUI
binary.  I had little luck with usual configure script flags.  It was
much easier and more reliable to patch the “*.in” files of the various
subpackages.  For an example, see “libgoa”.  The only funny thing there
is that I had to set “--libdir” back to its usual output, because we
automatically set it when an output is called “lib”.  If the output had
a different name, it wouldn’t be necessary to reset “--libdir”.

I checked what Nix does for packages with the same problem, and it looks
like they tend to move stuff after it has been installed, and then use
“patchelf” to fix up the paths.  My instinct says that this is a little
bit more brittle, but I suppose our runpath validation would keep
everything on course.

Hope that helps!


-- Tim

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-13 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-05 21:05 How-to solve runpath-errors when splitting packages? Hartmut Goebel
2019-04-11  8:48 ` Ludovic Courtès
2019-04-13 17:31   ` Timothy Sample

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).