]> git.t-rg.ws Git - slackbuilds.git/commitdiff
element-desktop: use bundled yarn
authorfsLeg <fsleg@t-rg.ws>
Fri, 5 Dec 2025 13:44:09 +0000 (16:44 +0300)
committerfsLeg <fsleg@t-rg.ws>
Fri, 5 Dec 2025 13:44:09 +0000 (16:44 +0300)
element-desktop/README
element-desktop/element-desktop.SlackBuild
element-desktop/element-desktop.info
element-desktop/mkvendor.sh

index 986b552bbb051ba48390d6024683c3e4a6dbc253..602c9596d092b4a7967c7c04194f53e9a80d6ae8 100644 (file)
@@ -11,5 +11,3 @@ WARNING: vendored-sources.tar.xz is over 800 Mb and the building process
 requires about 5 GB of space. If you're hard-pressed on space, consider
 installing element-desktop-bin instead.
 
-WARNING: this script's build dependency is nodejs24-bin which conflicts
-with nodejs.
index 4250048b73fa9b04a8c27059cb1631a304f4e3fe..0c288539785331b954e11b92ebfae3c56dec8699 100644 (file)
@@ -79,6 +79,8 @@ export YARN_YARN_OFFLINE_MIRROR=$BASE_TMP_DIR/vendor
 export YARN_CACHE_FOLDER=$BASE_TMP_DIR/cache
 export npm_config_cache=$YARN_CACHE_FOLDER
 export npm_config_nodedir=/usr
+export COREPACK_HOME=$BASE_TMP_DIR/corepack
+export COREPACK_ENABLE_NETWORK=0
 export XDG_CACHE_HOME=$BASE_TMP_DIR/electron-cache
 export CARGO_HOME=$BASE_TMP_DIR/cargo
 export CFLAGS="$SLKCFLAGS"
@@ -101,6 +103,10 @@ find -L . \
   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
 
 sed -i 's|yarn |yarn --offline |g' package.json
+
+corepack install --global --cache-only $COREPACK_HOME/yarn.tgz
+export PATH=$COREPACK_HOME/v1/yarn/$(corepack yarn --version)/bin:$PATH
+
 yarn install --frozen-lockfile \
              --ignore-engines \
              --no-fund \
index 6b682c5da7552982c1d26b66c39085e732362d35..8dbab3e09fbed4d115f66ffa3cdf230f4c24bab1 100644 (file)
@@ -8,7 +8,7 @@ DOWNLOAD_x86_64="https://github.com/element-hq/element-desktop/archive/v1.12.6/e
                  https://sbo.t-rg.ws/element-desktop-1.12.6-vendored-sources.tar.xz"
 MD5SUM_x86_64="c36286cf87e80641db5b64e27602f512 \
                fc2f5530b8afb857ca8980106365450e \
-               664fda8217864dab0633144c7118ee81"
-REQUIRES="sqlcipher yarn rust-opt nodejs24-bin"
+               104d78c8a4503300306cd0aa48799196"
+REQUIRES="sqlcipher rust-opt nodejs24-bin"
 MAINTAINER="Vladislav 'fsLeg' Borisov"
 EMAIL="fsleg@t-rg.ws"
index 4d31e95111616367c8f7926832cd38230af9c0b0..58f0da62db99ad1cbc12fc4990fa02385405f88c 100644 (file)
@@ -30,11 +30,19 @@ export npm_config_cache="$YARN_CACHE_FOLDER"
 export npm_config_nodedir=/usr
 export XDG_CACHE_HOME="$BASE_TMP_DIR/electron-cache"
 export CARGO_HOME="$BASE_TMP_DIR/cargo"
+export COREPACK_HOME="$BASE_TMP_DIR/corepack"
 
 mkdir -p "$YARN_YARN_OFFLINE_MIRROR"
 
 # element-web
 cd "element-web-$VERSION"
+
+# set up yarn
+corepack pack -o "$COREPACK_HOME/yarn.tgz"
+# when "properly" calling yarn through corepack, it fails to pick up
+# vendored tarballs, so we call it directly
+export PATH=$COREPACK_HOME/v1/yarn/$(corepack yarn --version)/bin:$PATH
+
 # this `yarn install` is actually a two step process. the second step
 # doesn't like wrap-ansi that was cached during the first step, however we
 # aren't interested in cache, we are interested in vendor directory, so we
@@ -124,6 +132,8 @@ directory = 'vendor'
 EOF
 cd ../../../..
 
+corepack cache clean
+
 # vendor everything
 cd ..
 
@@ -134,6 +144,7 @@ fi
 tar cfJ "$OUTPUT/$PRGNAM-$VERSION-vendored-sources.tar.xz" \
         "$PRGNAM-$VERSION/vendor" \
         "$PRGNAM-$VERSION/.hak" \
-        "$PRGNAM-$VERSION/electron-cache"
+        "$PRGNAM-$VERSION/electron-cache" \
+        "$PRGNAM-$VERSION/corepack/yarn.tgz"
 cd "$CWD"
 rm -rv "$TMP"