diff options
author | EuAndreh <eu@euandre.org> | 2025-05-28 19:20:26 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-05-28 19:41:11 -0300 |
commit | 24fafda1fe9e962c8e508220c7023dabd5407e4a (patch) | |
tree | 28028a3f5b5715cdd5f8705cd823b60d9e65fc58 | |
parent | meta.capim: Add with :dependencies key (diff) | |
download | fiinha-24fafda1fe9e962c8e508220c7023dabd5407e4a.tar.gz fiinha-24fafda1fe9e962c8e508220c7023dabd5407e4a.tar.xz |
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | Makefile | 75 | ||||
-rw-r--r-- | deps.mk | 25 | ||||
-rw-r--r-- | doc/fiinha.en.0.adoc | 5 | ||||
-rwxr-xr-x | mkdeps.sh | 32 | ||||
-rw-r--r-- | po/doc/de.po | 22 | ||||
-rw-r--r-- | po/doc/doc.pot | 22 | ||||
-rw-r--r-- | po/doc/eo.po | 22 | ||||
-rw-r--r-- | po/doc/es.po | 22 | ||||
-rw-r--r-- | po/doc/fr.po | 22 | ||||
-rw-r--r-- | po/doc/note.txt | 5 | ||||
-rw-r--r-- | po/doc/po4a.cfg | 5 | ||||
-rw-r--r-- | po/doc/pt.po | 22 | ||||
-rw-r--r-- | po/fiinha/de.po | 5 | ||||
-rw-r--r-- | po/fiinha/eo.po | 5 | ||||
-rw-r--r-- | po/fiinha/es.po | 5 | ||||
-rw-r--r-- | po/fiinha/fiinha.pot | 5 | ||||
-rw-r--r-- | po/fiinha/fr.po | 5 | ||||
-rw-r--r-- | po/fiinha/po4a.cfg | 3 | ||||
-rw-r--r-- | po/fiinha/pt.po | 5 |
20 files changed, 285 insertions, 32 deletions
@@ -1,4 +1,7 @@ -/src/version.go +/doc/* +!/doc/*.en.*.adoc +/po/*/*.mo +/src/meta.go /*.bin /*.db* /src/*.a @@ -3,7 +3,6 @@ DATE = 1970-01-01 VERSION = 0.1.0 NAME = fiinha NAME_UC = $(NAME) -LANGUAGES = en ## Installation prefix. Defaults to "/usr". PREFIX = /usr BINDIR = $(PREFIX)/bin @@ -20,45 +19,58 @@ DESTDIR = LDLIBS = --static -lsqlite3 -lm GOCFLAGS = -I $(GOLIBDIR) GOLDFLAGS = -L $(GOLIBDIR) +N = `nproc` .SUFFIXES: -.SUFFIXES: .go .a .bin .bin-check +.SUFFIXES: .go .a .bin .bin-check .adoc .po .mo .go.a: go tool compile -I $(@D) $(GOCFLAGS) -o $@ -p $(*F) \ `find $< $$(if [ $(*F) != main ]; then \ - echo src/$(NAME).go src/version.go; fi) | uniq` + echo src/$(NAME).go src/meta.go; fi) | uniq` .a.bin: go tool link -L $(@D) $(GOLDFLAGS) -o $@ --extldflags '$(LDLIBS)' $< +.adoc: + asciidoctor -b manpage -o $@ $< + +.po.mo: + msgfmt -cfv -o $@ $< + all: include deps.mk -libs.a = $(libs.go:.go=.a) -mains.a = $(mains.go:.go=.a) -mains.bin = $(mains.go:.go=.bin) -functional-tests/lib.a = $(functional-tests/lib.go:.go=.a) -fuzz-targets/lib.a = $(fuzz-targets/lib.go:.go=.a) -benchmarks/lib.a = $(benchmarks/lib.go:.go=.a) +libs.a = $(libs.go:.go=.a) +mains.a = $(mains.go:.go=.a) +mains.bin = $(mains.go:.go=.bin) +functional/lib.a = $(functional/lib.go:.go=.a) +fuzz/lib.a = $(fuzz/lib.go:.go=.a) +benchmarks/lib.a = $(benchmarks/lib.go:.go=.a) +manpages.N.adoc = $(manpages.en.N.adoc) $(manpages.XX.N.adoc) +manpages.N = $(manpages.N.adoc:.adoc=) +sources.mo = $(sources.po:.po=.mo) sources = \ src/$(NAME).go \ - src/version.go \ + src/meta.go \ src/main.go \ derived-assets = \ - src/version.go \ + src/meta.go \ $(libs.a) \ $(mains.a) \ $(mains.bin) \ $(NAME).bin \ + $(manpages.XX.N.adoc) \ + $(manpages.N) \ + $(sources.mo) \ side-assets = \ $(NAME).db* \ @@ -74,19 +86,24 @@ all: $(derived-assets) $(libs.a): Makefile deps.mk -$(libs.a): src/$(NAME).go src/version.go +$(libs.a): src/$(NAME).go src/meta.go -$(fuzz-targets/lib.a): +$(fuzz/lib.a): go tool compile $(GOCFLAGS) -o $@ -p $(NAME) -d=libfuzzer \ - $*.go src/$(NAME).go src/version.go + $*.go src/$(NAME).go src/meta.go -src/version.go: Makefile - echo 'package $(NAME); const Version = "$(VERSION)"' > $@ +src/meta.go: Makefile + echo 'package $(NAME)' > $@ + echo 'const Version = "$(VERSION)"' >> $@ + echo 'const Name = "$(NAME)"' >> $@ + echo 'const LOCALEDIR = "$(LOCALEDIR)"' >> $@ $(NAME).bin: src/main.bin ln -fs src/main.bin $@ +$(manpages.XX.N.adoc): po/doc/po4a.cfg + po4a --no-update --translate-only $@ po/doc/po4a.cfg .PRECIOUS: tests/queries.sql @@ -95,7 +112,7 @@ tests/queries.sql: tests/main.bin ALWAYS tests.bin-check = \ tests/main.bin-check \ - $(functional-tests/main.go:.go=.bin-check) \ + $(functional/main.go:.go=.bin-check) \ $(tests.bin-check): $(EXEC)$*.bin @@ -125,12 +142,12 @@ check: check-unit check-integration FUZZSEC=1 -fuzz-targets/main.bin-check = $(fuzz-targets/main.go:.go=.bin-check) -$(fuzz-targets/main.bin-check): - $(EXEC)$*.bin --test.fuzztime=$(FUZZSEC)s \ +fuzz/main.bin-check = $(fuzz/main.go:.go=.bin-check) +$(fuzz/main.bin-check): + $(EXEC)$*.bin --test.fuzztime=$(FUZZSEC)s --test.parallel=$N \ --test.fuzz='.*' --test.fuzzcachedir=tests/fuzz/corpus -fuzz: $(fuzz-targets/main.bin-check) +fuzz: $(fuzz/main.bin-check) @@ -144,6 +161,17 @@ bench: $(benchmarks/main.bin-check) +i18n-doc: + po4a po/doc/po4a.cfg + +i18n-code: + gotext src/$(NAME).go > po/$(NAME)/$(NAME).pot + po4a po/$(NAME)/po4a.cfg + +i18n: i18n-doc i18n-code + + + ## Remove *all* derived artifacts produced during the build. ## A dedicated test asserts that this is always true. clean: @@ -161,6 +189,8 @@ install: all cp $(NAME).bin '$(DESTDIR)$(BINDIR)'/$(NAME) cp src/$(NAME).a '$(DESTDIR)$(GOLIBDIR)' cp $(sources) '$(DESTDIR)$(SRCDIR)' + instool '$(DESTDIR)$(MANDIR)' install man $(manpages.N) + instool '$(DESTDIR)$(LOCALEDIR)' install mo $(sources.mo) ## Uninstalls from $(DESTDIR)$(PREFIX). This is a perfect mirror ## of the "install" target, and removes *all* that was installed. @@ -171,6 +201,9 @@ uninstall: '$(DESTDIR)$(GOLIBDIR)'/$(NAME).a \ '$(DESTDIR)$(SRCDIR)' \ + instool '$(DESTDIR)$(MANDIR)' uninstall man $(manpages.N) + instool '$(DESTDIR)$(LOCALEDIR)' uninstall mo $(sources.mo) + ALWAYS: @@ -58,7 +58,24 @@ mains.go = \ tests/fuzz/total-order-check/main.go \ tests/main.go \ -functional-tests/lib.go = \ +manpages.en.N.adoc = \ + doc/fiinha.en.0.adoc \ + +manpages.XX.N.adoc = \ + doc/fiinha.de.0.adoc \ + doc/fiinha.eo.0.adoc \ + doc/fiinha.es.0.adoc \ + doc/fiinha.fr.0.adoc \ + doc/fiinha.pt.0.adoc \ + +sources.po = \ + po/fiinha/de.po \ + po/fiinha/eo.po \ + po/fiinha/es.po \ + po/fiinha/fr.po \ + po/fiinha/pt.po \ + +functional/lib.go = \ tests/functional/consume-one-produce-many/fiinha.go \ tests/functional/consumer-with-deadletter/fiinha.go \ tests/functional/custom-prefix/fiinha.go \ @@ -69,7 +86,7 @@ functional-tests/lib.go = \ tests/functional/wait-after-publish/fiinha.go \ tests/functional/waiter/fiinha.go \ -functional-tests/main.go = \ +functional/main.go = \ tests/functional/consume-one-produce-many/main.go \ tests/functional/consumer-with-deadletter/main.go \ tests/functional/custom-prefix/main.go \ @@ -80,7 +97,7 @@ functional-tests/main.go = \ tests/functional/wait-after-publish/main.go \ tests/functional/waiter/main.go \ -fuzz-targets/lib.go = \ +fuzz/lib.go = \ tests/fuzz/api-check/fiinha.go \ tests/fuzz/cli-check/fiinha.go \ tests/fuzz/equal-produced-consumed-order-check/fiinha.go \ @@ -88,7 +105,7 @@ fuzz-targets/lib.go = \ tests/fuzz/queries-check/fiinha.go \ tests/fuzz/total-order-check/fiinha.go \ -fuzz-targets/main.go = \ +fuzz/main.go = \ tests/fuzz/api-check/main.go \ tests/fuzz/cli-check/main.go \ tests/fuzz/equal-produced-consumed-order-check/main.go \ diff --git a/doc/fiinha.en.0.adoc b/doc/fiinha.en.0.adoc new file mode 100644 index 0000000..2c4d896 --- /dev/null +++ b/doc/fiinha.en.0.adoc @@ -0,0 +1,5 @@ += fiinha(0) + +== NAME + +fiinha - . @@ -5,21 +5,41 @@ export LANG=POSIX.UTF-8 libs() { - find src tests -name '*.go' | grep -v '/main\.go$' | - grep -v '/version\.go$' + find src tests -name '*.go' | + grep -Ev '/(main|meta)\.go$' | + grep -Ev '/_cgo_(import|gotypes)\.go$' | + grep -Ev '\.cgo1\.go$' } mains() { find src tests -name '*.go' | grep '/main\.go$' } +docs() { + find doc/*.en.*.adoc +} + +xdocs() { + for l in `find po/doc/*.po | xargs -I% basename % .po`; do + docs | sed 's|/\(.*\)\.en\.\(.*\)$|/\1.'"$l"'.\2|' + done +} + +pos() { + find po/ -name '*.po' | grep -Ev '^po/(doc|tests)/' +} + + libs | varlist 'libs.go' mains | varlist 'mains.go' +docs | varlist 'manpages.en.N.adoc' +xdocs | varlist 'manpages.XX.N.adoc' +pos | varlist 'sources.po' -find tests/functional/*/*.go -not -name main.go | varlist 'functional-tests/lib.go' -find tests/functional/*/main.go | varlist 'functional-tests/main.go' -find tests/fuzz/*/*.go -not -name main.go | varlist 'fuzz-targets/lib.go' -find tests/fuzz/*/main.go | varlist 'fuzz-targets/main.go' +find tests/functional/*/*.go -not -name main.go | varlist 'functional/lib.go' +find tests/functional/*/main.go | varlist 'functional/main.go' +find tests/fuzz/*/*.go -not -name main.go | varlist 'fuzz/lib.go' +find tests/fuzz/*/main.go | varlist 'fuzz/main.go' find tests/benchmarks/*/*.go -not -name main.go | varlist 'benchmarks/lib.go' find tests/benchmarks/*/main.go | varlist 'benchmarks/main.go' diff --git a/po/doc/de.po b/po/doc/de.po new file mode 100644 index 0000000..fd6472f --- /dev/null +++ b/po/doc/de.po @@ -0,0 +1,22 @@ +msgid "" +msgstr "" +"Language: de\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. type: Title = +#: doc/fiinha.en.0.adoc:1 +#, no-wrap +msgid "fiinha(0)" +msgstr "" + +#. type: Title == +#: doc/fiinha.en.0.adoc:3 +#, no-wrap +msgid "NAME" +msgstr "" + +#. type: Plain text +#: doc/fiinha.en.0.adoc:5 +msgid "fiinha - ." +msgstr "" diff --git a/po/doc/doc.pot b/po/doc/doc.pot new file mode 100644 index 0000000..5bc8d37 --- /dev/null +++ b/po/doc/doc.pot @@ -0,0 +1,22 @@ +#, fuzzy +msgid "" +msgstr "" +"Language: \n" +"Content-Type: text/plain; charset=UTF-8\n" + +#. type: Title = +#: doc/fiinha.en.0.adoc:1 +#, no-wrap +msgid "fiinha(0)" +msgstr "" + +#. type: Title == +#: doc/fiinha.en.0.adoc:3 +#, no-wrap +msgid "NAME" +msgstr "" + +#. type: Plain text +#: doc/fiinha.en.0.adoc:5 +msgid "fiinha - ." +msgstr "" diff --git a/po/doc/eo.po b/po/doc/eo.po new file mode 100644 index 0000000..e9e1f2f --- /dev/null +++ b/po/doc/eo.po @@ -0,0 +1,22 @@ +msgid "" +msgstr "" +"Language: eo\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. type: Title = +#: doc/fiinha.en.0.adoc:1 +#, no-wrap +msgid "fiinha(0)" +msgstr "" + +#. type: Title == +#: doc/fiinha.en.0.adoc:3 +#, no-wrap +msgid "NAME" +msgstr "" + +#. type: Plain text +#: doc/fiinha.en.0.adoc:5 +msgid "fiinha - ." +msgstr "" diff --git a/po/doc/es.po b/po/doc/es.po new file mode 100644 index 0000000..cf72172 --- /dev/null +++ b/po/doc/es.po @@ -0,0 +1,22 @@ +msgid "" +msgstr "" +"Language: es\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. type: Title = +#: doc/fiinha.en.0.adoc:1 +#, no-wrap +msgid "fiinha(0)" +msgstr "" + +#. type: Title == +#: doc/fiinha.en.0.adoc:3 +#, no-wrap +msgid "NAME" +msgstr "" + +#. type: Plain text +#: doc/fiinha.en.0.adoc:5 +msgid "fiinha - ." +msgstr "" diff --git a/po/doc/fr.po b/po/doc/fr.po new file mode 100644 index 0000000..0a2ca5a --- /dev/null +++ b/po/doc/fr.po @@ -0,0 +1,22 @@ +msgid "" +msgstr "" +"Language: fr\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. type: Title = +#: doc/fiinha.en.0.adoc:1 +#, no-wrap +msgid "fiinha(0)" +msgstr "" + +#. type: Title == +#: doc/fiinha.en.0.adoc:3 +#, no-wrap +msgid "NAME" +msgstr "" + +#. type: Plain text +#: doc/fiinha.en.0.adoc:5 +msgid "fiinha - ." +msgstr "" diff --git a/po/doc/note.txt b/po/doc/note.txt new file mode 100644 index 0000000..45279a4 --- /dev/null +++ b/po/doc/note.txt @@ -0,0 +1,5 @@ +PO4A-HEADER: mode=eof + + + +// Generated from po4a(1). diff --git a/po/doc/po4a.cfg b/po/doc/po4a.cfg new file mode 100644 index 0000000..aaf1cb1 --- /dev/null +++ b/po/doc/po4a.cfg @@ -0,0 +1,5 @@ +[options] --keep 0 --master-charset UTF-8 --localized-charset UTF-8 --addendum-charset UTF-8 + +[po_directory] po/doc + +[type: asciidoc] doc/fiinha.en.0.adoc $lang:doc/fiinha.$lang.0.adoc diff --git a/po/doc/pt.po b/po/doc/pt.po new file mode 100644 index 0000000..65a0b0e --- /dev/null +++ b/po/doc/pt.po @@ -0,0 +1,22 @@ +msgid "" +msgstr "" +"Language: pt\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. type: Title = +#: doc/fiinha.en.0.adoc:1 +#, no-wrap +msgid "fiinha(0)" +msgstr "" + +#. type: Title == +#: doc/fiinha.en.0.adoc:3 +#, no-wrap +msgid "NAME" +msgstr "" + +#. type: Plain text +#: doc/fiinha.en.0.adoc:5 +msgid "fiinha - ." +msgstr "" diff --git a/po/fiinha/de.po b/po/fiinha/de.po new file mode 100644 index 0000000..947f71d --- /dev/null +++ b/po/fiinha/de.po @@ -0,0 +1,5 @@ +msgid "" +msgstr "" +"Language: de\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" diff --git a/po/fiinha/eo.po b/po/fiinha/eo.po new file mode 100644 index 0000000..444f1ed --- /dev/null +++ b/po/fiinha/eo.po @@ -0,0 +1,5 @@ +msgid "" +msgstr "" +"Language: eo\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" diff --git a/po/fiinha/es.po b/po/fiinha/es.po new file mode 100644 index 0000000..9288fad --- /dev/null +++ b/po/fiinha/es.po @@ -0,0 +1,5 @@ +msgid "" +msgstr "" +"Language: es\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" diff --git a/po/fiinha/fiinha.pot b/po/fiinha/fiinha.pot new file mode 100644 index 0000000..c9591aa --- /dev/null +++ b/po/fiinha/fiinha.pot @@ -0,0 +1,5 @@ +msgid "" +msgstr "" +"Language: \n" +"Content-Type: text/plain; charset=UTF-8\n" + diff --git a/po/fiinha/fr.po b/po/fiinha/fr.po new file mode 100644 index 0000000..6a18324 --- /dev/null +++ b/po/fiinha/fr.po @@ -0,0 +1,5 @@ +msgid "" +msgstr "" +"Language: fr\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" diff --git a/po/fiinha/po4a.cfg b/po/fiinha/po4a.cfg new file mode 100644 index 0000000..a9de01a --- /dev/null +++ b/po/fiinha/po4a.cfg @@ -0,0 +1,3 @@ +[options] --keep 0 --master-charset UTF-8 --localized-charset UTF-8 --addendum-charset UTF-8 + +[po_directory] po/fiinha diff --git a/po/fiinha/pt.po b/po/fiinha/pt.po new file mode 100644 index 0000000..22c6066 --- /dev/null +++ b/po/fiinha/pt.po @@ -0,0 +1,5 @@ +msgid "" +msgstr "" +"Language: pt\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" |