Propagate dependencies between depot packages

The buildDepot function now takes a "depotInputs" argument that
propagates "portInputs" and "depotInputs" across packages.

Drop the stdcxx package that includes a dev output and just use
the simple depot package for now.
This commit is contained in:
Ehmry - 2021-02-02 21:41:23 +01:00
parent 7a172c23c9
commit 83c36784ff
1 changed files with 58 additions and 57 deletions

View File

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