@ -125,10 +125,46 @@ let
stdenv' = pkgs . stdenvAdapters . overrideCC pkgs . stdenv toolchain ;
patchRelativeLibraries = ''
if [ - z " ' ' ${ noAbsoluteLibraries:- } " ] ; then
find " ' ' ${ ! outputBin } " " ' ' ${ ! outputLib } " - type f | while read - r elf ; do
if ! isELF " $ e l f " ; then continue ; fi
args =
for name in $ ( patchelf - - print-needed " $ e l f " ) ; do
if [ " l d . l i b . s o " == " $ n a m e " ] ; then
continue
fi
if [ - f " $ n a m e " ] ; then
continue
fi
argPair =
for input in '' ${ ! outputLib } ''$ { l i b r a r y B u i l d I n p u t s : - } ; d o
local libdir = " $ i n p u t / l i b "
local libabs = $ ( realpath " $ l i b d i r / $ n a m e " 2 > /dev/null || true )
if [ - f " $ l i b a b s " ] ; then
echo " R e p l a c e $ n a m e r e f e r e n c e w i t h $ l i b a b s "
argPair = " - - r e p l a c e - n e e d e d $ n a m e $ l i b a b s "
break
fi
done
if [ - z " $ a r g P a i r " ] ; then
echo " C o u l d n o t f i n d a b s o l u t e p a t h t o $ n a m e i n b u i l d I n p u t s "
exit 1
fi
args = " $ a r g s $ a r g P a i r "
done
if [ - n " $ a r g s " ] ; then
patchelf $ args $ elf
fi
done
fi
'' ;
buildUpstream =
# Build from the Genode sources
{ name , targets , portInputs ? [ ] , nativeBuildInputs ? [ ] , patches ? [ ]
, enableParallelBuilding ? true , meta ? { } , . . . } @ extraAttrs :
{ name , targets , portInputs ? [ ] , nativeBuildInputs ? [ ]
, buildInputs ? [ ] , patches ? [ ] , enableParallelBuilding ? true
, meta ? { } , . . . } @ extraAttrs :
let havePatches = patches != [ ] ;
in stdenv' . mkDerivation ( extraAttrs // {
@ -172,6 +208,9 @@ let
runHook postInstall
'' ;
libraryBuildInputs = map pkgs . stdenv . lib . getLib buildInputs ;
postFixup = patchRelativeLibraries ;
meta = { platforms = lib . platforms . genode ; } // meta ;
} ) ;
@ -230,6 +269,9 @@ let
runHook postInstall
'' ;
libraryBuildInputs = map pkgs . stdenv . lib . getLib buildInputs ;
postFixup = patchRelativeLibraries ;
meta = { platforms = lib . platforms . genode ; } // meta ;
} ) ;