Registry / devops / flatpak-bundler

flatpak-bundler

JSON →
library0.1.3jsnpmunverified

flatpak-bundler is a Node.js utility designed to programmatically create Flatpak application bundles. Version 0.1.3, last updated in January 2017, acts as a wrapper around the system's `flatpak-builder` command-line tool. It aims to simplify the Flatpak creation process by offering features like automatic installation of Flatpak runtimes and dependencies, direct export to single-file bundles, and streamlined file copying and symlink management. This module was particularly useful for packaging applications built with frameworks like Electron or NW.js, which often involve prebuilt binaries rather than traditional autotools-style build processes. Given its last update was over nine years ago and its dependency on Node.js versions 4.0.0 or greater (a long-unsupported runtime), the package is considered abandoned, with no active development or maintenance. Modern Flatpak tooling for Node.js or Electron has since evolved significantly, often utilizing more direct `flatpak-builder` manifest generation or alternative Electron-specific bundlers.

npm install flatpak-bundler
INSTALL
IMPORT
SIG · FLATPAK-BUNDLER
F
flatpak-bundler
devopsjavascriptv0.1.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bundle
const bundler = require('flatpak-bundler'); bundler.bundle(manifest, buildOptions, callback);
import { bundle } from 'flatpak-bundler';
This package is CommonJS-only and was developed for Node.js versions before ES modules were standardized. Direct ES module import syntax will not work.

This quickstart demonstrates how to programmatically create a Flatpak bundle using `flatpak-bundler`. It defines a basic Flatpak manifest and a simple executable script, then uses the `bundle` function to generate a `.flatpak` file. Requires Flatpak and flatpak-builder installed system-wide.

const path = require('path'); const fs = require('fs'); const bundler = require('flatpak-bundler'); // Create a dummy manifest file and a simple executable script const manifestContent = { "id": "org.example.BundledApp", "runtime": "org.freedesktop.Platform", "sdk": "org.freedesktop.Sdk", "runtime-version": "23.08", // May need to adjust based on your Flatpak setup's support "finish-args": [ "--share=ipc", "--socket=x11", "--share=network", "--filesystem=home", "--device=all" ], "command": "hello", "modules": [ { "name": "hello-module", "buildsystem": "simple", "build-commands": [ "install -D hello.sh /app/bin/hello" ], "sources": [ { "type": "file", "path": "hello.sh" } ] } ] }; const helloScriptContent = `#!/bin/sh\necho "Hello from Flatpak bundle created by flatpak-bundler!"\n`; const manifestPath = path.join(__dirname, 'hello.json'); const helloScriptPath = path.join(__dirname, 'hello.sh'); fs.writeFileSync(manifestPath, JSON.stringify(manifestContent, null, 2)); fs.writeFileSync(helloScriptPath, helloScriptContent, { mode: 0o755 }); console.log('Manifest and script created.'); // Define build options const buildOptions = { bundlePath: path.join(process.cwd(), 'output.flatpak'), // Output the flatpak bundle workingDir: path.join(process.cwd(), 'flatpak-build-temp'), // Temporary build directory cleanTmpdirs: true, autoInstallRuntime: true, autoInstallSdk: true }; console.log('Starting Flatpak bundle creation...'); bundler.bundle(manifestContent, buildOptions, (err, finalBuildOptions) => { if (err) { console.error('Error creating Flatpak bundle:', err); } else { console.log('Flatpak bundle created successfully!'); console.log('Bundle path:', finalBuildOptions.bundlePath); console.log(`To install: flatpak install --user --bundle ${finalBuildOptions.bundlePath}`); console.log(`To run: flatpak run ${manifestContent.id}`); } // Clean up temporary files fs.unlinkSync(manifestPath); fs.unlinkSync(helloScriptPath); });
Debug
Known issues
breakingThis package is effectively abandoned. The last update was in January 2017 (9 years ago), and it targets Node.js >= 4.0.0, which is an End-of-Life runtime. Using this package in modern Node.js environments is not recommended and may lead to compatibility issues or security vulnerabilities.
fix
Consider using actively maintained Flatpak packaging tools like `@electron-forge/maker-flatpak` for Electron apps, or directly generating `flatpak-builder` manifests with tools like `flatpak-node-generator` for Node.js projects, or using Flatpak GitHub Actions for CI/CD.
affects: all
gotchaThe package requires external system dependencies: `flatpak` and `flatpak-builder` to be installed and available in the system's PATH. Specifically, `flatpak >= 0.6.13` is a stated requirement, but newer versions of `flatpak-builder` (e.g., >= 0.8.2) may be expected by modern Flatpak runtimes.
fix
Ensure `flatpak` and `flatpak-builder` are installed on your system. Refer to the official Flatpak documentation for installation instructions: `https://flatpak.org/setup/`.
affects: all
gotchaDue to the package's age, it may not be compatible with the latest Flatpak runtimes, SDKs, or modern Flatpak manifest specifications and best practices. Building Flatpaks with very old tools can result in unstable or non-functional bundles.
fix
Experiment with `runtime` and `runtime-version` in your manifest, potentially using older versions if newer ones cause issues. However, the fundamental recommendation is to migrate to a newer Flatpak build tool.
affects: all
Errors
Common errors & fixes
Error: Command failed: flatpak-builder ... sh: 1: flatpak-builder: not found
The `flatpak-builder` command-line utility is not installed on the system or is not in the system's PATH.
fix
Install `flatpak-builder` via your system's package manager. For example, on Debian/Ubuntu: `sudo apt install flatpak-builder`.
Error: Command failed: flatpak ... sh: 1: flatpak: not found
The `flatpak` command-line utility is not installed on the system or is not in the system's PATH.
fix
Install `flatpak` via your system's package manager. For example, on Debian/Ubuntu: `sudo apt install flatpak`.
Error: EACCES: permission denied, open '...' (during file copy or symlink creation)
The Node.js process running `flatpak-bundler` does not have sufficient permissions to write to the specified output or temporary directories, or to create files/symlinks in Flatpak's build environment.
fix
Ensure the user account running the script has write permissions to the output and working directories. For Flatpak itself, sometimes running `flatpak repair` or ensuring Flatpak's internal directories have correct permissions might help.
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies
flatpakrequiredRequired system utility for building and managing Flatpak applications. The library is a wrapper around Flatpak commands.
flatpak-builderrequiredRequired system utility for orchestrating Flatpak builds. flatpak-bundler internally calls this tool.
Agent activity
2 hits · last 30 days
node
2
Resources
flatpak-bundler — npm install flatpak-bundler · libregistry