pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to adjust runtime search paths



On Sat, 13 Aug 2022 22:35:22 +0530
Mayuresh <mayuresh%acm.org@localhost> wrote:

> On Sat, Aug 13, 2022 at 07:09:28PM +0530, Mayuresh wrote:
> > I am trying to work around the raspberrypi-userland PLIST clash with
> > MesaLib, by changing the installation home to ${PREFIX}/raspi
> > 
> > Excerpt of the patch is:
> 
> Tried a lot of CMAKE options, but could not get it right. The Wl,-R
> options appear correct in the configuration generated, but simply
> refuses to reflect in the binaries. As a last resort I am patching
> the RPATH.
> 
>     +RASPI_PREFIX=  ${PREFIX}/raspi
>      SUBST_CLASSES+=                vc
>      SUBST_STAGE.vc=                pre-configure
>      SUBST_MESSAGE.vc=      Fixing hard-coded install paths.
>      SUBST_FILES.vc=                makefiles/cmake/vmcs.cmake
>     -SUBST_SED.vc=          -e 's,/opt/vc,${PREFIX},g'
>     +SUBST_SED.vc=          -e 's,/opt/vc,${RASPI_PREFIX},g'
>     +
>     +TOOL_DEPENDS+=      patchelf-[0-9]*:../../devel/patchelf
>     +
>     +FIX_RPATH+=    ${DESTDIR}${RASPI_PREFIX}/bin/*
>     +FIX_RPATH+=    ${DESTDIR}${RASPI_PREFIX}/sbin/*
>     +FIX_RPATH+=    ${DESTDIR}${RASPI_PREFIX}/lib/*.so
>     +FIX_RPATH+=    ${DESTDIR}${RASPI_PREFIX}/lib/plugins/*.so
>     +
>     +post-install:
>     +       for bin in ${FIX_RPATH}; do \
>     +               echo $$bin; \
>     +               ${PREFIX}/bin/patchelf --set-rpath
> ${RASPI_PREFIX}/lib $$bin; \
>     +       done
>     +
> 
> Any suggestions for a simpler solution are welcome.
> 

Hi Mayuresh, I think one way to do that you want is to use
BUILDLINK_TRANSFORM+= rpath-exact:${PREFIX}/lib:${RASPI_PREFIX}/lib
instead of using patchelf. I have not tested it myself with
raspberry-userland since I don't run arm.
rpath-exact and other transform options are documented in
mk/wrapper/gen-transform.sh .

/Niclas Rosenvik


Home | Main Index | Thread Index | Old Index