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
965077d8
Commit
965077d8
authored
4 years ago
by
test_nonet
Browse files
Options
Downloads
Patches
Plain Diff
generate useful Nix output for sources
parent
4b42701f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
crosstool-ng--list-sources.patch
+1
-1
1 addition, 1 deletion
crosstool-ng--list-sources.patch
crosstool-to-nix.tcl
+56
-0
56 additions, 0 deletions
crosstool-to-nix.tcl
sources-to-nix-syntax.sh
+0
-4
0 additions, 4 deletions
sources-to-nix-syntax.sh
with
57 additions
and
5 deletions
crosstool-ng--list-sources.patch
+
1
−
1
View file @
965077d8
...
...
@@ -60,7 +60,7 @@ index 17384476..46140879 100644
CT_Pushd "${tmp_dir}"
- CT_Download_${devel_vcs}
+ if [ "${CT_COLLECT_SOURCES_FOR_NIXOS}" = "y" ]; then
+ echo "CT_Download_${devel_vcs}: ${devel_vcs} ${devel_url} ${devel_branch} ${devel_revision}" >>"$out"
+ echo "CT_Download_${devel_vcs}: ${devel_vcs} ${devel_url} ${devel_branch} ${devel_revision}
${pkg_name}
" >>"$out"
+ mkdir "${pkg_name}"
+ else
+ CT_Download_${devel_vcs}
...
...
This diff is collapsed.
Click to expand it.
crosstool-to-nix.tcl
0 → 100644
+
56
−
0
View file @
965077d8
#!/usr/bin/env tclsh
exec -ignorestderr nix-build release.nix -A espressif-esp32-used-sources -o result-used-sources 2>@stderr
set f
[
open result-used-sources
]
set text
[
read $f
]
close $f
file delete result-used-sources
set dummy_hash
"1111111111111111111111111111111111111111111111111111"
puts
"{"
set awaiting_digest
{}
foreach line
[
split $text
\n
]
{
if
{
$line
eq
""
}
{
continue
}
if
{[
regexp
{
\A
DoGetFile:
(
http
\S
+|ftp
\S
+
)
->
\S
+/
([
^/
]
+
)
\Z
}
$line -> url basename
]}
{
# wait for digest
dict set awaiting_digest $basename $url
}
elseif
{[
regexp
{
\A
DoVerifyDigest:
(
sha
\S
+
)
,
(
\S
+
)
,
([
^/
]
+
)
\Z
}
$line -> digestAlg chksum_file basename
]}
{
if
{
!
[
dict exists $awaiting_digest $basename
]}
{
error
"got digest for file that we didn't download:
$basename
"
}
set url
[
dict get $awaiting_digest $basename
]
dict unset awaiting_digest $basename
puts
"
\"
$basename
\"
= fetchurl {"
puts
" url =
\"
$url
\"
;"
puts
"
$digest
Alg =
\"
TODO
\"
;"
puts
" };"
}
elseif
{[
regexp
{
\A
CT_GetVersion_
}
$line
]}
{
# ignore and wait for corresponding CT_Download_*
}
elseif
{[
regexp
{
\A
CT_Download_git: git
(
\S
+
)
(
\S
*
)
(
\S
*
)
(
\S
+
)
\Z
}
$line -> url branch revision basename
]}
{
if
{[
regexp
{
\A
https?://github.com/
([
^/
]
+
)
/
([
^/
]
+
)
\Z
}
$url -> owner repo
]}
{
regsub
{
\.
git
\Z
}
$repo
{}
repo
puts
"
\"
$basename
\"
= fetchFromGitHub {"
puts
" owner =
\"
$owner
\"
;"
puts
" repo =
\"
$repo
\"
;"
puts
" rev =
\"
$branch$revision
\"
;"
puts
" sha256 =
\"
$dummy
_hash
\"
;"
puts
" };"
}
else
{
puts
"
\"
$basename
\"
= fetchgit {"
puts
" url =
\"
$url
\"
;"
puts
" rev =
\"
$branch$revision
\"
;"
puts
" sha256 =
\"
$dummy
_hash
\"
;"
puts
" };"
}
}
else
{
error
"unexpected line:
[
list $line
]
"
}
}
if
{[
dict size $awaiting_digest
]}
{
error
"files without digest:
[
dict keys $awaiting_digest
]
"
}
puts
"}"
This diff is collapsed.
Click to expand it.
sources-to-nix-syntax.sh
deleted
100644 → 0
+
0
−
4
View file @
4b42701f
#!/usr/bin/env bash
cat
$1
echo
TODO
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