Package Details: scratch3 3.30.5-2

Git Clone URL: https://aur.archlinux.org/scratch3.git (read-only, click to copy)
Package Base: scratch3
Description: Scratch 3.0 as a self-contained desktop application
Upstream URL: https://scratch.mit.edu
Keywords: education kids programing
Licenses: custom:BSD-3-Clause
Conflicts: scratch3-bin
Submitter: relrel
Maintainer: etaboon
Last Packager: etaboon
Votes: 9
Popularity: 0.000022
First Submitted: 2020-08-14 14:55 (UTC)
Last Updated: 2023-10-26 22:40 (UTC)

Latest Comments

« First ‹ Previous 1 2 3 4 Next › Last »

etaboon commented on 2022-01-02 12:56 (UTC) (edited on 2022-01-02 12:57 (UTC) by etaboon)

@gyurman: hi,
I know nothing about cross compiling, sorry.

If I were you, first I would give a try to scratch3-bin. See my post.

If it doesn't run, I would then try to make a direct compile so as to check
if the resulting package is usable, even if it takes 2 hours to compile.
If not, don't waste your time in trying to cross compile! It won't run any better...

If the resulting package is usable, only then I would try cross compiling (If I were you).

Don't forget to report, thanks!

gyurman commented on 2022-01-02 11:05 (UTC)

How can I build with x64 system volunteer for aarch64? Same as distccd? https://wiki.archlinux.org/title/Distcc#Cross_compiling_with_distcc

etaboon commented on 2021-12-31 03:31 (UTC)

@Gyurman: szia,
I think I found a way to successfully build the package on your device.
In fact you were almost done!

The output directory used by electron-builder is
dist/linux-arm64-unpacked because of your ARM system
instead of dist/linux-unpacked (for arch=x86_64).
Something I couldn't be aware of.

I updated the PKGBUILD: it reads now the system's architecture value
and should use the right folder accordingly. But it needs testing
since I don't have such a device.

gyurman commented on 2021-12-28 05:22 (UTC) (edited on 2021-12-28 05:23 (UTC) by gyurman)

After 2 hours build:


Fetched //cdn.assets.scratch.mit.edu/internalapi/asset/aa488de9e2c871e9d4faecd246ed737a.wav/get/
Fetched //cdn.assets.scratch.mit.edu/internalapi/asset/7d91d95d841dc6cf1282914306a4674a.wav/get/
Fetched //cdn.assets.scratch.mit.edu/internalapi/asset/199b30c8b4fe0642e849924bd1e1b463.wav/get/
Fetch succeeded.
Shutting down 5 agents.
  • electron-builder  version=22.14.5 os=5.10.83-1-MANJARO-ARM-RPI
  • loaded configuration  file=/home/gyurmo/.cache/yay/scratch3/src/scratch-desktop-3.27.0/electron-builder.yaml
  • loaded parent configuration  file=/home/gyurmo/.cache/yay/scratch3/src/scratch-desktop-3.27.0/node_modules/electron-webpack/out/electron-builder.js
  • writing effective config  file=dist/builder-effective-config.yaml
  • packaging       platform=linux arch=arm64 electron=13.6.3 appOutDir=dist/linux-arm64-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v13.6.3/electron-v13.6.3-linux-arm64.zip size=83 MB parts=8
  • downloaded      url=https://github.com/electron/electron/releases/download/v13.6.3/electron-v13.6.3-linux-arm64.zip duration=13.521s
cp: 'dist/linux-unpacked/resources/icon.png' reguláris fájl nem hozható létre: Nincs ilyen fájl vagy könyvtár
==> HIBA: Hiba történt a prepare()-ben.
    Megszakítás...
 -> error making: scratch3

etaboon commented on 2021-12-27 16:00 (UTC) (edited on 2022-01-30 19:22 (UTC) by etaboon)

From version 3.27.0-3 and later

Instead of using the windows binary, this version will build the app from sources, targeting Electron version 13.6.y.
If you prefer the other way, then install scratch3-bin instead.

Before starting the installation, please check your disk space, the PKGBUILD won't do it for you.

Total size of the build directory on my system: 1.9 GiB (2 009 713 885)

Tested successfully under KDE/Plasma X11 arch=x86_64.

Any feedback are welcomed.

unphysicalix commented on 2021-12-04 18:34 (UTC) (edited on 2021-12-04 18:41 (UTC) by unphysicalix)

Hi, I digged a bit deeper as why we can only use electron11 and only, if you copy the complete electron11 into the scratch-installation.

  • found this: https://gist.github.com/lyshie/0c49393076b8b375ca1bd98c28f95fb0#gistcomment-3808921 and found that I can let scratch run with electron11, electron13, electron14 and electron (16) using the trick to "disable" contextIsolation

  • however, the images are missing / not loading if the systemwide electron is used and only shown if electron is copied to scratch-installation. I did not find a way to circumvent this.

  • the other deprecation issues should be looked upon closely: "DeprecationWarning: Buffer()" from electron11 upwards, e.g.

  • there is another problem: electron14 and upwards do not show the "save to computer" dialog, but GTK shows an error message:

 Gtk: gtk_native_dialog_run: assertion '!priv->visible' failed

