Skip to content
Snippets Groups Projects
Commit d03852c0 authored by test_nonet's avatar test_nonet
Browse files

split build phase

Parts of the old buildPhase actually belong in unpack or configure.
parent 6c861634
No related branches found
No related tags found
No related merge requests found
{ lib, stdenv, fetchurl, fetchgit, fetchFromGitHub, espressif-crosstool-ng, autoconf, automake, bison, flex, unzip, help2man, libtool, which, texinfo, file, wget, gnum4, perl, ncurses, python3 }:
{ lib, stdenv, fetchurl, fetchgit, fetchFromGitHub, espressif-crosstool-ng, autoconf, automake, bison, flex, unzip, help2man, libtool,
which, texinfo, file, wget, gnum4, perl, ncurses, python3 }:
let
srcs = import ./sources.nix { inherit fetchFromGitHub; };
srcs2 = import ./sources2.nix { inherit fetchurl fetchgit fetchFromGitHub; };
in stdenv.mkDerivation {
pname = "espressif-esp32-tools";
inherit (srcs) version srcs unpackPhase;
inherit (srcs) version srcs;
additionalSources = lib.strings.concatStringsSep "\n"
(lib.attrsets.mapAttrsToList (name: drv: if drv ? outPath then "${name} ${drv.outPath}" else "") srcs2);
......@@ -14,14 +15,7 @@ in stdenv.mkDerivation {
hardeningDisable = [ "format" "pie" ];
dontConfigure = true;
buildPhase = ''
unset CC CXX
ct-ng xtensa-esp32-elf
echo "CT_LOCAL_TARBALLS_DIR=$PWD/tarballs" >>.config
echo "CT_FORBID_DOWNLOAD=y" >>.config
unpackPhase = srcs.unpackPhase + ''
mkdir tarballs
while read name path ; do
printf "%-30s -> %s\\n" $name $path
......@@ -34,12 +28,19 @@ in stdenv.mkDerivation {
ln -s $path tarballs/$name
fi
done <<<"$additionalSources"
'';
# for debugging, see `ct-ng list-steps`
#export CT_DEBUG_CT_SAVE_STEPS=y
configurePhase = ''
unset CC CXX
ct-ng xtensa-esp32-elf
CT_USE_SOURCES_FROM_NIXOS=y \
ct-ng build \
echo "CT_LOCAL_TARBALLS_DIR=$PWD/tarballs" >>.config
echo "CT_FORBID_DOWNLOAD=y" >>.config
'';
buildPhase = ''
export CT_USE_SOURCES_FROM_NIXOS=y
ct-ng build \
|| ( tail -n 100 build.log ; exit 1 )
'';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment