Files
opu/tools/haiku-package.sh
T
yann64andClaude Opus 5.5 d190a8b5f8
CI / Linux arm64 (push) Waiting to run
CI / Linux x86_64 (push) Waiting to run
CI / ASan + UBSan (push) Waiting to run
Haiku packaging: .hpkg script and HaikuPorts recipe template
- tools/haiku-package.sh: release build staged into the package layout
  (apps/OpenPU, bin/openpu-cli, data/locale, Deskbar link), .PackageInfo
  with the library requirements, `package create`. Validated with
  `pkgman install` in the Haiku R1/beta6 VM.
- packaging/haiku/openpu.recipe: HaikuPorts recipe template, to be named
  after the released version with the archive checksum.
- The Haiku application is installed in apps/ and finds its translations
  through BPathFinder (data/locale of its installation location).
- Fix: `cmake --install --strip` dropped the application's resources
  (icon, signature, version); they are attached again after install.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar
2026-11-29 06:50:47 +01:00

62 lines
2.2 KiB
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: MIT
# Builds openpu-<version>-1-x86_64.hpkg on Haiku from the working tree: release build, staged
# install (apps/OpenPU, bin/openpu-cli, data/locale, Deskbar link), .PackageInfo, `package create`.
# The HaikuPorts recipe (packaging/haiku) is the way to publish; this script is for testing and
# for attaching a package to a GitHub release.
#
# usage: tools/haiku-package.sh [build-dir] (output in the current directory)
set -eu
SRC=$(cd "$(dirname "$0")/.." && pwd)
BUILD=${1:-$SRC/../build-openpu/hpkg}
OUT=$(pwd)
ARCH=$(getarch)
STAGE=$BUILD/stage
cmake -S "$SRC" -B "$BUILD" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/boot/system \
-DOPENPU_BUILD_TESTS=OFF
cmake --build "$BUILD"
rm -rf "$STAGE"
# Files are staged relative to the installation location (the package's root).
cmake --install "$BUILD" --strip --prefix "$STAGE"
# Package versions cannot contain '+' or '.' after the micro number: a development build
# 0.2.0+3.gabc1234.dirty becomes 0.2.0_git3_gabc1234_dirty; a tagged build stays 0.2.0.
DESCRIPTION=$("$STAGE/bin/openpu-cli" --version | awk '{print $2}')
VERSION=$(echo "$DESCRIPTION" | sed -e 's/+/_git/' -e 's/\./_/3g')
cat > "$STAGE/.PackageInfo" <<EOF
name openpu
version $VERSION-1
architecture $ARCH
summary "Download Peugeot head unit updates and prepare the USB stick"
description "OpenPU downloads the firmware and navigation map updates of Peugeot \\
head units (NAC, RCC, AIO, Crony) and prepares the installation USB stick: FAT32 formatting, \\
license and update files. Downloads resume where they stopped. Graphical application and \\
command-line tool (openpu-cli). Independent project, not affiliated with Stellantis or Peugeot."
packager "OpenPU contributors <https://github.com/yann64/openpu>"
vendor "OpenPU contributors"
licenses { "MIT" }
copyrights { "2026 yann64 and the OpenPU contributors" }
urls { "https://github.com/yann64/openpu" }
provides {
openpu = $VERSION
app:OpenPU = $VERSION
cmd:openpu_cli = $VERSION
}
requires {
haiku >= r1~beta6
lib:libarchive >= 13
lib:libcurl >= 4
lib:libgcc_s >= 1
lib:libintl >= 8
lib:libstdc++
}
EOF
PACKAGE=$OUT/openpu-$VERSION-1-$ARCH.hpkg
rm -f "$PACKAGE"
package create -C "$STAGE" "$PACKAGE"
package list "$PACKAGE"