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

try starting a build with the prefetched sources -> not working, yet

parent aa7e12e2
No related branches found
No related tags found
No related merge requests found
diff --git a/scripts/functions b/scripts/functions
index 17384476..46140879 100644
index 17384476..430c832d 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -720,6 +720,12 @@ CT_DoGetFile()
......@@ -40,21 +40,45 @@ index 17384476..46140879 100644
CT_DoLog EXTRA "Verifying detached signature for '${file}'"
case "${method}" in
packed)
@@ -1970,7 +1987,12 @@ CT_DoFetch()
@@ -1957,7 +1974,7 @@ CT_DoFetch()
elif [ "${src_devel}" = "y" ]; then
local unique_id
- if [ -z "${devel_revision}" -a "${CT_FORBID_DOWNLOAD}" = "y" ]; then
+ if [ -z "${devel_revision}" -a "${CT_FORBID_DOWNLOAD}" = "y" -a "${CT_COLLECT_SOURCES_FOR_NIXOS}" != "y" -a "${CT_USE_SOURCES_FROM_NIXOS}" != "y" ]; then
CT_Abort "${pkg_name}: cannot find most recent revisions with downloads prohibited"
fi
@@ -1970,7 +1987,14 @@ CT_DoFetch()
# this would override empty (default) values with "default branch name" and
# "most current revision", respectively.
- CT_GetVersion_${devel_vcs}
+ if [ "${CT_COLLECT_SOURCES_FOR_NIXOS}" = "y" ]; then
+ echo "CT_GetVersion_${devel_vcs}: url=${devel_url}, branch=${devel_branch}, revision=${devel_revision}" >>"$out"
+ unique_id=fake
+ unique_id=local
+ elif [ "${CT_USE_SOURCES_FROM_NIXOS}" = "y" ]; then
+ unique_id=local
+ else
+ CT_GetVersion_${devel_vcs}
+ fi
if [ -z "${unique_id}" ]; then
CT_Abort "${pkg_name}: ${devel_vcs} did not set unique ID for branch/revision"
fi
@@ -1994,7 +2016,12 @@ CT_DoFetch()
@@ -1986,6 +2010,12 @@ CT_DoFetch()
return 0
fi
+ if [ "${CT_USE_SOURCES_FROM_NIXOS}" = "y" -a -e "${CT_LOCAL_TARBALLS_DIR}/${basename}" ]; then
+ cp -aTH "${CT_LOCAL_TARBALLS_DIR}/${basename}/" "${basename}"
+ chmod -R u+w "${basename}"
+ return 0
+ fi
+
if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then
CT_DoLog WARN "Downloads forbidden, not trying ${devel_vcs} retrieval"
return 1
@@ -1994,7 +2024,12 @@ CT_DoFetch()
CT_DoLog EXTRA "Retrieving '${basename}' (${devel_vcs} ${devel_url} ${devel_branch} ${devel_revision})"
CT_MktempDir tmp_dir
CT_Pushd "${tmp_dir}"
......
......@@ -9,7 +9,7 @@ in stdenv.mkDerivation {
buildInputs = [ ncurses ];
nativeBuildInputs = [ autoconf automake bison flex unzip help2man libtool which texinfo file wget ];
patches = [ ./crosstool-ng--list-sources.patch ];
patches = [ ./crosstool-ng--sources-from-nixos.patch ];
preConfigure = ''
bash ./bootstrap
......
......@@ -43,7 +43,9 @@ foreach line [split $text \n] {
puts " };"
} elseif {[regexp {\ACT_GetVersion_} $line]} {
# ignore and wait for corresponding CT_Download_*
} elseif {[regexp {\ACT_Download_git: git (\S+) (\S*) (\S*) (\S+)\Z} $line -> url branch revision basename]} {
} elseif {[regexp {\ACT_Download_git: git (\S+) (\S*) (\S*) (\S+)\Z} $line -> url branch revision pkg_name]} {
set basename $pkg_name-git-local
if {[regexp {\Ahttps?://github.com/([^/]+)/([^/]+)\Z} $url -> owner repo]} {
regsub {\.git\Z} $repo {} repo
......
{ stdenv, fetchurl, fetchgit, fetchFromGitHub, espressif-crosstool-ng, gcc, binutils, which, lib }:
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;
additionalSources = lib.strings.concatStringsSep "\n"
(lib.attrsets.mapAttrsToList (name: drv: if drv ? outPath then "${name} ${drv.outPath}" else "") srcs2);
nativeBuildInputs = [ espressif-crosstool-ng gcc binutils which ];
dontConfigure = true;
dontInstall = true;
buildPhase = ''
unset CC CXX
ct-ng xtensa-esp32-elf
echo "CT_LOCAL_TARBALLS_DIR=$PWD/tarballs" >>.config
echo "CT_FORBID_DOWNLOAD=y" >>.config
mkdir tarballs
while read name path ; do
echo ln -s $path tarballs/$name
ln -s $path tarballs/$name
done <<<"$additionalSources"
echo "$additionalSources"
CT_USE_SOURCES_FROM_NIXOS=y \
ct-ng build
'';
}
......@@ -2,4 +2,5 @@ self: super: {
espressif-crosstool-ng = self.callPackage ./crosstool-ng.nix { };
espressif-esp32-used-sources = self.callPackage ./crosstool-to-nix.nix { };
espressif-esp32-sources = self.callPackage ./sources2.nix { };
espressif-esp32-tools = self.callPackage ./esp32-tools.nix { };
}
......@@ -33,25 +33,25 @@
url = "https://ftpmirror.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz";
sha512 = "e308af43f8b7e01e98a55f4f6c4ee4d1c39ce09d95399fa555b3f0cdf5fd0db0f4c4d820b4af78a63f6cf6d8627587114a40af48cfc066134b600520808a77ee";
};
"binutils" = fetchFromGitHub {
"binutils-git-local" = fetchFromGitHub {
owner = "espressif";
repo = "binutils-gdb";
rev = "esp-2020r3-binutils";
sha256 = "sha256-y4REODVCiUn/F6PSNTsLZjpKBWrAD9InFF0UWzYl5is=";
};
"gcc" = fetchFromGitHub {
"gcc-git-local" = fetchFromGitHub {
owner = "espressif";
repo = "gcc";
rev = "esp-2020r3";
sha256 = "sha256-qy4i/QYGdSVaxX21kIC0FgnzbzQz1+kG3rmK+LHECW8=";
};
"newlib" = fetchFromGitHub {
"newlib-git-local" = fetchFromGitHub {
owner = "espressif";
repo = "newlib-esp32";
rev = "esp-2020r3";
sha256 = "sha256-IMe+IEXVWegjyLkHnaNKzvvcVBDT9nWlcbcL0xtH86s=";
};
"gdb" = fetchFromGitHub {
"gdb-git-local" = fetchFromGitHub {
owner = "espressif";
repo = "binutils-gdb";
rev = "esp-2020r3-gdb";
......
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