aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-aux/PKGBUILD50
-rw-r--r--build-aux/arch/PKGBUILD29
-rw-r--r--build-containers/arch/Containerfile2
-rw-r--r--justfile16
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)
diff --git a/justfile b/justfile
index 37ddc01..4313969 100644
--- a/justfile
+++ b/justfile
@@ -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