diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | CHANGELOG | 10 | ||||
| -rw-r--r-- | Cargo.toml | 5 | ||||
| -rw-r--r-- | Makefile | 147 | ||||
| -rw-r--r-- | README.md | 7 | ||||
| -rw-r--r-- | build-aux/arch/PKGBUILD | 9 | ||||
| -rw-r--r-- | build-aux/debian/changelog | 36 | ||||
| -rw-r--r-- | build-aux/debian/control | 29 | ||||
| -rw-r--r-- | build-aux/debian/copyright | 10 | ||||
| -rwxr-xr-x | build-aux/debian/rules | 5 | ||||
| -rw-r--r-- | build-aux/debian/source/format | 1 | ||||
| -rw-r--r-- | build-aux/rpm/map.spec | 89 | ||||
| -rw-r--r-- | build-containers/bookworm/Containerfile | 26 | ||||
| -rw-r--r-- | build-containers/fedora-rawhide/Containerfile | 20 | ||||
| -rw-r--r-- | build-containers/fedora43/Containerfile | 20 | ||||
| -rw-r--r-- | build-containers/fedora44/Containerfile | 21 | ||||
| -rw-r--r-- | build-containers/forky/Containerfile | 20 | ||||
| -rw-r--r-- | build-containers/trixie/Containerfile | 33 | ||||
| -rw-r--r-- | justfile | 20 | ||||
| -rwxr-xr-x | scripts/build_appimage.sh | 37 | ||||
| -rwxr-xr-x | scripts/build_arch.sh | 33 | ||||
| -rwxr-xr-x | scripts/build_deb.sh | 31 | ||||
| -rwxr-xr-x | scripts/build_rpm.sh | 36 | ||||
| -rwxr-xr-x | scripts/sync_versions.sh | 20 |
24 files changed, 441 insertions, 225 deletions
@@ -3,6 +3,7 @@ /.cache *.mo builddir +vendor _build dist src/info.rs @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased -## 1.0.4 - 2026-01-30 +## 1.0.4 - 2026-03-30 ### Changed @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 (KNOWN ISSUE: For sizes under 377 px, the templates screen will move slightly) * Stop building rpms for fedora 42 and add fedora 44. -## 1.0.3 - 2026-01-27 +## 1.0.3 - 2026-03-27 ### Added @@ -27,20 +27,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Brand colors for flathub provide better contrast. * New icon. * Summary that's more descriptive for a layperson. -* Disble horizontal layout at smaller window sizes to make usage easier on phones. +* Disable horizontal layout at smaller window sizes to make usage easier on phones. * Use Adwaita window and toolbar ## 1.0.2 - 2026-01-24 ### Changed -* Adds adwaita feature to relm4 +* Add adwaita feature to relm4 ## 1.0.1 - 2026-01-19 ### Changed -* Adds adwaita feature to relm4 +* Add adwaita feature to relm4 ## 1.0.0 - 2026-01-19 @@ -41,11 +41,6 @@ assets = [ { source = "po/en_US/LC_MESSAGES/systems.tranquil.Map.mo", dest = "/usr/share/locale/en_US/LC_MESSAGES/systems.tranquil.Map.mo", mode = "644" }, ] -[package.metadata.generate-rpm.requires] -gtk4 = "*" -libadwaita = "*" -gtksourceview5 = "*" - [package.metadata.deb] depends = "libgtk-4-1, libadwaita-1-0, libgtksourceview-5-0" assets = [ @@ -42,35 +42,6 @@ define sign_and_deploy rsync -avz $(1).minisig $(deploy_host):$(deploy_path) endef -default: build - -set_rust: - rustup default stable - -prepare: -ifneq ($(skip_prepare),1) - rustup target add $(target) -endif - -# Build ######################################################################## - -build: compile_translations prepare - cargo build --profile $(profile) --target $(target) - -# Code Quality ################################################################# - -test: - cargo test - -coverage: - cargo tarpaulin - -format: - cargo fmt && cargo clippy --fix - -lint: - cargo fmt -- --check && cargo clippy - # Container Images ############################################################# build-container-%: @@ -90,135 +61,74 @@ build-containers: $(addprefix build-container-,$(all_containers)) # shouldn't affect the outcome. update_flatpak_dependencies: - cd $(flatpak_cargo_generator) && `poetry env activate` && python3 flatpak-cargo-generator.py $(CURDIR)/Cargo.lock -o $(CURDIR)/build-aux/cargo-sources.json && deactivate - -package-tar: build - @$(eval staging := $(shell mktemp -d)) - @install -Dm0755 target/$(target)/$(output_dir)/$(app_name) $(staging)/usr/bin/$(app_name) - @install -Dm0644 resources/logo.svg $(staging)/usr/share/icons/hicolor/scalable/apps/systems.tranquil.Map.svg - @install -Dm0644 resources/systems.tranquil.Map.desktop $(staging)/usr/share/applications/systems.tranquil.Map.desktop - @install -Dm0644 resources/systems.tranquil.Map.metainfo.xml $(staging)/usr/share/metainfo/systems.tranquil.Map.metainfo.xml - @install -Dm0644 resources/systems.tranquil.Map.service $(staging)/usr/share/dbus-1/services/systems.tranquil.Map.service - @install -Dm0644 resources/wmap.lang $(staging)/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 $(staging)/usr/share/locale/$$locale/LC_MESSAGES/systems.tranquil.Map.mo; \ - done - tar -czvf $(filename).tar.gz -C $(staging) usr - @rm -rf $(staging) + cd $(flatpak_cargo_generator) && `poetry env activate` && python3 flatpak-cargo-generator.py $(CURDIR)/Cargo.lock -o $(CURDIR)/build-aux/flatpak/cargo-sources.json && deactivate package-flatpak: update_flatpak_dependencies - flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir ./build-aux/systems.tranquil.Map.yml - flatpak build-bundle repo $(filename).flatpak systems.tranquil.Map + flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir ./build-aux/flatpak/systems.tranquil.Map.yml + flatpak build-bundle repo dist/$(filename).flatpak systems.tranquil.Map $(linuxdeploy): @mkdir -p .cache curl -L -o $(linuxdeploy) $(linuxdeploy_url) chmod +x $(linuxdeploy) -package-appimage: build $(linuxdeploy) +package-appimage: $(linuxdeploy) ifeq ($(findstring linux,$(target)),linux) - @rm -f *.AppImage - @$(eval appdir := $(shell mktemp -d)) - @install -Dm0755 target/$(target)/$(output_dir)/$(app_name) $(appdir)/usr/bin/$(app_name) - @install -Dm0644 resources/logo.svg $(appdir)/usr/share/icons/hicolor/scalable/apps/systems.tranquil.Map.svg - @install -Dm0644 resources/systems.tranquil.Map.desktop $(appdir)/usr/share/applications/systems.tranquil.Map.desktop - @install -Dm0644 resources/systems.tranquil.Map.metainfo.xml $(appdir)/usr/share/metainfo/systems.tranquil.Map.metainfo.xml - @install -Dm0644 resources/systems.tranquil.Map.service $(appdir)/usr/share/dbus-1/services/systems.tranquil.Map.service - @install -Dm0644 resources/wmap.lang $(appdir)/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 $(appdir)/usr/share/locale/$$locale/LC_MESSAGES/systems.tranquil.Map.mo; \ - done - APPIMAGE_EXTRACT_AND_RUN=1 NO_STRIP=true $(linuxdeploy) --appdir=$(appdir) --output=appimage --desktop-file=resources/systems.tranquil.Map.desktop --icon-file=resources/logo.svg - mv *.AppImage $(filename).AppImage - @rm -rf $(appdir) + $(MAKE) build-container-trixie + @echo "=== Building AppImage ===" + ./scripts/build_appimage.sh $(container_image_prefix) trixie $(app_name) $(arch) $(channel) $(linuxdeploy) +ifeq ($(clean_images),1) + podman rmi $(container_image_prefix):trixie +endif endif # Distro-specific packages # These run inside containers, as we want to make sure they're built with the # libraries available in that particular distribution. -# Internal target: runs inside arch container -package-pacman: - @$(eval staging := $(shell mktemp -d)) - rsync -a --filter=':- .gitignore' --exclude='.git' . $(staging)/src - 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) - -# Internal target: runs inside fedora container -package-rpm: build -ifeq ($(findstring linux,$(target)),linux) - cargo generate-rpm --profile $(profile) --target $(target) - mv target/$(target)/generate-rpm/*.rpm $(filename)-$(distro).rpm -endif - -# Internal target: runs inside debian container -package-deb: build -ifeq ($(findstring linux,$(target)),linux) - cargo deb --profile $(profile) --target $(target) - mv target/$(target)/debian/*.deb $(filename)-$(distro).deb -endif - -# -# Podman wrappers for distro-specific builds -# - -package-pacman-podman: build-container-arch +package-arch: build-container-arch @echo "=== Building Arch package for $(arch) ===" - podman run --rm -v $(CURDIR):/src:Z -w /src $(container_image_prefix):arch bash -c '\ - staging=$$(mktemp -d) && \ - cp -r /src/. $$staging/ && \ - chown -R builder:builder $$staging && \ - su builder -c "cd $$staging && make -e profile=$(profile) -e channel=$(channel) -e target=$(target) package-pacman" && \ - cp $$staging/$(app_name)-$(arch)-$(channel)-arch.pkg.tar.gz /src/' + ./scripts/build_arch.sh $(container_image_prefix) arch $(app_name) $(arch) $(channel) ifeq ($(clean_images),1) podman rmi $(container_image_prefix):arch endif -package-rpm-podman: +package-rpm: ifndef distro - $(error distro is required, e.g., make package-rpm-podman distro=fedora43) + $(error distro is required, e.g., make package-rpm distro=fedora43) endif $(MAKE) build-container-$(distro) @echo "=== Building RPM for $(distro) ($(arch)) ===" - podman run --rm -v $(CURDIR):/src:Z -w /src $(container_image_prefix):$(distro) \ - make profile=$(profile) channel=$(channel) target=$(target) distro=$(distro) package-rpm + ./scripts/build_rpm.sh $(container_image_prefix) $(distro) $(app_name) $(arch) $(channel) ifeq ($(clean_images),1) podman rmi $(container_image_prefix):$(distro) endif -package-deb-podman: +package-deb: ifndef distro - $(error distro is required, e.g., make package-deb-podman distro=bookworm) + $(error distro is required, e.g., make package-deb distro=trixie) endif $(MAKE) build-container-$(distro) @echo "=== Building DEB for $(distro) ($(arch)) ===" - podman run --rm -v $(CURDIR):/src:Z -w /src $(container_image_prefix):$(distro) \ - make profile=$(profile) channel=$(channel) target=$(target) distro=$(distro) package-deb + ./scripts/build_deb.sh $(container_image_prefix) $(distro) $(app_name) $(arch) $(channel) ifeq ($(clean_images),1) podman rmi $(container_image_prefix):$(distro) endif package-rpm-all: @for v in $(fedora_versions); do \ - $(MAKE) distro=$$v package-rpm-podman; \ + $(MAKE) distro=$$v package-rpm; \ done package-deb-all: @for v in $(debian_versions); do \ - $(MAKE) distro=$$v package-deb-podman; \ + $(MAKE) distro=$$v package-deb; \ done -package: package-tar package-flatpak package-appimage package-pacman-podman package-rpm-all package-deb-all +package: package-tar package-flatpak package-appimage package-arch package-rpm-all package-deb-all # Distribution ################################################################# -distribute-tar: - @$(call sign_and_deploy,$(filename).tar.gz) - distribute-flatpak: @$(call sign_and_deploy,$(filename).flatpak) @@ -242,7 +152,7 @@ distribute-deb: rsync -avz $(filename)-$$v.deb.minisig $(deploy_host):$(deploy_path); \ done -distribute: distribute-tar distribute-flatpak distribute-appimage distribute-pacman distribute-rpm distribute-deb +distribute: distribute-tar distribute-flatpak distribute-appimage distribute-arch distribute-rpm distribute-deb # Release ###################################################################### @@ -276,7 +186,6 @@ uninstall: done ci: lint -# Installation ################################################################# ifeq ($(GIT_REF),refs/heads/main) $(MAKE) -e channel=unstable release else ifneq (,$(findstring refs/tags/,$(GIT_REF))) @@ -285,13 +194,11 @@ else @echo "Not in CI environment." endif -.PHONY: default build test coverage format lint \ - find_translatable_files extract_strings compile_translations \ +.PHONY: default \ update_flatpak_dependencies \ - package-tar package-flatpak package-appimage \ - package-pacman package-rpm package-deb \ - package-pacman-podman package-rpm-podman package-deb-podman \ + package-flatpak package-appimage \ + package-arch package-rpm package-deb \ package-rpm-all package-deb-all package \ - distribute-tar distribute-flatpak distribute-appimage distribute-pacman distribute-rpm distribute-deb distribute \ - release install uninstall set_rust prepare \ + distribute-flatpak distribute-appimage distribute-arch distribute-rpm distribute-deb distribute \ + release install uninstall \ build-containers @@ -1,6 +1,6 @@ # Map for Linux -A wardley mapping tool: Write some text, get a diagram +A wardley mapping tool for linux: Write some text, get a diagram. ## Building @@ -28,6 +28,11 @@ Run `make test` * To format: `make format` * To lint: `make lint` +## Notes for Developers. + +`meson.build` is the source of truth for the version. A script will update all +other sources to make sure they're in sync. + ## Distributing Available package formats: deb, rpm, tar.gz, flatpak diff --git a/build-aux/arch/PKGBUILD b/build-aux/arch/PKGBUILD index 66ae6e0..330828c 100644 --- a/build-aux/arch/PKGBUILD +++ b/build-aux/arch/PKGBUILD @@ -9,21 +9,22 @@ 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=() +source=("map-${pkgver}.tar.xz") +sha256sums=('SKIP') prepare() { - cd "$startdir/src" + cd "${pkgname}-${pkgver}" export RUSTUP_TOOLCHAIN=stable cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" } build() { - cd "$startdir/src" + cd "${pkgname}-${pkgver}" meson setup --prefix /usr _build . meson compile -C _build } package() { + cd "${pkgname}-${pkgver}" meson install -C _build --destdir $pkgdir } diff --git a/build-aux/debian/changelog b/build-aux/debian/changelog new file mode 100644 index 0000000..361da8f --- /dev/null +++ b/build-aux/debian/changelog @@ -0,0 +1,36 @@ +map (1.0.4) unstable; urgency=low + + * Fix rendering issue with icon in about page when installing via flatpak + * Use breakpoints to render preferences correctly in mobile screens + * Stop building rpms for fedora 42 and add fedora 44 + + -- Rubén Beltrán del Río <map@r.bdr.sh> Mon, 30 Mar 2026 00:00:00 +0000 + +map (1.0.3) unstable; urgency=low + + * Add about window with a reference of the language + * Brand colors for flathub provide better contrast + * New icon + * Summary that's more descriptive for a layperson + * Disable horizontal layout at smaller window sizes to make usage easier on phones + * Use Adwaita window and toolbar + + -- Rubén Beltrán del Río <map@r.bdr.sh> Fri, 27 Mar 2026 00:00:00 +0000 + +map (1.0.2) unstable; urgency=low + + * Add adwaita feature to relm4 + + -- Rubén Beltrán del Río <map@r.bdr.sh> Sat, 24 Jan 2026 00:00:00 +0000 + +map (1.0.1) unstable; urgency=low + + * Add adwaita feature to relm4 + + -- Rubén Beltrán del Río <map@r.bdr.sh> Mon, 19 Jan 2026 01:00:00 +0000 + +map (1.0.0) unstable; urgency=low + + * Initial release + + -- Rubén Beltrán del Río <map@r.bdr.sh> Mon, 19 Jan 2026 00:00:00 +0000 diff --git a/build-aux/debian/control b/build-aux/debian/control new file mode 100644 index 0000000..d0daada --- /dev/null +++ b/build-aux/debian/control @@ -0,0 +1,29 @@ +Source: map +Maintainer: Rubén Beltrán del Río <map@r.bdr.sh> +Section: graphics +Build-Depends: debhelper-compat (= 13), + meson (>= 1.0.0), + cargo, + rustc (>= 1.92.0), + pkg-config, + libglib2.0-dev (>= 2.84.0), + libgtk-4-dev (>= 4.18.0), + libadwaita-1-dev (>= 1.7.0), + libgtksourceview-5-dev (>= 5.16.0), + gettext, + appstream-util, + desktop-file-utils +Standards-Version: 4.7.4 +Homepage: https://map.tranquil.systems/map-for-linux +Vcs-Browser: https://git.sr.ht/~rbdr/map-linux +Vcs-Git: https://git.sr.ht/~rbdr/map-linux +Rules-Requires-Root: no + +Package: map +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Wardley Map editor for Linux + Map is a wardley map editor for linux that uses a simple language to easily + create and edit maps that visualize an evolving environment. Draw components, + link dependencies, create groups, write notes, or add inertia and evolution + markers, and see your map change in an instant. diff --git a/build-aux/debian/copyright b/build-aux/debian/copyright new file mode 100644 index 0000000..e7a8a68 --- /dev/null +++ b/build-aux/debian/copyright @@ -0,0 +1,10 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Map +Upstream-Contact: Rubén Beltrán del Río <map@r.bdr.sh> +Source: https://map.tranquil.systems/map-for-linux + +Files: * +Copyright: Copyright 2026 Rubén Beltrán del Río +License: AGPL-3.0-or-later + On Debian systems, the full text of the GNU Affero General Public + License version 3 can be found in /usr/share/common-licenses/AGPL-3 diff --git a/build-aux/debian/rules b/build-aux/debian/rules new file mode 100755 index 0000000..2bc4511 --- /dev/null +++ b/build-aux/debian/rules @@ -0,0 +1,5 @@ +#!/usr/bin/make -f +%: + dh $@ --buildsystem=meson + +override_dh_auto_test: diff --git a/build-aux/debian/source/format b/build-aux/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/build-aux/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/build-aux/rpm/map.spec b/build-aux/rpm/map.spec new file mode 100644 index 0000000..d0b5981 --- /dev/null +++ b/build-aux/rpm/map.spec @@ -0,0 +1,89 @@ +%global app_id systems.tranquil.Map + +Name: map +Version: 1.0.4 +Release: 1%{?dist} +Summary: Wardley Map editor for Linux + +License: AGPL-3.0-or-later +URL: https://map.tranquil.systems/map-for-linux +Source0: %{name}-%{version}.tar.xz +Source1: %{name}-%{version}-vendor.tar.xz + +BuildRequires: meson >= 1.0.0 +BuildRequires: rust >= 1.92 +BuildRequires: cargo +BuildRequires: gettext +BuildRequires: pkgconfig(glib-2.0) >= 2.84.0 +BuildRequires: pkgconfig(gio-2.0) >= 2.84.0 +BuildRequires: pkgconfig(gtk4) >= 4.18.0 +BuildRequires: pkgconfig(libadwaita-1) >= 1.7.0 +BuildRequires: pkgconfig(gtksourceview-5) >= 5.16.0 + +Requires: gtk4 >= 4.18.0 +Requires: libadwaita >= 1.7.0 +Requires: gtksourceview5 >= 5.16.0 + +%description +A Wardley Map editor for Linux, built with GTK4 and libadwaita. + +%prep +%autosetup -p1 +%autosetup -T -D -a1 + +mkdir -p .cargo +cat > .cargo/config.toml << 'EOF' +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" +EOF + +%build +%meson +%meson_build + +%install +%meson_install + +%check +%meson_test +desktop-file-validate %{buildroot}%{_datadir}/applications/%{app_id}.desktop +appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{app_id}.metainfo.xml + +%files +%license LICENSE +%doc README.md +%{_bindir}/map +%{_datadir}/applications/%{app_id}.desktop +%{_datadir}/metainfo/%{app_id}.metainfo.xml +%{_datadir}/icons/hicolor/scalable/apps/%{app_id}.svg +%{_datadir}/icons/hicolor/symbolic/apps/%{app_id}-symbolic.svg +%{_datadir}/dbus-1/services/%{app_id}.service +%{_datadir}/gtksourceview-5/language-specs/wmap.lang +%{_datadir}/locale/*/LC_MESSAGES/%{app_id}.mo + +%changelog +* Mon Mar 30 2026 Rubén Beltrán del Río <map@r.bdr.sh> - 1.0.4-1 +- Fix rendering issue with icon in about page when installing via flatpak +- Use breakpoints to render preferences correctly in mobile screens + (KNOWN ISSUE: For sizes under 377 px, the templates screen will move slightly) +- Stop building rpms for fedora 42 and add fedora 44 + +* Fri Mar 27 2026 Rubén Beltrán del Río <map@r.bdr.sh> - 1.0.3-1 +- Add about window with a reference of the language +- Brand colors for flathub provide better contrast +- New icon +- Summary that's more descriptive for a layperson +- Disable horizontal layout at smaller window sizes to make usage easier on phones +- Use Adwaita window and toolbar + +* Sat Jan 24 2026 Rubén Beltrán del Río <map@r.bdr.sh> - 1.0.2-1 +- Add adwaita feature to relm4 + +* Mon Jan 19 2026 Rubén Beltrán del Río <map@r.bdr.sh> - 1.0.1-1 +- Add adwaita feature to relm4 + +* Mon Jan 19 2026 Rubén Beltrán del Río <map@r.bdr.sh> - 1.0.0-1 +- Initial release diff --git a/build-containers/bookworm/Containerfile b/build-containers/bookworm/Containerfile deleted file mode 100644 index 852e2e8..0000000 --- a/build-containers/bookworm/Containerfile +++ /dev/null @@ -1,26 +0,0 @@ -FROM docker.io/library/debian:bookworm - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && apt-get install -y \ - make \ - clang \ - lld \ - curl \ - tar \ - gzip \ - gettext \ - libgtk-4-dev \ - libadwaita-1-dev \ - libgtksourceview-5-dev \ - pkg-config \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Install rust toolchain -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" - -# Install cargo-deb -RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \ - && cargo binstall cargo-deb --no-confirm diff --git a/build-containers/fedora-rawhide/Containerfile b/build-containers/fedora-rawhide/Containerfile index 6869330..3db886c 100644 --- a/build-containers/fedora-rawhide/Containerfile +++ b/build-containers/fedora-rawhide/Containerfile @@ -1,23 +1,15 @@ FROM docker.io/library/fedora:rawhide RUN dnf install -y \ - make \ - clang \ - lld \ - curl \ - tar \ - gzip \ + meson \ + rpm-build \ + cargo \ + rust \ + desktop-file-utils \ + libappstream-glib \ gettext \ gtk4-devel \ libadwaita-devel \ gtksourceview5-devel \ pkg-config \ && dnf clean all - -# Install rust toolchain -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" - -# Install cargo-generate-rpm -RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \ - && cargo binstall cargo-generate-rpm --no-confirm diff --git a/build-containers/fedora43/Containerfile b/build-containers/fedora43/Containerfile index 8b4b3aa..ad16530 100644 --- a/build-containers/fedora43/Containerfile +++ b/build-containers/fedora43/Containerfile @@ -1,23 +1,15 @@ FROM docker.io/library/fedora:43 RUN dnf install -y \ - make \ - clang \ - lld \ - curl \ - tar \ - gzip \ + meson \ + rpm-build \ + cargo \ + rust \ + desktop-file-utils \ + libappstream-glib \ gettext \ gtk4-devel \ libadwaita-devel \ gtksourceview5-devel \ pkg-config \ && dnf clean all - -# Install rust toolchain -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" - -# Install cargo-generate-rpm -RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \ - && cargo binstall cargo-generate-rpm --no-confirm diff --git a/build-containers/fedora44/Containerfile b/build-containers/fedora44/Containerfile index fb54803..18ff672 100644 --- a/build-containers/fedora44/Containerfile +++ b/build-containers/fedora44/Containerfile @@ -1,24 +1,15 @@ FROM docker.io/library/fedora:44 RUN dnf install -y \ - make \ - clang \ - lld \ - curl \ - tar \ - gzip \ + meson \ + rpm-build \ + cargo \ + rust \ + desktop-file-utils \ + libappstream-glib \ gettext \ gtk4-devel \ libadwaita-devel \ gtksourceview5-devel \ pkg-config \ && dnf clean all - -# Install rust toolchain -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" - -# Install cargo-generate-rpm -RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \ - && cargo binstall cargo-generate-rpm --no-confirm - diff --git a/build-containers/forky/Containerfile b/build-containers/forky/Containerfile index 386fe00..ae72361 100644 --- a/build-containers/forky/Containerfile +++ b/build-containers/forky/Containerfile @@ -3,13 +3,17 @@ FROM docker.io/library/debian:forky ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y \ - make \ - clang \ - lld \ - ca-certificates \ + debhelper-compat \ + meson \ + cargo \ + rustc \ + desktop-file-utils \ + appstream-util \ curl \ + ca-certificates \ tar \ gzip \ + file \ gettext \ libgtk-4-dev \ libadwaita-1-dev \ @@ -17,11 +21,3 @@ RUN apt-get update && apt-get install -y \ pkg-config \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* - -# Install rust toolchain -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" - -# Install cargo-deb -RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \ - && cargo binstall cargo-deb --no-confirm diff --git a/build-containers/trixie/Containerfile b/build-containers/trixie/Containerfile index 904de18..46c2111 100644 --- a/build-containers/trixie/Containerfile +++ b/build-containers/trixie/Containerfile @@ -3,12 +3,16 @@ FROM docker.io/library/debian:trixie ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y \ - make \ - clang \ - lld \ + debhelper-compat \ + equivs \ + meson \ + desktop-file-utils \ + appstream-util \ curl \ + ca-certificates \ tar \ gzip \ + file \ gettext \ libgtk-4-dev \ libadwaita-1-dev \ @@ -20,7 +24,24 @@ RUN apt-get update && apt-get install -y \ # Install rust toolchain RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" +ENV RUSTUP_TOOLCHAIN=stable -# Install cargo-deb -RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \ - && cargo binstall cargo-deb --no-confirm +RUN apt-get install -y --no-install-recommends equivs && \ + mkdir -p /tmp/equivs && cd /tmp/equivs && \ + cat > rust-rustup.control <<'EOF' +Section: misc +Priority: optional +Standards-Version: 4.7.4 +Package: rust-rustup +Version: 1.92.0 +Provides: rustc (= 1.92.0), cargo (= 1.92.0) +Description: Dummy package claiming rustc/cargo are provided by rustup. + This package exists solely to satisfy dpkg Build-Depends checks to + create the binary package from the source package. +EOF + +RUN cd /tmp/equivs && \ + equivs-build rust-rustup.control && \ + dpkg -i rust-rustup_1.92.0_all.deb && \ + rm -rf /tmp/equivs && \ + apt-get remove -y equivs && apt-get autoremove -y && apt-get clean @@ -1,7 +1,12 @@ # Build ######################################################################## -build: - meson setup _build - meson compile -C _build +setup: + meson setup _build + +build: setup + meson compile -C _build + +dist: setup + meson dist -C _build --no-tests --allow-dirty # Code Quality ################################################################# @@ -26,3 +31,12 @@ find_translatable_files: extract_strings: find_translatable_files @xgettext --files-from=po/POTFILES --output=po/systems.tranquil.Map.pot --from-code=UTF-8 --add-comments --keyword='tr!' + + +# Utility Tasks ################################################################ +version: + @grep -m1 -o "[^_]version: '[^']*'" meson.build | awk -F"'" '{print $2}' + +vendor location: + cargo vendor {{location}} >/dev/null + mkdir -p .cargo diff --git a/scripts/build_appimage.sh b/scripts/build_appimage.sh new file mode 100755 index 0000000..d39f506 --- /dev/null +++ b/scripts/build_appimage.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +set -euo pipefail + +container_image_prefix=$1 +distro=$2 +app_name=$3 +arch=$4 +channel=$5 +linuxdeploy=$6 + +version=`just version` +staging="$(mktemp -d)" + +just dist +tar -xJf "_build/meson-dist/map-${version}.tar.xz" -C "${staging}/" +cp ${linuxdeploy} "${staging}/linuxdeploy.AppImage" + +podman run --rm -v "${staging}:/build:Z" \ + ${container_image_prefix}:${distro} \ + bash -c " + cd /build/map-${version} + meson setup --prefix=/usr _build + meson compile -C _build + DESTDIR=/build/appdir meson install -C _build + cd /build + APPIMAGE_EXTRACT_AND_RUN=1 NO_STRIP=true /build/linuxdeploy.AppImage \ + --appdir=/build/appdir --output=appimage \ + --desktop-file=/build/appdir/usr/share/applications/systems.tranquil.Map.desktop \ + --icon-file=/build/appdir/usr/share/icons/hicolor/scalable/apps/systems.tranquil.Map.svg + mkdir -p /build/out + mv /build/Map*.AppImage /build/out/ + " + +mkdir -p dist +mv ${staging}/out/*.AppImage "dist/${app_name}-${arch}-${channel}.AppImage" +rm -rf "${staging}" diff --git a/scripts/build_arch.sh b/scripts/build_arch.sh new file mode 100755 index 0000000..602b31d --- /dev/null +++ b/scripts/build_arch.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +set -euo pipefail + +container_image_prefix=$1 +distro=$2 +app_name=$3 +arch=$4 +channel=$5 + +version=`just version` +staging="$(mktemp -d)" + +just dist +cp _build/meson-dist/map-${version}.tar.xz "${staging}/" + +cp build-aux/arch/PKGBUILD "${staging}/" + +podman run --rm -v "${staging}:/build:Z" \ + ${container_image_prefix}:${distro} \ + bash -c " + mkdir -p /tmp/pkg + cp /build/*.tar.xz /tmp/pkg + cp /build/PKGBUILD /tmp/pkg + chown -R builder:builder /tmp/pkg + su builder -c 'cd /tmp/pkg && PKGEXT=.pkg.tar.gz makepkg -f' + mkdir -p /build/out + cp /tmp/pkg/map-${version}-1-${arch}.pkg.tar.gz /build/out/ + " + +mkdir -p dist +cp ${staging}/out/*.pkg.tar.gz "dist/${app_name}-${arch}-${channel}-${distro}.pkg.tar.gz" +rm -rf "${staging}" diff --git a/scripts/build_deb.sh b/scripts/build_deb.sh new file mode 100755 index 0000000..66b51fa --- /dev/null +++ b/scripts/build_deb.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -euo pipefail + +container_image_prefix=$1 +distro=$2 +app_name=$3 +arch=$4 +channel=$5 + +version=`just version` +staging="$(mktemp -d)" + +just dist +cp _build/meson-dist/map-${version}.tar.xz "${staging}/${app_name}_${version}.orig.tar.xz" +tar -xJf "${staging}/${app_name}_${version}.orig.tar.xz" -C "${staging}" +mkdir -p ${staging}/${app_name}-${version} +cp -r build-aux/debian "${staging}/${app_name}-${version}/debian" + +podman run --rm -v "${staging}:/build:Z" \ + ${container_image_prefix}:${distro} \ + bash -c " + cd /build/${app_name}-${version} + dpkg-buildpackage -us -uc -b + mkdir -p /build/out + cp /build/${app_name}_${version}*_*.deb /build/out/ + " + +mkdir -p dist +cp ${staging}/out/*.deb "dist/${app_name}-${arch}-${channel}-${distro}.deb" +rm -rf "${staging}" diff --git a/scripts/build_rpm.sh b/scripts/build_rpm.sh new file mode 100755 index 0000000..efffef3 --- /dev/null +++ b/scripts/build_rpm.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -euo pipefail + +container_image_prefix=$1 +distro=$2 +app_name=$3 +arch=$4 +channel=$5 + +version=`just version` +staging="$(mktemp -d)" + +just dist +cp _build/meson-dist/map-${version}.tar.xz "${staging}/" + +just vendor "${staging}/vendor" +tar -cJf "${staging}/map-${version}-vendor.tar.xz" -C "${staging}" vendor +rm -rf "${staging}/vendor" + +cp build-aux/rpm/map.spec "${staging}/" + +podman run --rm -v "${staging}:/build:Z" \ + ${container_image_prefix}:${distro} \ + bash -c " + mkdir -p ~/rpmbuild/{SOURCES,SPECS} + cp /build/map-*.tar.xz ~/rpmbuild/SOURCES/ + cp /build/map.spec ~/rpmbuild/SPECS/ + rpmbuild -bb ~/rpmbuild/SPECS/map.spec + mkdir -p /build/out + cp ~/rpmbuild/RPMS/${arch}/map-${version}-1.*.rpm /build/out/ + " + +mkdir -p dist +cp ${staging}/out/*.rpm "dist/${app_name}-${arch}-${channel}-${distro}.rpm" +rm -rf "${staging}" diff --git a/scripts/sync_versions.sh b/scripts/sync_versions.sh new file mode 100755 index 0000000..f3955ef --- /dev/null +++ b/scripts/sync_versions.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +version=`just version` + +echo "Using version from meson.build: ${version}" + +# Rust Cargo.toml +echo -ne "\tUpdating: Cargo.toml" +sed -i "s/^version = \"[^\"]*\"$/version = \"$version\"/" Cargo.toml +echo -e "\r\tUpdated: Cargo.toml " + +# Arch PKGBUILD +echo -ne "\tUpdating: PKGBUILD" +sed -i "s/^pkgver=.*$/pkgver=$version/" build-aux/arch/PKGBUILD +echo -e "\r\tUpdated: PKGBUILD " + +# Fedora RPM Spec +echo -ne "\tUpdating: map.spec" +sed -i "s/^Version: .*$/Version: $version/" build-aux/rpm/map.spec +echo -e "\r\tUpdated: map.spec " |