Skip to content

Commit bf2d5ab

Browse files
Install to local arduino copy, sort JSON files
1 parent 8a10547 commit bf2d5ab

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

build

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ subrel=${subrel:-1}
55
make="-j 2"
66
which nproc >& /dev/null && make="-j $(($(nproc) + 1))"
77
gitopt="--depth 1 --single-branch"
8-
9-
arduino=${arduino:-$HOME/Arduino/hardware/esp8266com/esp8266}
8+
arduino=${arduino:-${PWD}/arduino}
109

1110
gcc=${gcc:-4.8}
1211
case $gcc in
@@ -108,6 +107,10 @@ makejson()
108107

109108
install()
110109
{
110+
# Get a fresh copy of the Arduino tree
111+
rm -rf ${arduino}
112+
git clone https://github.com/earlephilhower/Arduino ${arduino}
113+
111114
# Need to rebuild and make install on newlib to get proper headers. Crufty, but we have an odd dir structure
112115
echo "-------- Building installable newlib"
113116
rm -rf arena/newlib-install
@@ -132,7 +135,7 @@ install()
132135
cp -a ${installnative}/xtensa-lx106-elf ${arduino}/tools/sdk/xtensa-lx106-elf
133136
echo "-------- Updating package.json"
134137
git=$(git rev-parse --short HEAD)
135-
ver=${rel}-${git}-${subrel}
138+
ver=${rel}-${subrel}-${git}
136139
pkgfile=${arduino}/package/package_esp8266com_index.template.json
137140
./patch_json.py --pkgfile "${pkgfile}" --tool xtensa-lx106-elf-gcc --ver "${ver}" --glob '*xtensa-lx106-elf*.json'
138141
./patch_json.py --pkgfile "${pkgfile}" --tool esptool --ver "${ver}" --glob '*esptool*json'
@@ -378,7 +381,7 @@ done
378381
echo "-------- Creating package tgz"
379382
markrevinfo >& build-rev-info
380383
tarball=$HOST.xtensa-lx106-elf-$(git rev-parse --short HEAD).${tarext}
381-
(rm -rf pkg && mkdir pkg && markrevinfo > pkg/build-rev-info && cd pkg && cp -a ../xtensa-lx106-elf${EXT} xtensa-lx106-elf && mv ../build-rev-info . && ${tarcmd} ${taropts} ../${tarball} xtensa-lx106-elf/)
384+
(rm -rf pkg && mkdir pkg && markrevinfo > pkg/build-rev-info && cd pkg && cp -a ../xtensa-lx106-elf${EXT} xtensa-lx106-elf && mv build-rev-info xtensa-lx106-elf && ${tarcmd} ${taropts} ../${tarball} xtensa-lx106-elf/)
382385
makejson
383386

384387
tool=mkspiffs CPPFLAGS="-DSPIFFS_USE_MAGIC_LENGTH=0 -DSPIFFS_ALIGNED_OBJECT_INDEX_TABLES=1" maketool

patch_json.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
print "Patching tool: " + args.tool + " to ver: " + args.ver
2727
data["packages"][0]["tools"][i]["version"] = args.ver
2828
data["packages"][0]["tools"][i]["systems"] = []
29-
for j in glob.glob(args.glob):
29+
bins = glob.glob(args.glob)
30+
for j in sorted(glob.glob(args.glob)):
3031
with open(j) as s:
3132
print "Adding: " + j
3233
part = json.load(s, object_pairs_hook=collections.OrderedDict)

0 commit comments

Comments
 (0)