From 96db3f4893fb5220234b41f8b4cbc30221905151 Mon Sep 17 00:00:00 2001 From: John Turner Date: Wed, 27 Aug 2025 02:40:36 -0400 Subject: replace makefile with meson --- .dir-locals.el | 6 +++++- blog/meson.build | 14 ++++++++++++++ makefile | 30 ------------------------------ meson.build | 30 ++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 31 deletions(-) create mode 100644 blog/meson.build delete mode 100644 makefile create mode 100644 meson.build diff --git a/.dir-locals.el b/.dir-locals.el index 8bd8ac1..042b2ea 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -3,4 +3,8 @@ (eval . (flycheck-add-next-checker 'python-mypy (cons t 'python-flake8))) (eval . (add-hook 'before-save-hook 'fmt-current-buffer nil t)) (eval . (setq-local fmt-executable "black" - fmt-args '("-")))))) + fmt-args '("-"))))) + (meson-mode + . ((fmt-executable . "meson") + (fmt-args . ("format" "-")) + (eval . (add-hook 'before-save-hook 'fmt-current-buffer nil t))))) diff --git a/blog/meson.build b/blog/meson.build new file mode 100644 index 0000000..fa74600 --- /dev/null +++ b/blog/meson.build @@ -0,0 +1,14 @@ +posts = files('access-control.org', 'gentoo-on-gcloud.org', 'index.org') + +foreach post : posts + html = fs.replace_suffix(post, '.html') + + custom_target( + output: fs.name(html), + input: post, + command: build_command, + install: true, + install_dir: '/var/www' / site / 'blog', + capture: true, + ) +endforeach diff --git a/makefile b/makefile deleted file mode 100644 index a3a1eff..0000000 --- a/makefile +++ /dev/null @@ -1,30 +0,0 @@ -SITE ?= jturnerusa.dev - -PREFIX ?= / -DESTDIR ?= /var/www - -EMACS ?= emacs -ARGS = -batch -e "org-html-export-to-html" - -all: index.html blog/index.html blog/gentoo-on-gcloud.html blog/access-control.html - -index.html: index.org - $(EMACS) $< $(ARGS) - -blog/index.html: blog/index.org - $(EMACS) $< $(ARGS) - -blog/gentoo-on-gcloud.html: blog/gentoo-on-gcloud.org - $(EMACS) $< $(ARGS) - -blog/access-control.html: blog/access-control.org - $(EMACS) $< $(ARGS) - -install: all - install --mode 644 -D robots.txt --target-directory $(PREFIX)/$(DESTDIR)/$(SITE)/ - install --mode 644 -D sitemap.txt --target-directory $(PREFIX)/$(DESTDIR)/$(SITE)/ - install --mode 644 -D *.html --target-directory $(PREFIX)/$(DESTDIR)/$(SITE)/ - install --mode 644 -D blog/*.html --target-directory $(PREFIX)/$(DESTDIR)/$(SITE)/blog/ - -clean: - rm *.html blog/*.html diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..5b99de7 --- /dev/null +++ b/meson.build @@ -0,0 +1,30 @@ +project('website') + +fs = import('fs') + +emacs = find_program('emacs') + +site = 'jturnerusa.dev' + +build_command = [ + emacs, + '@INPUT@', + '-batch', + '-eval', + '(org-export-to-file \'html "/dev/stdout")', +] + +posts = files('index.org') + +foreach post : posts + custom_target( + output: fs.replace_suffix(post, '.html'), + input: post, + command: build_command, + install: true, + install_dir: '/var/www' / site, + capture: true, + ) +endforeach + +subdir('blog') -- cgit v1.2.3