From 9a216acfc6a6319da41789f1f0c5aac526ce554b Mon Sep 17 00:00:00 2001 From: fsLeg Date: Sun, 9 Mar 2025 15:13:37 +0300 Subject: [PATCH] popcorntime: added 32 bit support --- popcorntime/copy-libatomic_fixes.patch | 2 +- popcorntime/popcorntime.SlackBuild | 39 +++++++++++++------------- popcorntime/popcorntime.info | 8 ++++-- popcorntime/yarn_lock-fixes.patch | 22 --------------- 4 files changed, 27 insertions(+), 44 deletions(-) delete mode 100644 popcorntime/yarn_lock-fixes.patch diff --git a/popcorntime/copy-libatomic_fixes.patch b/popcorntime/copy-libatomic_fixes.patch index 236f9fd..3efbc80 100644 --- a/popcorntime/copy-libatomic_fixes.patch +++ b/popcorntime/copy-libatomic_fixes.patch @@ -36,6 +36,6 @@ index 19f6cebfd..59574ef01 100755 + read source <<< `readlink -f /usr/lib64/libatomic.so.*` else - read source <<< `readlink -f /usr/lib/i386*/libatomic.so.*` -+ read source <<< `readlink -f /usr/lib32/libatomic.so.*` ++ read source <<< `readlink -f /usr/lib/libatomic.so.*` fi cp $source "$outDir/lib/libatomic.so.1" diff --git a/popcorntime/popcorntime.SlackBuild b/popcorntime/popcorntime.SlackBuild index 3dceb42..09ba024 100644 --- a/popcorntime/popcorntime.SlackBuild +++ b/popcorntime/popcorntime.SlackBuild @@ -22,9 +22,6 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# TODO: look into prebuilds of bufferutil, utf-8-validate and utp-native -# to possibly make this work on 32 bit systems - cd $(dirname $0) ; CWD=$(pwd) PRGNAM=popcorntime @@ -54,11 +51,16 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "x86_64" ]; then +if [ "$ARCH" = "i586" ]; then + BITS="32" + PLATFORM="ia32" + NWVER="0.44.5" +elif [ "$ARCH" = "x86_64" ]; then BITS="64" - LONGBITS="x64" + PLATFORM="x64" + NWVER="0.86.0" else - echo "Only x86_64 platform is supported." + echo "Only i586 and x86_64 architectures are supported." exit 1 fi @@ -73,9 +75,9 @@ cd $TARNAM-$VERSION # Unpack vendored sources tar xfv $CWD/$PRGNAM-$VERSION-vendored-sources.tar -mkdir -p cache/0.86.0-sdk -tar xf $CWD/nwjs-sdk-v0.86.0-linux-$LONGBITS.tar.gz -C cache/0.86.0-sdk -mv cache/0.86.0-sdk/nwjs-sdk-v0.86.0-linux-$LONGBITS cache/0.86.0-sdk/linux$BITS +mkdir -p cache/$NWVER-sdk +tar xf $CWD/nwjs-sdk-v$NWVER-linux-$PLATFORM.tar.gz -C cache/$NWVER-sdk +mv cache/$NWVER-sdk/nwjs-sdk-v$NWVER-linux-$PLATFORM cache/$NWVER-sdk/linux$BITS chown -R root:root . find -L . \ @@ -86,22 +88,21 @@ find -L . \ # Fix libatomic.so copying # https://aur.archlinux.org/cgit/aur.git/tree/copy-libatomic_fixes.patch?h=popcorntime -patch -p1 < $CWD/yarn_lock-fixes.patch - -# Patch a proper github url -# https://aur.archlinux.org/cgit/aur.git/tree/yarn_lock-fixes.patch?h=popcorntime patch -p1 < $CWD/copy-libatomic_fixes.patch -# Make yarn use vendored sources -export YARN_YARN_OFFLINE_MIRROR="./vendor" +# Use a proper nwjs version +sed -i "s|\(const defaultNwVersion = '\)[0-9.]\+|\1${NWVER}|" gulpfile.js +# Make yarn use vendored sources and system node.js headers +YARN_YARN_OFFLINE_MIRROR="./vendor" \ +npm_config_nodedir="/usr" \ yarn install --ignore-engines --frozen-lockfile --offline -yarn build +yarn build --offline # Fix permissions -find build/Popcorn-Time/linux64 -type f -perm -u+r -exec chmod a+r {} \; -find build/Popcorn-Time/linux64 -type f -perm -u+x -exec chmod a+x {} \; -find build/Popcorn-Time/linux64 -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ +find build/Popcorn-Time/linux$BITS -type f -perm -u+r -exec chmod a+r {} \; +find build/Popcorn-Time/linux$BITS -type f -perm -u+x -exec chmod a+x {} \; +find build/Popcorn-Time/linux$BITS -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs chmod a+x 2> /dev/null || true # Move binaries diff --git a/popcorntime/popcorntime.info b/popcorntime/popcorntime.info index bf2a40c..4f19194 100644 --- a/popcorntime/popcorntime.info +++ b/popcorntime/popcorntime.info @@ -1,8 +1,12 @@ PRGNAM="popcorntime" VERSION="0.5.1" HOMEPAGE="https://popcorn-time.site/" -DOWNLOAD="UNSUPPORTED" -MD5SUM="" +DOWNLOAD="https://github.com/popcorn-official/popcorn-desktop/archive/v0.5.1/popcorn-desktop-0.5.1.tar.gz \ + https://sbo.t-rg.ws/popcorntime-0.5.1-vendored-sources.tar \ + https://popcorn-time.serv00.net/nw/v0.44.5/nwjs-sdk-v0.44.5-linux-ia32.tar.gz" +MD5SUM="11bcb10ac85da77b619247e924958127 \ + 9a5ece4a5dc8680db6c5b8be9baa9e85 \ + f2b279adc41d43f9d48307f2decb45e1" DOWNLOAD_x86_64="https://github.com/popcorn-official/popcorn-desktop/archive/v0.5.1/popcorn-desktop-0.5.1.tar.gz \ https://sbo.t-rg.ws/popcorntime-0.5.1-vendored-sources.tar \ https://popcorn-time.serv00.net/nw/v0.86.0/nwjs-sdk-v0.86.0-linux-x64.tar.gz" diff --git a/popcorntime/yarn_lock-fixes.patch b/popcorntime/yarn_lock-fixes.patch deleted file mode 100644 index 1e0353c..0000000 --- a/popcorntime/yarn_lock-fixes.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/yarn.lock b/yarn.lock -index 9764d06ef..d7e51c545 100644 ---- a/yarn.lock -+++ b/yarn.lock -@@ -7227,7 +7227,7 @@ teex@^1.0.1: - - "temp@github:adam-lynch/node-temp#remove_tmpdir_dep": - version "0.8.3" -- resolved "git+ssh://git@github.com/adam-lynch/node-temp.git#279c1350cb7e4f02515d91da9e35d39a40774016" -+ resolved "git+https://github.com/adam-lynch/node-temp.git#279c1350cb7e4f02515d91da9e35d39a40774016" - dependencies: - rimraf "~2.2.6" - -@@ -7994,7 +7994,7 @@ vinyl@^3.0.0: - - "vtt.js@git+https://github.com/gkatsev/vtt.js.git#vjs-v0.12.1": - version "0.12.1" -- resolved "git+ssh://git@github.com/gkatsev/vtt.js.git#8ea664e257ec7b5c092f58ac989e3134ff536a7a" -+ resolved "git+https://github.com/gkatsev/vtt.js.git#8ea664e257ec7b5c092f58ac989e3134ff536a7a" - - w-json@^1.3.10: - version "1.3.10" -- 2.46.3