Skip to content

Commit 811ea46

Browse files
author
Federico Fissore
committed
embedding nodejs
1 parent 7aeb972 commit 811ea46

File tree

10 files changed

+132
-0
lines changed

10 files changed

+132
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ hardware/arduino/bootloaders/caterina_LUFA/.dep/
1616
build/windows/work/
1717
build/windows/arduino-*.zip
1818
build/windows/dist/gcc-*.tar.gz
19+
build/windows/dist/node*.msi
1920
build/macosx/arduino-*.zip
2021
build/macosx/dist/gcc-*.tar.gz
22+
build/macosx/dist/node*.tar.gz
2123
build/linux/work/
2224
build/linux/dist/*.tar.gz
2325
build/linux/*.tgz

build/build.xml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@
2020
<condition property="platform"
2121
value="linux64"><os family="unix" arch="amd64" /></condition>
2222

23+
<property name="nodejs.version" value="0.8.19"/>
24+
25+
<condition property="nodejs.file" value="node-v${nodejs.version}-linux-x86.tar.gz">
26+
<equals arg1="${platform}" arg2="linux32"/>
27+
</condition>
28+
<condition property="nodejs.file" value="node-v${nodejs.version}-linux-x64.tar.gz">
29+
<equals arg1="${platform}" arg2="linux64"/>
30+
</condition>
31+
<condition property="nodejs.file" value="node-v${nodejs.version}-x86.msi">
32+
<equals arg1="${platform}" arg2="windows"/>
33+
</condition>
34+
<condition property="nodejs.file" value="node-v${nodejs.version}-darwin-x86.tar.gz">
35+
<equals arg1="${platform}" arg2="macosx"/>
36+
</condition>
37+
2338
<!-- Libraries required for running arduino -->
2439
<fileset dir=".." id="runtime.jars">
2540
<include name="core/core.jar" />
@@ -222,6 +237,8 @@
222237
<param name="target.path" value="macosx/work/Arduino.app/Contents/Resources/Java" />
223238
</antcall>
224239

240+
<antcall target="macosx-unzip-nodejs" />
241+
225242
<antcall target="macosx-unzip-arm-toolchain" />
226243

227244
<delete includeEmptyDirs="true" quiet="true">
@@ -276,6 +293,40 @@
276293
</exec>
277294
</target>
278295

296+
<target name="macosx-check-nodejs-distfile">
297+
<available file="macosx/dist/${nodejs.file}" property="nodejs_distfile_available" />
298+
</target>
299+
300+
<target name="macosx-get-nodejs" depends="macosx-check-nodejs-distfile" unless="nodejs_distfile_available">
301+
<get
302+
src="http://nodejs.org/dist/v${nodejs.version}/${nodejs.file}"
303+
dest="macosx/dist/${nodejs.file}"
304+
verbose="true" />
305+
</target>
306+
307+
<target name="macosx-unzip-nodejs" depends="macosx-get-nodejs" unless="nodejs_available">
308+
<checksum file="macosx/dist/${nodejs.file}" algorithm="sha"
309+
fileext=".sha" verifyproperty="checksum.matches"/>
310+
<condition property="checksum.matches.fail">
311+
<equals arg1="${checksum.matches}" arg2="false"/>
312+
</condition>
313+
<fail if="checksum.matches.fail">Checksum failed.
314+
315+
File ${nodejs.file} failed checksum.
316+
Please remove "macosx/dist/${nodejs.file}" to download it again.
317+
</fail>
318+
319+
<mkdir dir="macosx/work/Arduino.app/Contents/Resources/Java/nodejs"/>
320+
321+
<!-- Unzip toolchain to the destination folder -->
322+
<exec executable="tar" output="/dev/null">
323+
<arg value="xfz"/>
324+
<arg value="macosx/dist/${nodejs.file}"/>
325+
<arg value="--directory=macosx/work/Arduino.app/Contents/Resources/Java/nodejs/"/>
326+
<arg value="--strip-components=1"/>
327+
</exec>
328+
</target>
329+
279330
<!-- - - - - - - - - - - - - - - - -->
280331
<!-- Sign application for MacOSX. -->
281332
<!-- - - - - - - - - - - - - - - - -->
@@ -471,6 +522,8 @@
471522
<copy todir="linux/work" file="linux/dist/arduino" />
472523
<chmod perm="755" file="linux/work/arduino" />
473524

525+
<antcall target="linux-unzip-nodejs" />
526+
474527
<antcall target="linux-unzip-arm-toolchain" />
475528
</target>
476529

@@ -541,6 +594,40 @@
541594
</exec>
542595
</target>
543596

597+
<target name="linux-check-nodejs-distfile">
598+
<available file="linux/dist/${nodejs.file}" property="nodejs_distfile_available" />
599+
</target>
600+
601+
<target name="linux-get-nodejs" depends="linux-check-nodejs-distfile" unless="nodejs_distfile_available">
602+
<get
603+
src="http://nodejs.org/dist/v${nodejs.version}/${nodejs.file}"
604+
dest="linux/dist/${nodejs.file}"
605+
verbose="true" />
606+
</target>
607+
608+
<target name="linux-unzip-nodejs" depends="linux-get-nodejs" unless="nodejs_available">
609+
<checksum file="linux/dist/${nodejs.file}" algorithm="sha"
610+
fileext=".sha" verifyproperty="checksum.matches"/>
611+
<condition property="checksum.matches.fail">
612+
<equals arg1="${checksum.matches}" arg2="false"/>
613+
</condition>
614+
<fail if="checksum.matches.fail">Checksum failed.
615+
616+
File ${nodejs.file} failed checksum.
617+
Please remove "linux/dist/${nodejs.file}" to download it again.
618+
</fail>
619+
620+
<mkdir dir="linux/work/nodejs"/>
621+
622+
<!-- Unzip toolchain to the destination folder -->
623+
<exec executable="tar" os="Linux">
624+
<arg value="xfz"/>
625+
<arg value="linux/dist/${nodejs.file}"/>
626+
<arg value="--directory=linux/work/nodejs/"/>
627+
<arg value="--strip-components=1"/>
628+
</exec>
629+
</target>
630+
544631
<target name="linux64-get-arm-toolchain" depends="linux-check-arm-toolchain-distfile" unless="arm_distfile_available">
545632
<antcall target="linux-get-arm-toolchain" />
546633
</target>
@@ -690,6 +777,8 @@
690777
<fileset dir="windows/work" includes="**/*.html, **/*.dll, **/*.exe" />
691778
</chmod>
692779

