Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions ports-wip/quickjs/build.sh
Copy link
Collaborator

@karawitan karawitan Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thank you, great PR !

package_build() looks unecessary, and may be bypassed by:

  • pasting package_fetch() from lib.sh ( I'd suggest wget -nc and check for return code )
  • updating TASK=install at the end of it to go straight to install

Also, first url here gives 404 at this time

# Use sw7ft's pre-compiled GCC 9 optimized package from GitHub Releases
DISTFILES="https://github.com/sw7ft/qnx-packages/releases/download/v1.0/QuickJS_QNX8_ARM_Deploy.tar.gz"
# Fallback to berrystore during transition:
# DISTFILES="https://berrystore.sw7ft.com/QuickJS_QNX8_ARM_Deploy.tar.gz"

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env bash

# QuickJS port for BlackBerry 10 / QNX
# Uses pre-compiled GCC 9 optimized binaries from sw7ft
# Avoids GCC 4.6.3 limitations in berrymuch toolchain

set -e
source ../../lib.sh

DISTVER="quickjs-qnx8-arm-deploy"
DISTSUFFIX="tar.gz"
TASK=fetch

# Use sw7ft's pre-compiled GCC 9 optimized package from GitHub Releases
DISTFILES="https://github.com/sw7ft/qnx-packages/releases/download/v1.0/QuickJS_QNX8_ARM_Deploy.tar.gz"
# Fallback to berrystore during transition:
# DISTFILES="https://berrystore.sw7ft.com/QuickJS_QNX8_ARM_Deploy.tar.gz"
UNPACKCOMD="tar -xzf"

package_init "$@"

# Override package_build - no compilation needed, just repackage
package_build() {
if [ "$TASK" == "build" ]
then
echo "Using pre-compiled QuickJS binaries (GCC 9 optimized)..."
cd "$WORKROOT"

# Extract sw7ft package
if [ ! -d "quickjs_qnx8_deploy" ]; then
echo "Error: quickjs_qnx8_deploy directory not found"
exit 1
fi

echo "Repackaging for berrymuch compatibility..."
TASK=install
fi
}

# Override package_install to use existing directory structure
package_install() {
if [ "$TASK" == "install" ]
then
echo "Installing pre-compiled QuickJS to $DESTDIR"
cd "$WORKROOT/quickjs_qnx8_deploy"

# Install binaries
mkdir -p "$DESTDIR/$PREFIX/bin"
cp -r bin/* "$DESTDIR/$PREFIX/bin/"

# Install libraries
mkdir -p "$DESTDIR/$PREFIX/lib"
cp -r lib/* "$DESTDIR/$PREFIX/lib/"

# Install headers
mkdir -p "$DESTDIR/$PREFIX/include"
cp -r include/* "$DESTDIR/$PREFIX/include/"

# Install documentation
mkdir -p "$DESTDIR/$PREFIX/share/doc/quickjs"
cp README.md DEPLOY.md "$DESTDIR/$PREFIX/share/doc/quickjs/" 2>/dev/null || true

TASK=bundle
fi
}

package_fetch
# Skip package_patch - no patches needed for pre-compiled binaries
package_build
package_install
package_bundle