diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e50baf1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# ignore local developer settings +/.vscode/ + +# ignore temporary build artifacts +_build +*~ + +# ignore built binaries +/schemas/gschemas.compiled +*.mo +*.zip diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fa50aee --- /dev/null +++ b/Makefile @@ -0,0 +1,104 @@ +# Makefile of the Arch Linux Updates Indicator GNOME Shell Extension +# (adapted from https://gitlab.com/skrewball/openweather/) + +PKG_NAME = arch-update +UUID = arch-update@RaphaelRochet +BASE_MODULES = metadata.json LICENCE.txt prefs.xml +SRC_MODULES = extension.js prefs.js stylesheet.css +EXTRA_DIRECTORIES = icons +TOLOCALIZE = extension.js prefs.js +MSGSRC = $(wildcard locale/*/arch-update.po) + +# Packagers: Use DESTDIR for system wide installation +ifeq ($(strip $(DESTDIR)),) + INSTALLTYPE = local + INSTALLBASE = $(HOME)/.local/share/gnome-shell/extensions +else + INSTALLTYPE = system + SHARE_PREFIX = $(DESTDIR)/usr/share + INSTALLBASE = $(SHARE_PREFIX)/gnome-shell/extensions +endif +# Set a git version for self builds from the latest git tag with the revision +# (a monotonically increasing number that uniquely identifies the source tree) +# and the current short commit SHA1. (Note: not set if VERSION passed) +GIT_VER = $(shell git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g') +# The command line passed variable VERSION is used to set the version integer +# in the metadata and in the generated zip file. If no VERSION is passed, we +# won't touch the metadata version and instead use that for the zip file. +ifdef VERSION + ZIPVER = -v$(VERSION) +else + ZIPVER = -v$(shell cat metadata.json | sed '/"version"/!d' | sed s/\"version\"://g | sed s/\ //g) +endif + +.PHONY: all clean extension potfile mergepo install install-local zip-file + +all: extension + +clean: + rm -f ./schemas/gschemas.compiled + rm -f ./locale/*/arch-update.po~ + rm -f ./locale/*/LC_MESSAGES/arch-update.mo + +extension: ./schemas/gschemas.compiled $(MSGSRC:arch-update.po=LC_MESSAGES/arch-update.mo) + +./schemas/gschemas.compiled: ./schemas/org.gnome.shell.extensions.arch-update.gschema.xml + glib-compile-schemas ./schemas/ + +# TODO: disabled, since xgettext is not able to include prefs.xml to the pot file +# We have to update the arch-update.pot manually. +#potfile: ./locale/arch-update.pot + +mergepo: potfile + for l in $(MSGSRC); do \ + msgmerge -U $$l ./locale/arch-update.pot; \ + done; + +./locale/arch-update.pot: $(TOLOCALIZE) + mkdir -p locale + xgettext -k_ -kN_ --from-code utf-8 -o locale/arch-update.pot --package-name $(PKG_NAME) $(TOLOCALIZE) + +./locale/%/LC_MESSAGES/arch-update.mo: ./locale/%/arch-update.po + msgfmt -c $< -o $@ + +install: install-local + +install-local: _build + rm -rf $(INSTALLBASE)/$(UUID) + mkdir -p $(INSTALLBASE)/$(UUID) + cp -r ./_build/* $(INSTALLBASE)/$(UUID)/ +ifeq ($(INSTALLTYPE),system) + # system-wide settings and locale files + rm -r $(addprefix $(INSTALLBASE)/$(UUID)/, schemas locale COPYING) + mkdir -p $(SHARE_PREFIX)/glib-2.0/schemas \ + $(SHARE_PREFIX)/locale \ + $(SHARE_PREFIX)/licenses/$(PKG_NAME) + cp -r ./schemas/*gschema.xml $(SHARE_PREFIX)/glib-2.0/schemas + cp -r ./_build/locale/* $(SHARE_PREFIX)/locale + cp -r ./_build/COPYING $(SHARE_PREFIX)/licenses/$(PKG_NAME) +endif + -rm -fR _build + echo done + +zip-file: _build + cd _build ; \ + zip -qr "$(PKG_NAME)$(ZIPVER).zip" . + mv _build/$(PKG_NAME)$(ZIPVER).zip ./ + -rm -fR _build + +_build: all + -rm -fR ./_build + mkdir -p _build + cp $(BASE_MODULES) $(SRC_MODULES) _build + cp -r $(EXTRA_DIRECTORIES) _build + mkdir -p _build/schemas + cp schemas/*.xml _build/schemas + cp schemas/gschemas.compiled _build/schemas + for l in $(MSGSRC:arch-update.po=LC_MESSAGES/arch-update.mo) ; do \ + cp -au --parents $$l _build; \ + done; +ifdef VERSION + sed -i 's/"version": .*/"version": $(VERSION)/' _build/metadata.json; +else ifneq ($(strip $(GIT_VER)),) + sed -i '/"version": .*/i\ \ "git-version": "$(GIT_VER)",' _build/metadata.json; +endif \ No newline at end of file diff --git a/locale/ar/LC_MESSAGES/arch-update.mo b/locale/ar/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 3c3fb38..0000000 Binary files a/locale/ar/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/ca/LC_MESSAGES/arch-update.mo b/locale/ca/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 613acc3..0000000 Binary files a/locale/ca/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/cs_CZ/LC_MESSAGES/arch-update.mo b/locale/cs_CZ/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 9371ede..0000000 Binary files a/locale/cs_CZ/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/de_DE/LC_MESSAGES/arch-update.mo b/locale/de_DE/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 56678ac..0000000 Binary files a/locale/de_DE/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/eo/LC_MESSAGES/arch-update.mo b/locale/eo/LC_MESSAGES/arch-update.mo deleted file mode 100644 index dd4f276..0000000 Binary files a/locale/eo/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/es/LC_MESSAGES/arch-update.mo b/locale/es/LC_MESSAGES/arch-update.mo deleted file mode 100755 index dbb28d2..0000000 Binary files a/locale/es/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/et/LC_MESSAGES/arch-update.mo b/locale/et/LC_MESSAGES/arch-update.mo deleted file mode 100644 index f490a0d..0000000 Binary files a/locale/et/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/fa_IR/LC_MESSAGES/arch-update.mo b/locale/fa_IR/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 9c85679..0000000 Binary files a/locale/fa_IR/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/fi_FI/LC_MESSAGES/arch-update.mo b/locale/fi_FI/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 6782a18..0000000 Binary files a/locale/fi_FI/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/fr/LC_MESSAGES/arch-update.mo b/locale/fr/LC_MESSAGES/arch-update.mo deleted file mode 100644 index c2dc461..0000000 Binary files a/locale/fr/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/he_IL/LC_MESSAGES/arch-update.mo b/locale/he_IL/LC_MESSAGES/arch-update.mo deleted file mode 100644 index d9c9150..0000000 Binary files a/locale/he_IL/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/hu_HU/LC_MESSAGES/arch-update.mo b/locale/hu_HU/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 444159c..0000000 Binary files a/locale/hu_HU/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/it_IT/LC_MESSAGES/arch-update.mo b/locale/it_IT/LC_MESSAGES/arch-update.mo deleted file mode 100644 index fe6434a..0000000 Binary files a/locale/it_IT/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/ko/LC_MESSAGES/arch-update.mo b/locale/ko/LC_MESSAGES/arch-update.mo deleted file mode 100644 index e7754be..0000000 Binary files a/locale/ko/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/nb_NO/LC_MESSAGES/arch-update.mo b/locale/nb_NO/LC_MESSAGES/arch-update.mo deleted file mode 100644 index f4ed344..0000000 Binary files a/locale/nb_NO/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/nl/LC_MESSAGES/arch-update.mo b/locale/nl/LC_MESSAGES/arch-update.mo deleted file mode 100644 index eed7ccf..0000000 Binary files a/locale/nl/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/oc/LC_MESSAGES/arch-update.mo b/locale/oc/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 406b46f..0000000 Binary files a/locale/oc/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/pl/LC_MESSAGES/arch-update.mo b/locale/pl/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 0a5e626..0000000 Binary files a/locale/pl/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/pt_BR/LC_MESSAGES/arch-update.mo b/locale/pt_BR/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 97ad12d..0000000 Binary files a/locale/pt_BR/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/ro/LC_MESSAGES/arch-update.mo b/locale/ro/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 45cf6ec..0000000 Binary files a/locale/ro/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/ru_RU/LC_MESSAGES/arch-update.mo b/locale/ru_RU/LC_MESSAGES/arch-update.mo deleted file mode 100644 index ed944b7..0000000 Binary files a/locale/ru_RU/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/sk/LC_MESSAGES/arch-update.mo b/locale/sk/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 9c2728b..0000000 Binary files a/locale/sk/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/sr/LC_MESSAGES/arch-update.mo b/locale/sr/LC_MESSAGES/arch-update.mo deleted file mode 100644 index a8f513b..0000000 Binary files a/locale/sr/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/sr@latin/LC_MESSAGES/arch-update.mo b/locale/sr@latin/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 7a3b032..0000000 Binary files a/locale/sr@latin/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/sv/LC_MESSAGES/arch-update.mo b/locale/sv/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 30ce671..0000000 Binary files a/locale/sv/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/tr_TR/LC_MESSAGES/arch-update.mo b/locale/tr_TR/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 22cfd98..0000000 Binary files a/locale/tr_TR/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/uk_UA/LC_MESSAGES/arch-update.mo b/locale/uk_UA/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 6d8a623..0000000 Binary files a/locale/uk_UA/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/locale/zh_CN/LC_MESSAGES/arch-update.mo b/locale/zh_CN/LC_MESSAGES/arch-update.mo deleted file mode 100644 index 47876c1..0000000 Binary files a/locale/zh_CN/LC_MESSAGES/arch-update.mo and /dev/null differ diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled deleted file mode 100644 index 0862108..0000000 Binary files a/schemas/gschemas.compiled and /dev/null differ