780+
<antcall target="windows-unzip-nodejs" />
781+
693782
<antcall target="windows-unzip-arm-toolchain" />
694783

695784
<delete includeEmptyDirs="true" quiet="true">
@@ -739,6 +828,43 @@
739828
</exec>
740829
</target>
741830

831+
<target name="windows-check-nodejs-distfile">
832+
<available file="windows/dist/${nodejs.file}" property="nodejs_distfile_available" />
833+
</target>
834+
835+
<target name="windows-get-nodejs" depends="windows-check-nodejs-distfile" unless="nodejs_distfile_available">
836+
<get
837+
src="http://nodejs.org/dist/v${nodejs.version}/${nodejs.file}"
838+
dest="windows/dist/${nodejs.file}"
839+
verbose="true" />
840+
</target>
841+
842+
<target name="windows-unzip-nodejs" depends="windows-get-nodejs" unless="nodejs_available">
843+
<checksum file="windows/dist/${nodejs.file}" algorithm="sha"
844+
fileext=".sha" verifyproperty="checksum.matches"/>
845+
<condition property="checksum.matches.fail">
846+
<equals arg1="${checksum.matches}" arg2="false"/>
847+
</condition>
848+
<fail if="checksum.matches.fail">Checksum failed.
849+
850+
File ${nodejs.file} failed checksum.
851+
Please remove "windows/dist/${nodejs.file}" to download it again.
852+
</fail>
853+
854+
<mkdir dir="windows/work/nodejs"/>
855+
856+
<exec executable="windows/lessmsi/lessmsi.exe">
857+
<arg value="/x"/>
858+
<arg value="windows/dist/${nodejs.file}"/>
859+
<arg value="windows/work/nodejs/"/>
860+
</exec>
861+
862+
<move todir="windows/work/nodejs/">
863+
<fileset dir="windows/work/nodejs/SourceDir/nodejs/" />
864+
</move>
865+
<delete dir="windows/work/nodejs/SourceDir"/>
866+
</target>
867+
742868
<target name="windows-dist" depends="windows-build"
743869
description="Create .zip files of windows version">
744870

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b66b2bb829f627e3cf05bc19ba8b15092b1deb4d
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dcc0be09cf9d9ab863c720f7470a05baea2f7a18
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
685a21891320f3bfc1b878247d64c9912f83eb19
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0e41157ca1cbc43aafc3ac65bdde5564e2e13de6

build/windows/lessmsi/lessmsi.exe

76 KB
Binary file not shown.

build/windows/lessmsi/libmspackn.dll

11 KB
Binary file not shown.

build/windows/lessmsi/mspack.dll

116 KB
Binary file not shown.

build/windows/lessmsi/wix.dll

992 KB
Binary file not shown.

0 commit comments

Comments
 (0)