Scratch Desktop (Scratch 3.0 Offline Editor) on GNU/Linux
Install electron
$ cd ~
$ npm install electron --save-dev
$ ls ~/node_modules/electron/dist
Extract scratch-desktop
$ rm -rf /tmp/scratch-desktop
$ mkdir /tmp/scratch-desktop
$ wget --max-redirect 5 -c -O /tmp/scratch-desktop.exe 'https://downloads.scratch.mit.edu/desktop/Scratch%20Setup.exe'
$ 7za x -aoa -y /tmp/scratch-desktop.exe -o/tmp/scratch-desktop
Create and launch electron app
$ cp -rf ~/node_modules/electron/dist/* /tmp/scratch-desktop/
$ ln -fsr /tmp/scratch-desktop/electron /tmp/scratch-desktop/scratch-desktop
$ /tmp/scratch-desktop/scratch-desktop
Fix permissions
$ chmod 755 /tmp/scratch-desktop/locales
$ chmod 755 /tmp/scratch-desktop/swiftshader
$ chmod 755 /tmp/scratch-desktop/resources
$ chmod 755 /tmp/scratch-desktop/resources/static
$ chmod 755 /tmp/scratch-desktop/resources/static/assets
Inside the app.asar
$ cd /tmp/scratch-desktop/resources/
$ ~/node_modules/.bin/asar extract app.asar app
$ cat app/package.json
Create RPM package
$ sudo dnf install rpm-build
$ cd ~
$ npm install electron-installer-redhat
$ chmod 755 /tmp/scratch-desktop/locales
$ chmod 755 /tmp/scratch-desktop/swiftshader
$ chmod 755 /tmp/scratch-desktop/resources
$ chmod 755 /tmp/scratch-desktop/resources/static
$ chmod 755 /tmp/scratch-desktop/resources/static/assets
$ ~/node_modules/.bin/electron-installer-redhat /tmp/config-rpm.json
OR
$ ~/node_modules/.bin/electron-installer-redhat --src /tmp/scratch-desktop/ --dest /tmp/ --arch x86_64
$ sudo dnf install /tmp/scratch-desktop-3.10.2-1.x86_64.rpm
Create DEB package
$ sudo apt-get install -yq npm gdebi p7zip-full
$ ls /tmp
create-deb.sh config-deb.json
$ sh /tmp/create-deb.sh
$ sudo gdebi /tmp/scratch-desktop_3.10.2_amd64.deb
While admirable, I think this might need some work
apt install -yq
will silence output and answer yes to questionsAll my built packages turned out to be the same size (which is why I'm sure it's not built real i386 or armv7l)
All this said, I was able to alter a few instructions to get this to build for several machines, so thank you.
There must be a better way? I'll follow the instructions again on an i386 vm and a raspberry pi so that I can keep a local repo for my local LUG which runs coder dojo like events