Package Details: scratch3 3.31.1-5

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://github.com/scratchfoundation/scratch-desktop
Keywords: education kids programing
Licenses: AGPL-3.0-only
Conflicts: scratch-desktop, scratch3-bin
Provides: scratch3
Replaces: scratch-desktop
Submitter: relrel
Maintainer: jasongodev
Last Packager: jasongodev
Votes: 14
Popularity: 0.102020
First Submitted: 2020-08-14 14:55 (UTC)
Last Updated: 2026-03-16 19:18 (UTC)

Latest Comments

« First ‹ Previous 1 2 3 4 5

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

etaboon commented on 2021-04-14 20:31 (UTC)

Queenmedley was right: there are no images showed in "choose a sprite".

This is the same for "choose a background" (no images) and for "choose a sound" (no sound except the cat's one).

Proposal to fix this issue (package size will grow 113.6MB to 172.6MB but works for me), to make this work, I had to rename the downloaded file scratch3 to scratch3.sh. The installed file will still be named "scratch3":

$ diff PKGBUILD.old PKGBUILD
9c9
< depends=(electron)
---
> depends=(electron11)
13c13
<         "$pkgname"
---
>         "$pkgname.sh"
18c18
< 'd9dd01d52f91ded4ef033dcd22ed97e7bf3a2afc64b28b5c2d36efd095897953f0d93b7e5ec98905b970f99da2fa57b88e56e01cad54eec13af98e4786cb5bc7'
---
> '6cc5ab074b5e26361a6b80b0b98fe8a7804544577f11ec8b59c76b6d52b8c2916ac3f7eb09b8767a21915f7de91da220b55d9b50ceb32432c2d02969175d97f9'
24,25c24
<       7za x -bd -y "Scratch%20$pkgver%20Setup.exe" resources/
<
---
>       7za x -aoa -y "Scratch%20$pkgver%20Setup.exe" resources/ -o$pkgname/
27c26,35
<       chmod 755 resources/{,static/{,assets/}}
---
>       chmod 755 $pkgname/resources/{,static/{,assets/}}
>
>       # We don't need windows/dos file executables, remove them.
>       find $pkgname/ -type f -name "*.exe" -delete
>
>       # Copy the electron files needed for scratch.
>       cp -rf /usr/lib/electron11/* $srcdir/$pkgname/
>
>       # This file is useless
>       rm $pkgname/resources/default_app.asar
38,39c46,47
<       install -Dm644 -t "$pkgdir/usr/share/$pkgname/" resources/app.asar
<       cp -r resources/static/ "$pkgdir/usr/share/$pkgname/"
---
>       install -dm755 "${pkgdir}/usr/share/$pkgname"
>       cp -r $srcdir/$pkgname -t "$pkgdir/usr/share"
41c49
<       install -Dm755 -t "$pkgdir/usr/bin/" "$pkgname"
---
>       install -Dm755 "$pkgname.sh" $pkgdir/usr/bin/$pkgname

For the bash script:

$ diff scratch3 scratch3.sh
3c3
< exec electron /usr/share/scratch3/app.asar "$@"
---
> exec /usr/share/scratch3/electron "$@"

Tested successfully with Scratch3 3.18.1 and 3.20.1.

etaboon commented on 2021-04-14 15:16 (UTC)

Scratch3 stopped working for me:

a window opens with "Scratch is loading..." forever.

Had to replace electron with electron11 as a workaround:

$ diff PKGBUILD.old PKGBUILD.new
9c9
< depends=(electron)
---
> depends=(electron11)
18c18
< 'd9dd01d52f91ded4ef033dcd22ed97e7bf3a2afc64b28b5c2d36efd095897953f0d93b7e5ec98905b970f99da2fa57b88e56e01cad54eec13af98e4786cb5bc7'
---
> 'b3c108d89a5da7394330782dd1e2e59167816236f2410a2ac9bb5fbe89ba4749667ceea91b174b4a7787e251fdd393b06d57a146611c6a66004aff5cc0ac9474'

$ diff scratch3.old scratch3.new
3c3
< exec electron /usr/share/scratch3/app.asar "$@"
---
> exec electron11 /usr/share/scratch3/app.asar "$@"

Tested successfully with Scratch3 3.18.1 and 3.20.1.

queenmedley commented on 2021-02-06 07:57 (UTC)

There are no images showed in "choose a sprite".

Amethyste69 commented on 2021-01-27 19:43 (UTC) (edited on 2021-01-27 19:43 (UTC) by Amethyste69)

Adding this line fixed this issue indeed. Many thanks

markus24 commented on 2021-01-20 20:29 (UTC)

@relrel Proposal to fix the build issue mentioned by @Amethyste69 https://pastebin.com/zNtL31Rt

gendesk requires --pkgname "$pkgname"

Amethyste69 commented on 2020-11-16 21:45 (UTC)

Hello

I've got this message


[PKGBUILD]                        Generating desktop file... ok
==> Suppression du répertoire $pkgdir/ existant…
==> Entre dans l’environnement fakeroot…
==> Lancement de package()…
install: impossible d'évaluer 'scratch3.desktop': Aucun fichier ou dossier de ce type

Impossible to evaluate 'scratch3.desktop' : no such file or directory

Thanks for your help

relrel commented on 2020-09-02 05:51 (UTC)

@PCITechie This package runs natively, without wine. It just extracts the electron resources (which are platform-independent) from the Windows installer.

In fact it does what the source of your scratch3-bin package does, only without re-packaing to .deb.

Also, since this package is currently up-to-date, unlike scratch3-bin, I think it would be great to merge scratch3-bin into this package, in order to reduce duplication and confusion of users.

PCITechie commented on 2020-09-01 17:21 (UTC)

I advise you to call this package "scratch3-win32" instead of scratch3 so people know it runs in wine and not natively.