From ef32d65ac1852da581ac75d20f903dbcb2d0b5cd Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Mon, 23 Mar 2026 20:52:55 +0100 Subject: Use meson as a build system --- .gitignore | 1 + Makefile | 23 +---- README.md | 6 +- data/icons/meson.build | 10 +++ data/icons/systems.tranquil.Map-symbolic.svg | 1 + data/icons/systems.tranquil.Map.svg | 1 + data/meson.build | 79 +++++++++++++++++ data/systems.tranquil.Map.desktop.in.in | 14 +++ data/systems.tranquil.Map.metainfo.xml.in.in | 78 +++++++++++++++++ data/systems.tranquil.Map.service.in | 3 + data/wmap.lang | 123 +++++++++++++++++++++++++++ justfile | 14 +++ meson.build | 95 +++++++++++++++++++++ meson_options.txt | 9 ++ po/LINGUAS | 1 + po/POTFILES | 36 ++++---- po/en_US.po | 121 +++++++++++++++++++++----- po/meson.build | 1 + po/systems.tranquil.Map.pot | 113 +++++++++++++++++++----- resources/logo.svg | 1 - resources/systems.tranquil.Map.desktop | 14 --- resources/systems.tranquil.Map.metainfo.xml | 78 ----------------- resources/systems.tranquil.Map.service | 3 - resources/wmap.lang | 123 --------------------------- src/constants.rs | 4 - src/i18n.rs | 8 +- src/info.rs | 2 + src/info.rs.in | 2 + src/main.rs | 7 +- src/meson.build | 49 +++++++++++ src/preferences/storage.rs | 4 +- 31 files changed, 709 insertions(+), 315 deletions(-) create mode 100644 data/icons/meson.build create mode 100644 data/icons/systems.tranquil.Map-symbolic.svg create mode 100644 data/icons/systems.tranquil.Map.svg create mode 100644 data/meson.build create mode 100644 data/systems.tranquil.Map.desktop.in.in create mode 100644 data/systems.tranquil.Map.metainfo.xml.in.in create mode 100644 data/systems.tranquil.Map.service.in create mode 100644 data/wmap.lang create mode 100644 justfile create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 po/LINGUAS create mode 100644 po/meson.build delete mode 100644 resources/logo.svg delete mode 100644 resources/systems.tranquil.Map.desktop delete mode 100644 resources/systems.tranquil.Map.metainfo.xml delete mode 100644 resources/systems.tranquil.Map.service delete mode 100644 resources/wmap.lang create mode 100644 src/info.rs create mode 100644 src/info.rs.in create mode 100644 src/meson.build diff --git a/.gitignore b/.gitignore index a78d59e..0e4f422 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /.cache *.mo builddir +_build .flatpak-builder ./*.minisig *.minisig diff --git a/Makefile b/Makefile index a75b3f0..91db49a 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,8 @@ flatpak_cargo_generator := $(HOME)/projects/vendor/flatpak-builder-tools/cargo # Config: Packaging Config ##################################################### linuxdeploy_url := https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$(shell uname -m).AppImage linuxdeploy := .cache/linuxdeploy.AppImage -pkgver := $(shell grep '^pkgver=' build-aux/PKGBUILD | cut -d= -f2) -pkgrel := $(shell grep '^pkgrel=' build-aux/PKGBUILD | cut -d= -f2) +pkgver := $(shell grep '^pkgver=' build-aux/arch/PKGBUILD | cut -d= -f2) +pkgrel := $(shell grep '^pkgrel=' build-aux/arch/PKGBUILD | cut -d= -f2) # Filename format: map-aarch64-unstable.flatpak or map-aarch64-unstable-fedora43.rpm filename = $(app_name)-$(arch)-$(channel) @@ -71,23 +71,6 @@ format: lint: cargo fmt -- --check && cargo clippy -# Internationalization / Localization ########################################## - -find_translatable_files: - @find ./ -not -path '*/.*' -type f -name "*.rs" -exec grep -l "tr!(\"\|gettext" {} \; | sort > po/POTFILES - -extract_strings: find_translatable_files - @xgettext --files-from=po/POTFILES --output=po/systems.tranquil.Map.pot --from-code=UTF-8 --add-comments --keyword='tr!' - -po_files := $(wildcard po/*.po) -mo_files := $(patsubst po/%.po,po/%/LC_MESSAGES/systems.tranquil.Map.mo,$(po_files)) - -compile_translations: $(mo_files) - -po/%/LC_MESSAGES/systems.tranquil.Map.mo: po/%.po - @mkdir -p $(dir $@) - msgfmt $< -o $@ - # Container Images ############################################################# build-container-%: @@ -160,7 +143,7 @@ endif package-pacman: @$(eval staging := $(shell mktemp -d)) rsync -a --filter=':- .gitignore' --exclude='.git' . $(staging)/src - cp build-aux/PKGBUILD $(staging)/ + cp build-aux/arch/PKGBUILD $(staging)/ cd $(staging) && PKGEXT='.pkg.tar.gz' makepkg -f mv $(staging)/$(app_name)-$(pkgver)-$(pkgrel)-$(arch).pkg.tar.gz $(app_name)-$(arch)-$(channel)-arch.pkg.tar.gz @rm -rf $(staging) diff --git a/README.md b/README.md index d3818a8..d03f4fa 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,11 @@ A wardley mapping tool: Write some text, get a diagram ## Building -Run `make build` +For default settings, `just build` + +This project uses meson and ninja on top of the rust tools. + +1. Run `meson setup _build` ## Installing diff --git a/data/icons/meson.build b/data/icons/meson.build new file mode 100644 index 0000000..2ab86e9 --- /dev/null +++ b/data/icons/meson.build @@ -0,0 +1,10 @@ +install_data( + '@0@.svg'.format(application_id), + install_dir: iconsdir / 'hicolor' / 'scalable' / 'apps' +) + +install_data( + '@0@-symbolic.svg'.format(base_id), + install_dir: iconsdir / 'hicolor' / 'symbolic' / 'apps', + rename: '@0@-symbolic.svg'.format(application_id) +) diff --git a/data/icons/systems.tranquil.Map-symbolic.svg b/data/icons/systems.tranquil.Map-symbolic.svg new file mode 100644 index 0000000..76beb4d --- /dev/null +++ b/data/icons/systems.tranquil.Map-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data/icons/systems.tranquil.Map.svg b/data/icons/systems.tranquil.Map.svg new file mode 100644 index 0000000..8700fe1 --- /dev/null +++ b/data/icons/systems.tranquil.Map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..3ca5480 --- /dev/null +++ b/data/meson.build @@ -0,0 +1,79 @@ +subdir('icons') + +################################################################################ +# Desktop File +################################################################################ +desktop_file = i18n.merge_file( + type: 'desktop', + input: configure_file( + input: '@0@.desktop.in.in'.format(base_id), + output: '@BASENAME@', + configuration: { + 'app-id': application_id, + 'gettext-domain': gettext_domain + } + ), + output: '@0@.desktop'.format(application_id), + po_dir: podir, + install: true, + install_dir: datadir / 'applications' +) + +if desktop_file_validate.found() + test( + 'validate-desktop', + desktop_file_validate, + args: [ + desktop_file.full_path() + ], + depends: desktop_file, + ) +endif + +################################################################################ +# Appdata / Metainfo File +################################################################################ +appdata_file = i18n.merge_file( + input: configure_file( + input: '@0@.metainfo.xml.in.in'.format(base_id), + output: '@BASENAME@', + configuration: { + 'app-id': application_id, + 'gettext-domain': gettext_domain + } + ), + output: '@0@.metainfo.xml'.format(application_id), + po_dir: podir, + install: true, + install_dir: datadir / 'metainfo' +) + +if appstream_util.found() + test( + 'validate-appdata', appstream_util, + args: [ + 'validate', '--nonet', appdata_file.full_path() + ], + depends: appdata_file, + ) +endif + +################################################################################ +# DBUS Service File +################################################################################ +configure_file( + input: '@0@.service.in'.format(base_id), + output: '@BASENAME@', + configuration: { + 'app-id': application_id, + 'binary': meson.project_name(), + 'bindir': bindir + }, + install: true, + install_dir: datadir / 'dbus-1' / 'services' +) + +install_data( + 'wmap.lang', + install_dir: datadir / 'gtksourceview-5' / 'language-specs' +) diff --git a/data/systems.tranquil.Map.desktop.in.in b/data/systems.tranquil.Map.desktop.in.in new file mode 100644 index 0000000..82b4bec --- /dev/null +++ b/data/systems.tranquil.Map.desktop.in.in @@ -0,0 +1,14 @@ +[Desktop Entry] +Type=Application +Name=application.name +GenericName=application.generic_name +Comment=application.comment +Categories=GNOME;GTK;Graphics;Utility; +Icon=@app-id@ +Exec=map %u +Terminal=false +Keywords=application.tags +X-GNOME-Gettext-Domain=@gettext-domain@ +MimeType=application/vnd.wmap +StartupNotify=true +DBusActivatable=true diff --git a/data/systems.tranquil.Map.metainfo.xml.in.in b/data/systems.tranquil.Map.metainfo.xml.in.in new file mode 100644 index 0000000..75ff997 --- /dev/null +++ b/data/systems.tranquil.Map.metainfo.xml.in.in @@ -0,0 +1,78 @@ + + + @app-id@ + + application.name + application.summary + + CC-BY-SA-4.0 + AGPL-3.0-or-later + + + pointing + keyboard + touch + + + 350 + + + +

