pmaport for ubports-installer
The installation instructions for fairphone-fp5, fairphone-fp4, and shift-axolotl all suggest using ubports-installer to flash the device, but ubports-installer is not packaged on postmarketOS (nor Alpine).
ubports-installer was the first option in the installation instructions, and I mis-interpreted this as implying that it is the recommended option. This was a mistake.
I tried hacking an APKBUILD. This is the results after several iterations:
maintainer="not me"
pkgname=ubports-installer
pkgver=0.10.0
pkgrel=0
pkgdesc="Simple tool to flash mobile devices"
url="https://github.com/ubports/ubports-installer"
license="GPL3.0-or-later"
arch="all"
depends="nodejs"
makedepends="npm electron-dev"
source="ubports-installer-$pkgver.tar.gz::https://github.com/ubports/ubports-installer/archive/refs/tags/$pkgver.tar.gz"
build() {
npm i
npm run build
./node_modules/.bin/electron-builder --linux --x64 --dir -c.electronDist=/usr/lib/electron -c.electronVersion="$(cat /usr/lib/electron/version)"
# Remove a bunch of binaries for other platforms.
find ./dist/linux-unpacked/resources/app.asar.unpacked -type d \( -name linux -o -name mac -o -name win32 -o -name darwin \) -print -exec rm -rf {} + ;
}
check() {
npm run test
}
package() {
cd dist/linux-unpacked/
find . -type f -exec install -Dm644 {} -t "$pkgdir/usr/share/$pkgname/" \;
}
sha512sums="
1cfc01c75f8a5b6bba1f8e5c6de2bfc22e17c64ddc3d8d8e8e60ee281df7b4de559180b69dc7ce29bb99bc45c93dfb93f5f08097335e6490bd37be6277ad795d ubports-installer-0.10.0.tar.gz
"
This builds, but the resulting package does not work:
> USE_SYSTEM_7ZA=true USE_SYSTEM_TOOLS=1 electron /usr/share/ubports-installer/app.asar
App threw an error during load
Error: ENOENT: no such file or directory, open '/usr/share/ubports-installer/app.asar.unpacked/node_modules/7zip-bin/package.json'
at Object.readFileSync (node:fs:448:20)
at t.readFileSync (node:electron/js2c/node_init:2:10175)
at u.internalModuleReadJSON (node:electron/js2c/node_init:2:14434)
at read (node:internal/modules/package_json_reader:56:25)
at readPackage (node:internal/modules/package_json_reader:141:10)
at resolveExports (node:internal/modules/cjs/loader:637:15)
at Module._findPath (node:internal/modules/cjs/loader:731:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1218:27)
at s._resolveFilename (node:electron/js2c/browser_init:2:124109)
at Module._load (node:internal/modules/cjs/loader:1058:27)
error: undefined {"code":"ENOENT","errno":-2,"path":"/usr/share/ubports-installer/app.asar.unpacked/node_modules/7zip-bin/package.json","syscall":"open"}
I'm not moving further with this, but, as discussed on IRC, I'm leaving this here so that the work does not get lost and to have a single place to track this missing package.