-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhatch
More file actions
executable file
·113 lines (100 loc) · 3.2 KB
/
Copy pathhatch
File metadata and controls
executable file
·113 lines (100 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
set -euo pipefail
here=$(dirname "${BASH_SOURCE[0]}")
if [ $# -ne 1 ]; then
echo >&2 "usage: $0 outputdir"
exit 1
fi
out=$1
# stdtool foo
# Add the package foo to the "standard environment", making it
# available to all (subsequent) package builds even when it's not
# listed explicitly as an input.
stdenv=()
stdtool() {
stdenv+=("$out/$1")
}
# package foo [input ...]
# Build package foo with the given inputs (in addition to stdtools).
package() {
local pkg start finish
pkg=$1
shift
start=$(date -u +%s)
"$here"/build "$out/$pkg" "$here/package/$pkg" \
${stdenv:+"${stdenv[@]}"} ${@:+"${@/#/$out/}"}
finish=$(date -u +%s)
echo "$((finish - start)) $pkg" >> "$out"/times
}
mkdir -p "$out"
date -Is >> "$out"/times
# tools provided by the build machine
export PASS_PATH_THROUGH=x
package build-tools
package build-toolchain
unset PASS_PATH_THROUGH
stdtool build-tools
# bootstrap the standard environment
package make build-toolchain
stdtool make
package bad-cmp
package bad-diff bad-cmp
package mawk bad-cmp build-toolchain
package file bad-diff mawk build-toolchain
package xz bad-diff bad-cmp file mawk build-toolchain
package diffutils bad-cmp mawk xz build-toolchain
package gawk diffutils file mawk build-toolchain
stdtool xz
stdtool diffutils
stdtool gawk
# link-only packages to share sources among multiple users below
package binutils-src
package gcc-src
package glibc-src
package linux-src
package ncurses-src
# prerequisites of the cross toolchain -- basic
# ("basic" ~= "not needing another language to be installed")
package bzip2 build-toolchain
package ed build-toolchain
package gperf build-toolchain
package ncurses ncurses-src build-toolchain
package patch build-toolchain
package which build-toolchain
# prerequisites of the cross toolchain -- fancy
# ("fancy" ~= "m4, perl, and things that need them")
package m4 patch build-toolchain
package perl build-toolchain
package autoconf m4 perl build-toolchain
package automake autoconf perl build-toolchain
package bison m4 perl build-toolchain
package flex bison m4 build-toolchain
package help2man perl build-toolchain
package libtool m4 build-toolchain
package texinfo file perl build-toolchain
package bc ed texinfo build-toolchain
# the cross toolchain
package fake-wget
package toolchain-src \
binutils-src gcc-src glibc-src linux-src ncurses-src
package crosstool-ng automake bison bzip2 fake-wget file flex gperf \
help2man libtool m4 ncurses patch perl texinfo toolchain-src which \
build-toolchain
package cross-toolchain crosstool-ng build-toolchain
# packages to be installed on the target
package bash cross-toolchain build-toolchain patch
package binutils binutils-src cross-toolchain build-toolchain
package coreutils cross-toolchain
package findutils cross-toolchain
package gcc file gcc-src patch cross-toolchain build-toolchain
package grep cross-toolchain
package gzip cross-toolchain
package linux bc patch perl linux-src cross-toolchain build-toolchain
package mount cross-toolchain
package sed cross-toolchain
package tar cross-toolchain
# the filesystem of the target
package tree binutils coreutils cross-toolchain findutils gcc grep gzip \
linux mount sed bash tar
package checksums tree
sha256sum "$out"/checksums/sha256sums