@ -199,74 +199,75 @@ let
portInputs' = portInputs
++ lib . concatMap ( builtins . getAttr " p o r t I n p u t s " ) depotInputs' ;
in stdenv' . mkDerivation ( extraAttrs // {
pname = name ;
inherit ( genodeSources ) version ;
enableParallelBuilding = true ;
nativeBuildInputs = with buildPackages . buildPackages ;
[ binutils bison flex stdenv . cc tcl which ] ++ nativeBuildInputs ;
src = genodeSources ;
# The genode source tree must be copied to the build directory
# because the depot tool must modify the source tree as it runs.
configurePhase = let
copyPorts = # wasteful copy
toString
( builtins . map ( drv : " c p - r ${ drv } / * $ C O N T R I B _ D I R / ; " ) portInputs' ) ;
in ''
runHook preConfigure
export GENODE_DIR = $ ( pwd )
export CONTRIB_DIR = $ GENODE_DIR/contrib
export DEPOT_DIR = $ GENODE_DIR/depot
mkdir - p $ CONTRIB_DIR ; $ { copyPorts }
chmod + rwX - R .
runHook postConfigure
'' ;
STRIP_TARGET_CMD = " c p $ < $ @ " ;
# defer strip until fixup phase
self = stdenv' . mkDerivation ( extraAttrs // {
pname = name ;
inherit ( genodeSources ) version ;
enableParallelBuilding = true ;
nativeBuildInputs = with buildPackages . buildPackages ;
[ binutils bison flex stdenv . cc tcl which ] ++ nativeBuildInputs ;
src = genodeSources ;
# The genode source tree must be copied to the build directory
# because the depot tool must modify the source tree as it runs.
configurePhase = let
copyPorts = # wasteful copy
toString
( builtins . map ( drv : " c p - r ${ drv } / * $ C O N T R I B _ D I R / ; " ) portInputs' ) ;
in ''
runHook preConfigure
export GENODE_DIR = $ ( pwd )
export CONTRIB_DIR = $ GENODE_DIR/contrib
export DEPOT_DIR = $ GENODE_DIR/depot
mkdir - p $ CONTRIB_DIR ; $ { copyPorts }
chmod + rwX - R .
runHook postConfigure
'' ;
makefile = " t o o l / d e p o t / c r e a t e " ;
makeFlags = [
" g e n o d e l a b s / b i n / ${ arch } / ${ name } "
STRIP_TARGET_CMD = " c p $ < $ @ " ;
# defer strip until fixup phase
# by default the build system will refuse to be useful
" F O R C E = 1 "
" K E E P _ B U I L D _ D I R = 1 "
" U P D A T E _ V E R S I O N S = 1 "
" V E R B O S E = "
] ;
makefile = " t o o l / d e p o t / c r e a t e " ;
makeFlags = [
" g e n o d e l a b s / b i n / ${ arch } / ${ name } "
installPhase = ''
runHook preInstall
rm - r depot/genodelabs/bin / $ { arch } / $ { name } /* \ . b u i l d
local outputBinDir = " ' ' ${ ! outputBin } / b i n "
local outputLibDir = " ' ' ${ ! outputLib } / l i b "
find depot/genodelabs/bin / $ { arch } / $ { name } - name ' * . lib . so' \
- exec install - Dt " $ o u t p u t L i b D i r " { } \ ; - delete
if [ - d " $ o u t p u t L i b D i r " ] ; then
pushd " $ o u t p u t L i b D i r "
for src in * . lib . so ; do
dst = $ src
dst = " ' ' ${ dst #lib}"
dst = " ' ' ${ dst % . lib . so } "
ln - s " $ s r c " lib " $ d s t " . so
done
popd
fi
# by default the build system will refuse to be useful
" F O R C E = 1 "
" K E E P _ B U I L D _ D I R = 1 "
" U P D A T E _ V E R S I O N S = 1 "
" V E R B O S E = "
] ;
find depot/genodelabs/bin / $ { arch } / $ { name } - executable \
- exec install - Dt " $ o u t p u t B i n D i r " { } \ ;
installPhase = ''
runHook preInstall
rm - r depot/genodelabs/bin / $ { arch } / $ { name } /* \ . b u i l d
local outputBinDir = " ' ' ${ ! outputBin } / b i n "
local outputLibDir = " ' ' ${ ! outputLib } / l i b "
find depot/genodelabs/bin / $ { arch } / $ { name } - name ' * . lib . so' \
- exec install - Dt " $ o u t p u t L i b D i r " { } \ ; - delete
if [ - d " $ o u t p u t L i b D i r " ] ; then
pushd " $ o u t p u t L i b D i r "
for src in * . lib . so ; do
dst = $ src
dst = " ' ' ${ dst #lib}"
dst = " ' ' ${ dst % . lib . so } "
ln - s " $ s r c " lib " $ d s t " . so
done
popd
fi
find depot/genodelabs/bin / $ { arch } / $ { name } - executable \
- exec install - Dt " $ o u t p u t B i n D i r " { } \ ;
runHook postInstall
'' ;
runHook postInstall
'' ;
passthru = { inherit depotInputs portInputs ; } ;
meta = { platforms = lib . platforms . genode ; } // meta ;
} ) ;
passthru = { inherit portInputs depotInputs ; } ;
meta = { platforms = lib . platforms . genode ; } // meta ;
} ) ;
in self ;
makePackages = let
overrides = import ./make-targets.nix {