contents
- Install packages
- Install Node.js
- Install npm
- Install squeak-vm
- Get squeak-vm source from github
- Install JavaScript libraries
- Run scratch-vm
- Access from your web browser
How to run Scratch 3 on FreeBSD
Install packages
Install Node.js
Currently(2017/2/26), I can't install www/node. So I use www/node6.
% cd /usr/ports/www/node6 % sudo make install (snip)
Install npm
% cd /usr/ports/www/npm % sudo make install (snip)
- Makefile
% diff -u Makefile{.orig,} --- Makefile.orig 2017-02-26 06:34:39.281186788 +0900 +++ Makefile 2017-02-26 07:50:30.217871947 +0900 @@ -11,8 +11,8 @@ LICENSE= MIT -RUN_DEPENDS= gmake:devel/gmake \ - node>=0.8.0:www/node +RUN_DEPENDS= gmake:devel/gmake +# node>=0.8.0:www/node CONFLICTS_INSTALL= npm2- npm3-
Install squeak-vm
Get squeak-vm source from github
% git clone https://github.com/LLK/scratch-vm.git
Install JavaScript libraries
Some error has occured, but don't worry. You can run scratch-vm.
% cd squeak-vm % sudo npm install (snip) npm WARN prepublish-on-install As of npm@5, `prepublish` scripts will run only for `npm publish`. npm WARN prepublish-on-install (In npm@4 and previous versions, it also runs for `npm install`.) npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information. npm WARN lifecycle scratch-vm@0.1.0~prepublish: cannot run in wd %s %s (wd=%s) scratch-vm@0.1.0 npm run build /usr/home/mutoh/github/scratch-vm npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"freebsd","arch":"x64"})
Run scratch-vm
% npm start > scratch-vm@0.1.0 start /usr/home/mutoh/github/scratch-vm > webpack-dev-server Project is running at http://0.0.0.0:8073/ webpack output is served from / Hash: 4084f08913500277662faca44f945918c3a10ec5a858cebd3798f9bb0711 Version: webpack 2.2.1 Child Hash: 4084f08913500277662f Time: 28195ms Asset Size Chunks Chunk Names scratch-vm.js 847 kB 0, 1 [emitted] [big] scratch-vm scratch-vm.min.js 351 kB 1, 0 [emitted] [big] scratch-vm.min scratch-vm.js.map 1.05 MB 0, 1 [emitted] scratch-vm chunk {0} scratch-vm.js, scratch-vm.js.map (scratch-vm) 824 kB [entry] [rendered] [2] (webpack)/buildin/global.js 509 bytes {0} {1} [built] [7] ./~/events/events.js 8.33 kB {0} {1} [built] [74] ./src/index.js 68 bytes {0} {1} [built] [75] (webpack)-dev-server/client?http://0.0.0.0:8073 5.28 kB {0} {1} [built] [95] ./~/html-entities/index.js 231 bytes {0} {1} [built] [114] ./~/punycode/punycode.js 14.7 kB {0} {1} [built] [117] ./~/querystring-es3/index.js 127 bytes {0} {1} [built] [153] ./~/strip-ansi/index.js 161 bytes {0} {1} [built] [156] ./~/url/url.js 23.3 kB {0} {1} [built] [157] ./~/url/util.js 314 bytes {0} {1} [built] [161] (webpack)-dev-server/client/overlay.js 3.6 kB {0} {1} [built] [162] (webpack)-dev-server/client/socket.js 856 bytes {0} {1} [built] [164] (webpack)/hot/emitter.js 77 bytes {0} {1} [built] [182] ./src/index.js 85 bytes {0} {1} [built] [191] multi (webpack)-dev-server/client?http://0.0.0.0:8073 ./src/index.js 40 bytes {0} {1} [built] + 177 hidden modules chunk {1} scratch-vm.min.js (scratch-vm.min) 824 kB [entry] [rendered] [2] (webpack)/buildin/global.js 509 bytes {0} {1} [built] [7] ./~/events/events.js 8.33 kB {0} {1} [built] [74] ./src/index.js 68 bytes {0} {1} [built] [75] (webpack)-dev-server/client?http://0.0.0.0:8073 5.28 kB {0} {1} [built] [95] ./~/html-entities/index.js 231 bytes {0} {1} [built] [114] ./~/punycode/punycode.js 14.7 kB {0} {1} [built] [117] ./~/querystring-es3/index.js 127 bytes {0} {1} [built] [153] ./~/strip-ansi/index.js 161 bytes {0} {1} [built] [156] ./~/url/url.js 23.3 kB {0} {1} [built] [157] ./~/url/util.js 314 bytes {0} {1} [built] [161] (webpack)-dev-server/client/overlay.js 3.6 kB {0} {1} [built] [162] (webpack)-dev-server/client/socket.js 856 bytes {0} {1} [built] [164] (webpack)/hot/emitter.js 77 bytes {0} {1} [built] [182] ./src/index.js 85 bytes {0} {1} [built] [191] multi (webpack)-dev-server/client?http://0.0.0.0:8073 ./src/index.js 40 bytes {0} {1} [built] + 177 hidden modules Child Hash: aca44f945918c3a10ec5 Time: 39347ms Asset Size Chunks Chunk Names scratch-vm.js 801 kB 0 [emitted] [big] scratch-vm scratch-vm.js.map 1 MB 0 [emitted] scratch-vm chunk {0} scratch-vm.js, scratch-vm.js.map (scratch-vm) 782 kB [entry] [rendered] [45] ./src/util/color.js 5.82 kB {0} [built] [89] (webpack)-dev-server/client?http://0.0.0.0:8073 5.28 kB {0} [built] [90] ./src/index.js 85 bytes {0} [built] [91] ./~/ansi-html/index.js 4.26 kB {0} [built] [92] ./~/ansi-regex/index.js 135 bytes {0} [built] [110] ./~/html-entities/index.js 231 bytes {0} [built] [141] ./~/sockjs-client/lib/entry.js 244 bytes {0} [built] [170] ./~/strip-ansi/index.js 161 bytes {0} [built] [173] (webpack)-dev-server/client/overlay.js 3.6 kB {0} [built] [174] (webpack)-dev-server/client/socket.js 856 bytes {0} [built] [177] (webpack)/hot/emitter.js 77 bytes {0} [built] [203] ./src/engine/runtime.js 26.2 kB {0} [built] [206] ./src/import/sb2import.js 17.2 kB {0} [built] [213] ./src/virtual-machine.js 11.1 kB {0} [built] [218] multi (webpack)-dev-server/client?http://0.0.0.0:8073 ./src/index.js 40 bytes {0} [built] + 204 hidden modules Child Hash: a858cebd3798f9bb0711 Time: 39624ms Asset Size Chunks Chunk Names media/icons/set-led_blue.svg 2.04 kB [emitted] scratch-vm.js 847 kB 0 [emitted] [big] scratch-vm scratch-vm.js.map 1.05 MB 0 [emitted] scratch-vm vendor.js.map 4.01 MB 1 [emitted] vendor media/c_arrow.svg 2.44 kB [emitted] media/1x1.gif 43 bytes [emitted] media/click.wav 49.9 kB [emitted] media/delete.wav 40.1 kB [emitted] media/dropdown-arrow-dark.svg 573 bytes [emitted] media/handclosed.cur 326 bytes [emitted] media/dropdown-arrow.svg 569 bytes [emitted] media/handdelete.cur 766 bytes [emitted] media/icons/control_repeat.svg 1.99 kB [emitted] media/icons/control_forever.svg 4.67 kB [emitted] media/handopen.cur 198 bytes [emitted] media/icons/control_stop.svg 301 bytes [emitted] media/icons/control_wait.svg 1.14 kB [emitted] media/icons/event_broadcast_blue.svg 1.65 kB [emitted] media/icons/event_broadcast_coral.svg 1.66 kB [emitted] media/icons/event_broadcast_green.svg 1.66 kB [emitted] media/icons/event_broadcast_magenta.svg 1.66 kB [emitted] media/icons/event_broadcast_orange.svg 1.66 kB [emitted] media/icons/event_broadcast_purple.svg 1.65 kB [emitted] media/icons/event_when-broadcast-received_blue.svg 1.65 kB [emitted] media/icons/event_when-broadcast-received_coral.svg 1.65 kB [emitted] media/icons/event_when-broadcast-received_magenta.svg 1.66 kB [emitted] media/icons/event_when-broadcast-received_green.svg 1.65 kB [emitted] media/icons/event_when-broadcast-received_orange.svg 1.66 kB [emitted] media/icons/event_when-broadcast-received_purple.svg 1.65 kB [emitted] media/icons/event_whenflagclicked.svg 634 bytes [emitted] vendor.js 3.41 MB 1 [emitted] [big] vendor media/icons/set-led_coral.svg 2.04 kB [emitted] media/icons/set-led_mystery.svg 2.96 kB [emitted] media/icons/set-led_green.svg 2.04 kB [emitted] media/icons/set-led_magenta.svg 2.04 kB [emitted] media/icons/set-led_orange.svg 2.04 kB [emitted] media/icons/set-led_purple.svg 2.04 kB [emitted] media/icons/set-led_white.svg 2.04 kB [emitted] media/icons/set-led_yellow.svg 2.04 kB [emitted] media/icons/wedo_motor-clockwise.svg 3.75 kB [emitted] media/icons/wedo_motor-counterclockwise.svg 3.73 kB [emitted] media/icons/wedo_motor-speed_fast.svg 4.33 kB [emitted] media/icons/wedo_motor-speed_med.svg 4.35 kB [emitted] media/icons/wedo_motor-speed_slow.svg 4.36 kB [emitted] media/icons/wedo_when-distance_close.svg 4.75 kB [emitted] media/icons/wedo_when-tilt-backward.svg 4.91 kB [emitted] media/icons/wedo_when-tilt-forward.svg 4.93 kB [emitted] media/icons/wedo_when-tilt-left.svg 3.65 kB [emitted] media/icons/wedo_when-tilt-right.svg 3.66 kB [emitted] media/icons/wedo_when-tilt.svg 4.11 kB [emitted] media/sprites.png 4.15 kB [emitted] media/sprites.svg 1.77 kB [emitted] media/turnleft_arrow.png 353 bytes [emitted] media/turnright_arrow.png 344 bytes [emitted] media/zoom-in.svg 634 bytes [emitted] media/zoom-out.svg 582 bytes [emitted] media/zoom-reset.svg 501 bytes [emitted] zenburn.css 947 bytes [emitted] index.html 3.19 kB [emitted] playground.css 1.37 kB [emitted] playground.js 11.2 kB [emitted] chunk {0} scratch-vm.js, scratch-vm.js.map (scratch-vm) 824 kB [entry] [rendered] [1] (webpack)/buildin/global.js 509 bytes {0} {1} [built] [44] (webpack)-dev-server/client?http://0.0.0.0:8073 5.28 kB {0} {1} [built] [50] ./~/ansi-regex/index.js 135 bytes {0} {1} [built] [55] ./~/html-entities/index.js 231 bytes {0} {1} [built] [60] ./~/punycode/punycode.js 14.7 kB {0} {1} [built] [63] ./~/querystring-es3/index.js 127 bytes {0} {1} [built] [95] ./~/strip-ansi/index.js 161 bytes {0} {1} [built] [97] ./~/url/url.js 23.3 kB {0} {1} [built] [99] (webpack)-dev-server/client/overlay.js 3.6 kB {0} {1} [built] [100] (webpack)-dev-server/client/socket.js 856 bytes {0} {1} [built] [102] (webpack)/hot/emitter.js 77 bytes {0} {1} [built] [126] ./src/index.js 68 bytes {0} [built] [193] ./src/index.js 85 bytes {0} [built] [199] ./src/virtual-machine.js 11.1 kB {0} [built] [202] multi (webpack)-dev-server/client?http://0.0.0.0:8073 ./src/index.js 40 bytes {0} [built] + 177 hidden modules chunk {1} vendor.js, vendor.js.map (vendor) 3.39 MB [entry] [rendered] [44] (webpack)-dev-server/client?http://0.0.0.0:8073 5.28 kB {0} {1} [built] [95] ./~/strip-ansi/index.js 161 bytes {0} {1} [built] [100] (webpack)-dev-server/client/socket.js 856 bytes {0} {1} [built] [102] (webpack)/hot/emitter.js 77 bytes {0} {1} [built] [117] ./~/script-loader/addScript.js 234 bytes {1} [built] [123] ./~/scratch-audio/dist.js 64 bytes {1} [built] [124] ./~/scratch-blocks/dist/vertical.js 64 bytes {1} [built] [125] ./~/scratch-render/dist/node/scratch-render.js 74 bytes {1} [built] [127] ./~/highlightjs/highlight.pack.min.js 248 bytes {1} [built] [128] ./~/stats.js/build/stats.min.js 242 bytes {1} [built] [160] ./~/raw-loader!./~/highlightjs/highlight.pack.min.js 470 kB {1} [built] [168] ./~/scratch-audio/dist.js 840 kB {1} [built] [169] ./~/scratch-blocks/dist/vertical.js 933 kB {1} [built] [170] ./~/scratch-render/dist/node/scratch-render.js 847 kB {1} [built] [203] multi (webpack)-dev-server/client?http://0.0.0.0:8073 stats.js/build/stats.min.js highlightjs/highlight.pack.min.js scratch-blocks/dist/vertical.js scratch-render scratch-audio 88 bytes {1} [built] + 81 hidden modules webpack: Compiled successfully.