To sum up:

  • electron13 is the maximum that seems to work for now and only when copied to the scratch-installation
  • the electron13 (or whichever) does not need to be installed systemwide just for the packaging. Especially when you use a not maintained version (11).

My diff looks like this:

@@ -8,8 +8,8 @@ pkgdesc="Scratch 3.0 as a self-contained desktop application"
 arch=("any")
 url="https://scratch.mit.edu"
 license=("custom:BSD-3-Clause")
-depends=(electron11)
-makedepends=(p7zip)
+depends=()
+makedepends=(p7zip asar electron13)
 source=("https://downloads.scratch.mit.edu/desktop/Scratch%20$pkgver%20Setup.exe"
         "https://raw.githubusercontent.com/LLK/scratch-desktop/develop/LICENSE"
         "${pkgname}.sh"
@@ -18,11 +18,11 @@ source=("https://downloads.scratch.mit.edu/desktop/Scratch%20$pkgver%20Setup.exe
         "$pkgname-icons.tar.gz")
 noextract=("Scratch%20$pkgver%20Setup.exe")
 sha512sums=('e4fdf649f1c9256b00e9d6eb07b4b9850799fcad2bf2e1ea5d1e0033b3f9ecc0de9a61931d9b85789c5f7a38710ef7ed97c6a6bc8fb1e5acf093d5c1a0bf1716'
-                   '4922e4903b96b7f1e6286110bb64256201702ca0921cbd5ecbe462db3ac9f6e7213ca0495d0ccb66cd8ba90a1e137f4581c7a35e4cad689edbe2cfe8144384c0'
-                   '6cc5ab074b5e26361a6b80b0b98fe8a7804544577f11ec8b59c76b6d52b8c2916ac3f7eb09b8767a21915f7de91da220b55d9b50ceb32432c2d02969175d97f9'
-                   '5396e2052cabe4e9843d4f4bdfded59074775d12f80111df90da35bb8c450dbbce4f0314cba7efc602b4dcc1b22ad7ab2559e1c64d134d3f111b95ebd3cd656a'
-                   '389a65bb69d457e02b41621d88a52a3c1d52b0040a1c30a0bf2df6d30dd45a1ec1708ff0bc31c90a003be300315af253f5e0eb203bf45b6c362e4f3cdfda96d1'
-                   '97f392577c8bc7508d290e6775743fb40f4e492ce244fe8f93983d6d9a1160a0ab6e217790a0f2adcec46455f0e07357b472a499343ca6beb8c3dd7d740e2515')
+            '4922e4903b96b7f1e6286110bb64256201702ca0921cbd5ecbe462db3ac9f6e7213ca0495d0ccb66cd8ba90a1e137f4581c7a35e4cad689edbe2cfe8144384c0'
+            '6cc5ab074b5e26361a6b80b0b98fe8a7804544577f11ec8b59c76b6d52b8c2916ac3f7eb09b8767a21915f7de91da220b55d9b50ceb32432c2d02969175d97f9'
+            '5396e2052cabe4e9843d4f4bdfded59074775d12f80111df90da35bb8c450dbbce4f0314cba7efc602b4dcc1b22ad7ab2559e1c64d134d3f111b95ebd3cd656a'
+            '389a65bb69d457e02b41621d88a52a3c1d52b0040a1c30a0bf2df6d30dd45a1ec1708ff0bc31c90a003be300315af253f5e0eb203bf45b6c362e4f3cdfda96d1'
+            '97f392577c8bc7508d290e6775743fb40f4e492ce244fe8f93983d6d9a1160a0ab6e217790a0f2adcec46455f0e07357b472a499343ca6beb8c3dd7d740e2515')

 prepare() {
    cd "$srcdir/"
@@ -34,7 +34,7 @@ prepare() {
    chmod 755 $pkgname/resources/{,static/{,assets/}}

 ## Copy the electron files needed for scratch.
-   cp -rf /usr/lib/electron11/* $srcdir/$pkgname/
+   cp -rf /usr/lib/electron13/* $srcdir/$pkgname/

 ## This file is useless
    rm $pkgname/resources/default_app.asar
@@ -42,6 +42,12 @@ prepare() {
 ## We don't need, if any, windows/dos file executables, remove them.
    find $srcdir/$pkgname/ -type f -name "*.exe" -delete
    find $srcdir/$pkgname/ -type f -name "*.dll" -delete
+
+   tmpdir=$(mktemp -d -p ${srcdir})
+   asar extract ${srcdir}/$pkgname/resources/app.asar $tmpdir
+   sed -i "s@nodeIntegration: true@nodeIntegration: true,\\\n contextIsolation: false@" ${tmpdir}/main.js
+   asar pack $tmpdir ${srcdir}/$pkgname/resources/app.asar
+   rm -rf $tmpdir
 }

queenmedley commented on 2021-05-05 04:45 (UTC) (edited on 2021-05-05 05:22 (UTC) by queenmedley)

@etaboon I just made it, thank you