+ application.description +

+
+ + @app-id@.desktop + + + + https://map.tranquil.systems/img/screenshots/key-flathub.png + application.screenshot.key.caption + + + https://map.tranquil.systems/img/screenshots/preferences-flathub.png + application.screenshot.preferences.caption + + + + + + https://map.tranquil.systems/map-for-linux + https://git.sr.ht/~rbdr/map-linux + https://todo.sr.ht/~rbdr/wmap + + + + +

Editing preferences now works better on small screens.

+
    +
  • Templates preferences window uses a collapsible sidebar to work better in small screen sizes.
  • +
  • The layout of all other preference windows should display properly in screen sizes up to 360px
  • +
+
+
+ + +

Improved layout for small screens, and about window.

+
    +
  • Automatically switches to vertical layout when using smaller window sizes (eg. for phones)
  • +
  • Adds an about window that includes a link to report issues, and a reference of the language.
  • +
+
+
+ +
+ + + Rubén Beltrán del Río + + + + #FFCEC7 + #592e2e + + + inquiries@work.bdr.sh + @gettext-domain@ +
diff --git a/data/systems.tranquil.Map.service.in b/data/systems.tranquil.Map.service.in new file mode 100644 index 0000000..b6cd998 --- /dev/null +++ b/data/systems.tranquil.Map.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=@app-id@ +Exec=@bindir@/@binary@ --gapplication-service diff --git a/data/wmap.lang b/data/wmap.lang new file mode 100644 index 0000000..e05c8d3 --- /dev/null +++ b/data/wmap.lang @@ -0,0 +1,123 @@ + + + + text/x-wmap + *.wmap + # + + + +