2
0
Fork 0
genodepkgs/overlay/libc/default.nix

29 lines
710 B
Nix

# SPDX-License-Identifier: CC0-1.0
{ genodeSources, genodeBase }:
genodeSources.buildDepot {
name = "posix";
propagatedBuildInputs = [ genodeBase ];
portInputs = [ genodeSources.ports.libc ];
postInstall = ''
ln -s ${genodeSources.depot "libc"}/lib/* ''${!outputLib}/lib/
local headerDir="''${!outputDev}/include"
mkdir -p "$headerDir"
pushd ${genodeSources.ports.libc}/*
cp -r \
include/libc/* \
include/openlibm/* \
$GENODE_DIR/repos/libports/include/libc \
"$headerDir"
for spec in ${toString genodeSources.specs}; do
dir=include/spec/$spec/libc
if [ -d $dir ]; then
cp -r $dir/* "$headerDir"
fi
done
popd
'';
}