diff options
| author | Ruben Beltran del Rio <jj@r.bdr.sh> | 2026-03-23 20:52:55 +0100 |
|---|---|---|
| committer | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-04-05 00:31:21 +0200 |
| commit | c7e9fb9dac3c0a2b4a0c6c2d5d34a12175aac096 (patch) | |
| tree | d9cafdea3432d7b5a13d3a47bfbe0808c554abb0 | |
| parent | 99fd689d01adeaa6847901c35172b533119fccda (diff) | |
Adapt arch build to use meson
| -rw-r--r-- | build-aux/PKGBUILD | 50 | ||||
| -rw-r--r-- | build-aux/arch/PKGBUILD | 29 | ||||
| -rw-r--r-- | build-containers/arch/Containerfile | 2 | ||||
| -rw-r--r-- | justfile | 16 |
4 files changed, 46 insertions, 51 deletions
diff --git a/build-aux/PKGBUILD b/build-aux/PKGBUILD deleted file mode 100644 index 6739b12..0000000 --- a/build-aux/PKGBUILD +++ /dev/null @@ -1,50 +0,0 @@ -# Maintainer: Ruben Beltran del Rio <wmap@r.bdr.sh> -pkgname=map -pkgver=1.0.4 -pkgrel=1 -pkgdesc="Wardley Map editor for Linux" -arch=('x86_64' 'aarch64') -url="https://map.tranquil.systems/map-for-linux" -license=('AGPL-3.0-or-later') -depends=('gtk4' 'libadwaita' 'gtksourceview5' 'cairo') -makedepends=('cargo' 'gettext') -options=('!debug') -source=() -sha256sums=() - -prepare() { - cd "$startdir/src" - export RUSTUP_TOOLCHAIN=stable - cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" -} - -build() { - cd "$startdir/src" - export RUSTUP_TOOLCHAIN=stable - export CARGO_TARGET_DIR=target - - # Compile translations - for po_file in po/*.po; do - locale=$(basename "$po_file" .po) - mkdir -p "po/$locale/LC_MESSAGES" - msgfmt "$po_file" -o "po/$locale/LC_MESSAGES/systems.tranquil.Map.mo" - done - - cargo build --frozen --release -} - -package() { - cd "$startdir/src" - - install -Dm0755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname" - install -Dm0644 resources/logo.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/systems.tranquil.Map.svg" - install -Dm0644 resources/systems.tranquil.Map.desktop "$pkgdir/usr/share/applications/systems.tranquil.Map.desktop" - install -Dm0644 resources/systems.tranquil.Map.metainfo.xml "$pkgdir/usr/share/metainfo/systems.tranquil.Map.metainfo.xml" - install -Dm0644 resources/systems.tranquil.Map.service "$pkgdir/usr/share/dbus-1/services/systems.tranquil.Map.service" - install -Dm0644 resources/wmap.lang "$pkgdir/usr/share/gtksourceview-5/language-specs/wmap.lang" - - for po_file in po/*.po; do - locale=$(basename "$po_file" .po) - install -Dm0644 "po/$locale/LC_MESSAGES/systems.tranquil.Map.mo" "$pkgdir/usr/share/locale/$locale/LC_MESSAGES/systems.tranquil.Map.mo" - done -} diff --git a/build-aux/arch/PKGBUILD b/build-aux/arch/PKGBUILD new file mode 100644 index 0000000..66ae6e0 --- /dev/null +++ b/build-aux/arch/PKGBUILD @@ -0,0 +1,29 @@ +# Maintainer: Ruben Beltran del Rio <wmap@r.bdr.sh> +pkgname=map +pkgver=1.0.4 +pkgrel=1 +pkgdesc="Wardley Map editor for Linux" +arch=('x86_64' 'aarch64') +url="https://map.tranquil.systems/map-for-linux" +license=('AGPL-3.0-or-later') +depends=('gtk4>=4.18.0' 'libadwaita>=1.7.0' 'gtksourceview5>=5.16.0' 'cairo>=1.18.0') +makedepends=(cargo 'meson>=1.0.0' gettext) +options=('!debug') +source=() +sha256sums=() + +prepare() { + cd "$startdir/src" + export RUSTUP_TOOLCHAIN=stable + cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" +} + +build() { + cd "$startdir/src" + meson setup --prefix /usr _build . + meson compile -C _build +} + +package() { + meson install -C _build --destdir $pkgdir +} diff --git a/build-containers/arch/Containerfile b/build-containers/arch/Containerfile index d732580..24e525d 100644 --- a/build-containers/arch/Containerfile +++ b/build-containers/arch/Containerfile @@ -1,6 +1,7 @@ FROM docker.io/ogarcia/archlinux:latest RUN pacman -Syu --noconfirm \ + appstream-glib \ make \ clang \ lld \ @@ -15,6 +16,7 @@ RUN pacman -Syu --noconfirm \ rsync \ rust \ pkgconf \ + meson \ && pacman -Scc --noconfirm # Create builder user for makepkg (can't run as root) @@ -3,11 +3,25 @@ build: meson setup _build meson compile -C _build +# Code Quality ################################################################# + +test: + cargo test + +coverage: + cargo tarpaulin + +format: + cargo fmt && cargo clippy --fix + +lint: + cargo fmt -- --check && cargo clippy + # Internationalization / Localization ########################################## # Finds all files that can be translated and adds them to the POTFILES find_translatable_files: - find ./ -not -path '*/.*' -type f -name "*.rs" -exec grep -l "tr!(\"\|gettext" {} \; | sed 's|^\./||' | sort > po/POTFILES + find ./src -not -path '*/.*' -type f -name "*.rs" -exec grep -l "tr!(\"\|gettext" {} \; | sed 's|^\./||' | sort > po/POTFILES find ./data -not -path '*/.*' -name "*.in.in" -type f | sed 's|^\./||' | sort >> po/POTFILES extract_strings: find_translatable_files |