Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Fix Node.js SDK extension setup #28

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
options: --privileged
steps:
- uses: actions/checkout@v4

- name: Install Node.js SDK extension
run: |
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y flathub org.freedesktop.Sdk.Extension.node20//24.08

- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: frigate-config-gui.flatpak
Expand Down
12 changes: 10 additions & 2 deletions flatpak/com.frigateNVR.ConfigGUI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ finish-args:
build-options:
env:
NPM_CONFIG_LOGLEVEL: info
append-path: /usr/lib/sdk/node20/bin
prepend-pkg-config-path: /usr/lib/sdk/node20/lib/pkgconfig
prepend-ld-library-path: /usr/lib/sdk/node20/lib

cleanup:
- /include
Expand All @@ -38,11 +41,14 @@ modules:
buildsystem: simple
build-commands:
- |
# Enable Node.js SDK extension
# Set up Node.js environment
. /usr/lib/sdk/node20/enable.sh
export FLATPAK_BUILDER_BUILDDIR="$PWD"
export FLATPAK_ID="com.frigateNVR.ConfigGUI"

# Install dependencies and build
npm ci
npm config set prefix /app
npm ci --offline --cache=/run/build/frigate-config-gui/npm-cache
npm run build

# Install application
Expand All @@ -61,6 +67,8 @@ modules:
# Create wrapper script
cat > /app/bin/frigate-config-gui-wrapper << 'EOL'
#!/bin/sh
export PATH="/app/bin:$PATH"
export NODE_PATH="/app/lib/node_modules"
exec /app/bin/frigate-config-gui "$@"
EOL
chmod +x /app/bin/frigate-config-gui-wrapper
Expand Down
Loading