# 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
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
# 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 . \
# 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
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"
+++ /dev/null
-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"