Use new gnome-extensions command and implement translations
This commit is contained in:
@@ -1,24 +1,41 @@
|
|||||||
UUID = nightthemeswitcher@romainvigier.fr
|
# Night Theme Switcher Gnome Shell extension
|
||||||
GSEXT_DIR_LOCAL = $(HOME)/.local/share/gnome-shell/extensions
|
#
|
||||||
|
# Copyright (C) 2019 Romain Vigier
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation, either version 3 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program. If not, see <http s ://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
VERSION = $(shell grep '"version"' ./src/metadata.json | sed 's/.*\s\([0-9.]*\),/\1/')
|
COPYRIGHT_YEAR = 2019
|
||||||
|
AUTHOR_NAME = Romain Vigier
|
||||||
|
AUTHOR_EMAIL =
|
||||||
|
|
||||||
|
NAME = $(shell grep '"name"' ./src/metadata.json | sed 's/\s"name":\s"\(.\+\)",\?/\1/')
|
||||||
|
UUID = $(shell grep '"uuid"' ./src/metadata.json | sed 's/\s"uuid":\s"\(.\+\)",\?/\1/')
|
||||||
|
VERSION = $(shell grep '"version"' ./src/metadata.json | sed 's/\s"version":\s\([0-9]\+\),\?/\1/')
|
||||||
|
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: clean
|
build: clean
|
||||||
mkdir -p ./build/$(UUID)
|
mkdir -p ./build
|
||||||
cp -r ./src/* ./build/$(UUID)
|
gnome-extensions pack \
|
||||||
cp ./LICENSE ./build/$(UUID)
|
--extra-source=../LICENSE \
|
||||||
|
--podir=./po/ \
|
||||||
|
--gettext-domain=$(UUID) \
|
||||||
|
--out-dir=./build \
|
||||||
|
./src
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: uninstall build
|
install: uninstall build
|
||||||
mkdir -p $(GSEXT_DIR_LOCAL)
|
gnome-extensions install ./build/$(UUID).shell-extension.zip
|
||||||
cp -r ./build/* $(GSEXT_DIR_LOCAL)
|
|
||||||
|
|
||||||
.PHONY: zip
|
|
||||||
zip: build
|
|
||||||
cd ./build/$(UUID) && zip -r ../$(UUID).$(VERSION).zip .
|
|
||||||
rm -r ./build/$(UUID)
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@@ -26,4 +43,20 @@ clean:
|
|||||||
|
|
||||||
.PHONY: uninstall
|
.PHONY: uninstall
|
||||||
uninstall:
|
uninstall:
|
||||||
-rm -rf $(GSEXT_DIR_LOCAL)/$(UUID)
|
-gnome-extensions uninstall $(UUID)
|
||||||
|
|
||||||
|
.PHONY: pot
|
||||||
|
pot:
|
||||||
|
mkdir -p ./src/po
|
||||||
|
xgettext \
|
||||||
|
--from-code=UTF-8 \
|
||||||
|
--keyword=_ \
|
||||||
|
--package-name="$(NAME)" \
|
||||||
|
--package-version="$(VERSION)" \
|
||||||
|
--output=./src/po/$(UUID).pot \
|
||||||
|
./src/*.js
|
||||||
|
sed -i '1,4s/SOME DESCRIPTIVE TITLE./$(NAME)/g' ./src/po/$(UUID).pot
|
||||||
|
sed -i '1,4s/YEAR/$(COPYRIGHT_YEAR)/' ./src/po/$(UUID).pot
|
||||||
|
sed -i "1,4s/THE PACKAGE'S COPYRIGHT HOLDER/$(AUTHOR_NAME)/" ./src/po/$(UUID).pot
|
||||||
|
sed -i "1,4s/FIRST AUTHOR/$(AUTHOR_NAME)/" ./src/po/$(UUID).pot
|
||||||
|
sed -i "1,4s/EMAIL@ADDRESS/$(AUTHOR_EMAIL)/" ./src/po/$(UUID).pot
|
||||||
|
|||||||
Reference in New Issue
Block a user