The workspace read 0.1.0 for two releases, so every desktop binary reported a version two releases stale. The APK was worse: `AndroidManifest.xml` states no version at all, so a device showed `versionName=null` and `versionCode=0` while the library inside the APK knew exactly what it was. A version edited by hand in several files is a version that is wrong in at least one of them. `tools/set-version.sh` is now the only thing that sets one. It takes the version from the latest git tag, or is told, and writes the two files that must state it before anything is built: the workspace `Cargo.toml`, from which every crate inherits, and `packaging/PKGBUILD`, which pacman reads before a build exists. It refreshes `Cargo.lock`, because members appear there by version and CI builds `--locked`. `--commit` commits the result. Android is not in that list on purpose. `package.sh` reads the version out of `Cargo.toml` and hands it to `aapt2 link`, so the APK cannot drift from the binary it contains — there is no third file to forget. `versionCode` has to be one increasing integer, which a semantic version is not, so it is packed as MAJOR*10000 + MINOR*100 + PATCH: ordered the way Android requires, and readable at a glance. A version that is not MAJOR.MINOR.PATCH is refused rather than coerced. It is a contract with whoever reads a bug report, and silently turning "0.4" into something else is worse than being asked to type it again. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
47 lines
1.8 KiB
Bash
47 lines
1.8 KiB
Bash
# Maintainer: Duncan Tourolle <duncan@tourolle.paris>
|
|
#
|
|
# Builds from the local checkout rather than a release tarball, which is what
|
|
# makes `makepkg -si` in this directory install what you are actually working
|
|
# on. Swap `source` for a tagged tarball when there is something to release.
|
|
pkgname=darkroom
|
|
pkgver=0.4.0
|
|
pkgrel=1
|
|
pkgdesc="Non-destructive RAW photo library and editor"
|
|
arch=('x86_64')
|
|
url="https://gitea.tourolle.paris/dtourolle/DarkRoom"
|
|
license=('GPL-3.0-or-later')
|
|
# Runtime: Vulkan for wgpu, and a Secret Service implementation for the
|
|
# Nextcloud credentials (FR-NC-2) — gnome-keyring or kwallet both provide it.
|
|
depends=('vulkan-icd-loader' 'fontconfig' 'libxkbcommon')
|
|
makedepends=('cargo' 'git')
|
|
optdepends=('gnome-keyring: store Nextcloud credentials'
|
|
'kwallet: store Nextcloud credentials')
|
|
options=('!lto') # the workspace sets its own LTO in Cargo.toml
|
|
|
|
_repo="$(cd "${startdir}/.." && pwd)"
|
|
|
|
build() {
|
|
cd "${_repo}"
|
|
export RUSTUP_TOOLCHAIN=stable
|
|
export CARGO_TARGET_DIR="${_repo}/target"
|
|
cargo build --release --locked -p darkroom-desktop
|
|
}
|
|
|
|
package() {
|
|
cd "${_repo}"
|
|
install -Dm755 "target/release/darkroom-desktop" \
|
|
"${pkgdir}/usr/bin/darkroom-desktop"
|
|
|
|
install -Dm644 "packaging/paris.tourolle.darkroom.desktop" \
|
|
"${pkgdir}/usr/share/applications/paris.tourolle.darkroom.desktop"
|
|
|
|
# The icon's *name* is the contract, not its path: the desktop entry says
|
|
# `Icon=paris.tourolle.darkroom` and the compositor resolves that through
|
|
# the hicolor theme. Installed under 256x256 because that is the source's
|
|
# actual size — lying about it makes scaled-down icons look wrong.
|
|
install -Dm644 "ui/dr-ui/ui/app-icon.png" \
|
|
"${pkgdir}/usr/share/icons/hicolor/256x256/apps/paris.tourolle.darkroom.png"
|
|
|
|
install -Dm644 "README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md"
|
|
}
|