-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use package instead of name for portage Signed-off-by: Prabhu Subramanian <[email protected]> * Flatpak wip Signed-off-by: Prabhu Subramanian <[email protected]> --------- Signed-off-by: Prabhu Subramanian <[email protected]>
- Loading branch information
Showing
4 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
app-id: org.cyclonedx.cdxgen | ||
branch: stable | ||
runtime: org.freedesktop.Platform | ||
runtime-version: '22.08' | ||
sdk: org.freedesktop.Sdk | ||
# Add the Node 16 SDK extension. | ||
sdk-extensions: | ||
- org.freedesktop.Sdk.Extension.node18 | ||
command: bin/cdxgen.js | ||
finish-args: | ||
# Network access. | ||
- --share=network | ||
# If you need to access the filesystem, also add: | ||
- --filesystem=home | ||
modules: | ||
# First step is to install Node to /app/node, that way it can be accessible outside of the sdk | ||
# environment. install-sdk.sh is used because install.sh omits npm. | ||
- name: node | ||
buildsystem: simple | ||
build-commands: | ||
- /usr/lib/sdk/node18/install-sdk.sh | ||
|
||
# Now is the quickstart module. | ||
- name: cdxgen | ||
buildsystem: simple | ||
build-options: | ||
# Add the node bin directory. | ||
append-path: /usr/lib/sdk/node18/bin | ||
env: | ||
# Set the cache directory, used to find Electron and some other helper | ||
# tools. | ||
# (The directory format is: /run/build/MODULE_NAME/flatpak-node/cache) | ||
XDG_CACHE_HOME: /run/build/cdxgen/flatpak-node/cache | ||
# Set the npm cache directory, used by npm to find its package metadata. | ||
npm_config_cache: /run/build/cdxgen/flatpak-node/npm-cache | ||
# Sets the directory where Node is located so that npm won't download the headers. | ||
npm_config_nodedir: /usr/lib/sdk/node18 | ||
build-commands: | ||
# Install the packages from our offline cache. | ||
# --prefix= is the path to our subdirectory (see the cdxgen source below). | ||
# If you were using Yarn here, you'd use the yarn config and yarn --offline commands | ||
# as shown in the webpack-quick-start demo. The need for --prefix= is dependent on how | ||
# this project is run, not on the package manager. | ||
- npm install --prefix=cdxgen --offline | ||
|
||
# This quick start is designed for running directly from the source directory, so we | ||
# copy it resulting directory to /app/cdxgen. (This isn't npm-specific.) | ||
- cp -r cdxgen /app | ||
# Install the wrapper script to start it. | ||
- install -Dm 755 start-cdxgen.sh /app/bin/start-cdxgen | ||
|
||
# To allow separate locales | ||
- setup-separate-locales ${FLATPAK_DEST}/cdxgen | ||
sources: | ||
- type: git | ||
url: https://github.com/CycloneDX/cdxgen | ||
commit: 10237696b97f550acde30e8c565baf1112b5f700 | ||
branch: release/10.x | ||
# Checkout into a subdirectory so we can copy the whole thing to /app. | ||
dest: cdxgen | ||
# Add the flatpak-node-generator generated sources. | ||
- sources.json | ||
# Our runner script. | ||
- type: script | ||
dest-filename: start-cdxgen.sh | ||
commands: | ||
- export PATH=$PATH:/app/node/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[ | ||
{ | ||
"type": "script", | ||
"commands": [], | ||
"dest-filename": "patch.sh", | ||
"dest": "flatpak-node" | ||
}, | ||
{ | ||
"type": "script", | ||
"commands": [ | ||
"$FLATPAK_BUILDER_BUILDDIR/flatpak-node/patch.sh" | ||
], | ||
"dest-filename": "patch-all.sh", | ||
"dest": "flatpak-node" | ||
}, | ||
{ | ||
"type": "script", | ||
"commands": [ | ||
"version=$(node --version | sed \"s/^v//\")", | ||
"nodedir=$(dirname \"$(dirname \"$(which node)\")\")", | ||
"mkdir -p \"flatpak-node/cache/node-gyp/$version\"", | ||
"ln -s \"$nodedir/include\" \"flatpak-node/cache/node-gyp/$version/include\"", | ||
"echo 9 > \"flatpak-node/cache/node-gyp/$version/installVersion\"" | ||
], | ||
"dest-filename": "setup_sdk_node_headers.sh", | ||
"dest": "flatpak-node" | ||
}, | ||
{ | ||
"type": "shell", | ||
"commands": [ | ||
"FLATPAK_BUILDER_BUILDDIR=$PWD flatpak-node/patch-all.sh", | ||
"bash flatpak-node/setup_sdk_node_headers.sh" | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters