forked from ikks/libreoffice-stable-diffusion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (47 loc) · 1.7 KB
/
Makefile
File metadata and controls
64 lines (47 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# To begin with translation process
# xgettext -o src/po/messages.pot --add-comments=TRANSLATORS: --keyword=_ --flag=_:1:pass-python-format --directory=. src/$(SCRIPTNAME).py
# To create a new language
# THELANG=da msginit --input=po/messages.pot --locale=$THELANG.UTF-8 --output=src/po/$THELANG.po
# When there are new strings to be translated run
# make src/po/messages.pot
# Review the file to delete multiple entries of the same string pointing
# to different places in the file.
# Then run
# make langs
#
# When testing a flatpak use: flatpak run org.libreoffice.LibreOffice
PREFIX ?= /usr/bin
EXEC=loshd.oxt
UNOPKG ?= $(PREFIX)/unopkg
LOBIN ?= $(PREFIX)/libreoffice
CURRENT_LANG=es
SCRIPTNAME=StableHordeForLibreOffice
GETTEXTDOMAIN=stablehordeforlibreoffice
PO_FILES := $(wildcard src/po/*.po)
MO_FILES := $(subst .po,/LC_MESSAGES/$(GETTEXTDOMAIN).mo, $(subst src/po,oxt/locale,$(PO_FILES)))
all: $(EXEC)
oxt/locale/%/LC_MESSAGES/$(GETTEXTDOMAIN).mo: src/po/%.po
mkdir -p $(dir $@)
msgfmt --output-file=$@ $<
src/po/$(CURRENT_LANG).po: src/po/messages.pot
msgmerge --update $@ $<
src/po/messages.pot: src/$(SCRIPTNAME).py
xgettext -j -o $@ --add-comments=TRANSLATORS: --keyword=_ --flag=_:1:pass-python-format --directory=. $<
$(EXEC): src/$(SCRIPTNAME).py oxt/description.xml oxt/build
cd modules/urllib3 && uv build -q && unzip -q -o dist/*whl -d ../../oxt/python_path/
oxt/build
langs: src/po/messages.pot $(MO_FILES)
postats src/po/*.po
clean:
rm -rf oxt/locale loshd.oxt src/po/*~ src/po/*bak
install:
$(UNOPKG) add -s -f loshd.oxt
publish:
sh scripts/publish
run:
make
make install
$(LOBIN) --impress
.PHONY: clean install langs publish run