Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
esp-idf-nix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mr. Snow Ball / projects
esp-idf-nix
Commits
d03852c0
Commit
d03852c0
authored
4 years ago
by
test_nonet
Browse files
Options
Downloads
Patches
Plain Diff
split build phase
Parts of the old buildPhase actually belong in unpack or configure.
parent
6c861634
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
esp32-tools.nix
+15
-14
15 additions, 14 deletions
esp32-tools.nix
with
15 additions
and
14 deletions
esp32-tools.nix
+
15
−
14
View file @
d03852c0
{
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 )
''
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment