Makefile: support system-wide installation.

System-wide installation should install locale/ and gsettings schema in
system directory. This enables override supports, locale stripping and
not shipping pre-compiled schema file.

Cherry-picked-from: micheleg/dash-to-dock@4dd565dad9
This commit is contained in:
Dominik 'Rathann' Mierzejewski
2023-03-16 11:57:13 +01:00
parent 31f02636a4
commit e42a89a588

View File

@@ -8,9 +8,12 @@ IMAGES = ./* ../media/design/svg/dash-to-panel-logo-light.svg
TOLOCALIZE = src/extension.js src/prefs.js src/appIcons.js src/taskbar.js TOLOCALIZE = src/extension.js src/prefs.js src/appIcons.js src/taskbar.js
MSGSRC = $(wildcard po/*.po) MSGSRC = $(wildcard po/*.po)
ifeq ($(strip $(DESTDIR)),) ifeq ($(strip $(DESTDIR)),)
INSTALLTYPE = local
INSTALLBASE = $(HOME)/.local/share/gnome-shell/extensions INSTALLBASE = $(HOME)/.local/share/gnome-shell/extensions
else else
INSTALLTYPE = system
INSTALLBASE = $(DESTDIR)/usr/share/gnome-shell/extensions INSTALLBASE = $(DESTDIR)/usr/share/gnome-shell/extensions
SHARE_PREFIX = $(DESTDIR)/usr/share
endif endif
INSTALLNAME = dash-to-panel@jderose9.github.com INSTALLNAME = dash-to-panel@jderose9.github.com
@@ -69,6 +72,12 @@ install-local: _build
rm -rf $(INSTALLBASE)/$(INSTALLNAME) rm -rf $(INSTALLBASE)/$(INSTALLNAME)
mkdir -p $(INSTALLBASE)/$(INSTALLNAME) mkdir -p $(INSTALLBASE)/$(INSTALLNAME)
cp -r ./_build/* $(INSTALLBASE)/$(INSTALLNAME)/ cp -r ./_build/* $(INSTALLBASE)/$(INSTALLNAME)/
ifeq ($(INSTALLTYPE),system)
rm -r $(INSTALLBASE)/$(INSTALLNAME)/schemas $(INSTALLBASE)/$(INSTALLNAME)/locale
mkdir -p $(SHARE_PREFIX)/glib-2.0/schemas $(SHARE_PREFIX)/locale
cp -r ./schemas/*gschema.* $(SHARE_PREFIX)/glib-2.0/schemas
cp -r ./_build/locale/* $(SHARE_PREFIX)/locale
endif
-rm -fR _build -rm -fR _build
echo done echo done