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:
parent
7a172c23c9
commit
83c36784ff
|
@ -199,74 +199,75 @@ let
|
|||
portInputs' = portInputs
|
||||
++ lib.concatMap (builtins.getAttr "portInputs") depotInputs';
|
||||
|
||||
in stdenv'.mkDerivation (extraAttrs // {
|
||||
pname = name;
|
||||
inherit (genodeSources) version;
|
||||
enableParallelBuilding = true;
|
||||
self = stdenv'.mkDerivation (extraAttrs // {
|
||||
pname = name;
|
||||
inherit (genodeSources) version;
|
||||
enableParallelBuilding = true;
|
||||
|
||||
nativeBuildInputs = with buildPackages.buildPackages;
|
||||
[ binutils bison flex stdenv.cc tcl which ] ++ nativeBuildInputs;
|
||||
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.
|
||||
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: " cp -r ${drv}/* $CONTRIB_DIR/;") 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
|
||||
'';
|
||||
configurePhase = let
|
||||
copyPorts = # wasteful copy
|
||||
toString
|
||||
(builtins.map (drv: " cp -r ${drv}/* $CONTRIB_DIR/;") 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 = "cp $< $@";
|
||||
# defer strip until fixup phase
|
||||
STRIP_TARGET_CMD = "cp $< $@";
|
||||
# defer strip until fixup phase
|
||||
|
||||
makefile = "tool/depot/create";
|
||||
makeFlags = [
|
||||
"genodelabs/bin/${arch}/${name}"
|
||||
makefile = "tool/depot/create";
|
||||
makeFlags = [
|
||||
"genodelabs/bin/${arch}/${name}"
|
||||
|
||||
# by default the build system will refuse to be useful
|
||||
"FORCE=1"
|
||||
"KEEP_BUILD_DIR=1"
|
||||
"UPDATE_VERSIONS=1"
|
||||
"VERBOSE="
|
||||
];
|
||||
# by default the build system will refuse to be useful
|
||||
"FORCE=1"
|
||||
"KEEP_BUILD_DIR=1"
|
||||
"UPDATE_VERSIONS=1"
|
||||
"VERBOSE="
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
rm -r depot/genodelabs/bin/${arch}/${name}/*\.build
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
rm -r depot/genodelabs/bin/${arch}/${name}/*\.build
|
||||
|
||||
local outputBinDir="''${!outputBin}/bin"
|
||||
local outputLibDir="''${!outputLib}/lib"
|
||||
find depot/genodelabs/bin/${arch}/${name} -name '*.lib.so' \
|
||||
-exec install -Dt "$outputLibDir" {} \; -delete
|
||||
if [ -d "$outputLibDir" ]; then
|
||||
pushd "$outputLibDir"
|
||||
for src in *.lib.so; do
|
||||
dst=$src
|
||||
dst="''${dst#lib}"
|
||||
dst="''${dst%.lib.so}"
|
||||
ln -s "$src" lib"$dst".so
|
||||
done
|
||||
popd
|
||||
fi
|
||||
local outputBinDir="''${!outputBin}/bin"
|
||||
local outputLibDir="''${!outputLib}/lib"
|
||||
find depot/genodelabs/bin/${arch}/${name} -name '*.lib.so' \
|
||||
-exec install -Dt "$outputLibDir" {} \; -delete
|
||||
if [ -d "$outputLibDir" ]; then
|
||||
pushd "$outputLibDir"
|
||||
for src in *.lib.so; do
|
||||
dst=$src
|
||||
dst="''${dst#lib}"
|
||||
dst="''${dst%.lib.so}"
|
||||
ln -s "$src" lib"$dst".so
|
||||
done
|
||||
popd
|
||||
fi
|
||||
|
||||
find depot/genodelabs/bin/${arch}/${name} -executable \
|
||||
-exec install -Dt "$outputBinDir" {} \;
|
||||
find depot/genodelabs/bin/${arch}/${name} -executable \
|
||||
-exec install -Dt "$outputBinDir" {} \;
|
||||
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue