Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable user installation #48

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
uniemoji.db
uniemoji.xml
config.py
environment.conf
*~
*.pyc
73 changes: 73 additions & 0 deletions Makefile.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Needs to be run under active user session
# xdg and systemd required

SYSCONFDIR ?= /etc

ifdef XDG_CONFIG_HOME
CONFDIR ?= $(XDG_CONFIG_HOME)
else
CONFDIR ?= $(HOME)/.config
endif

ifdef XDG_DATA_HOME
DATADIR ?= $(XDG_DATA_HOME)
else
DATADIR ?= $(HOME)/.local/share
endif

DESTDIR ?=


PYTHON ?= /usr/bin/python3

all: uniemoji.xml config.py environment.conf

uniemoji.xml: uniemoji.xml.in
sed -e "s:@PYTHON@:$(PYTHON):g;" \
-e "s:@DATADIR@:$(DATADIR):g" $< > $@

config.py: config.py.in
sed -e "s:@SYSCONFDIR@:$(SYSCONFDIR):g" $< > $@

environment.conf: environment.conf.in
sed -e "s:@DATADIR@:$(DATADIR):g" $< > $@

install: all
install -m 0755 -d \
$(DESTDIR)$(CONFDIR)/environment.d \
$(DESTDIR)$(CONFDIR)/xdg/uniemoji \
$(DESTDIR)$(DATADIR)/ibus-uniemoji \
$(DESTDIR)$(DATADIR)/ibus-uniemoji/unicode \
$(DESTDIR)$(DATADIR)/ibus/component
install -m 0644 uniemoji.svg joypixels_emoji.json $(DESTDIR)$(DATADIR)/ibus-uniemoji
install -m 0644 unicode/*.txt $(DESTDIR)$(DATADIR)/ibus-uniemoji/unicode
install -m 0755 uniemoji.py $(DESTDIR)$(DATADIR)/ibus-uniemoji
install -m 0644 config.py $(DESTDIR)$(DATADIR)/ibus-uniemoji
install -m 0644 ibus.py $(DESTDIR)$(DATADIR)/ibus-uniemoji
install -m 0644 uniemoji.xml $(DESTDIR)$(DATADIR)/ibus/component
install -m 0644 custom.json $(DESTDIR)$(CONFDIR)/xdg/uniemoji
install -m 0644 environment.conf $(DESTDIR)$(CONFDIR)/environment.d/ibus-uniemoji.conf
IBUS_COMPONENT_PATH=/usr/share/ibus/component:$(DATADIR)/ibus/component ibus-daemon --daemonize --replace --panel disable

uninstall:
rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/uniemoji.svg
rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/unicode/*.txt
rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/*.txt
rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/*.json
rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/uniemoji.py
rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/config.py
rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/ibus.py
rm -f $(DESTDIR)$(DATADIR)/ibus-uniemoji/__pycache__/*.pyc
rmdir $(DESTDIR)$(DATADIR)/ibus-uniemoji/__pycache__ || true
rmdir $(DESTDIR)$(DATADIR)/ibus-uniemoji/unicode || true
rmdir $(DESTDIR)$(DATADIR)/ibus-uniemoji || true
rm -f $(DESTDIR)$(CONFDIR)/xdg/uniemoji/custom.json
rmdir $(DESTDIR)$(CONFDIR)/xdg/uniemoji || true
rm -f $(DESTDIR)$(DATADIR)/ibus/component/uniemoji.xml
rm -f $(DESTDIR)$(CONFDIR)/environment.d/ibus-uniemoji.conf
ibus-daemon --daemonize --replace --panel disable

clean:
rm -f uniemoji.xml
rm -f config.py
rm -f environment.conf
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,17 @@ Optional:
Installing
-----------

There are two installation variats: system and user. System variant requires administrator permissions (sudo or su) while user variant requires no special privileges but must be repeated for each user.

System-wide

To install, type `make install`. If your ibus isn't on /usr/share/ibus, or you want to install to /usr/local, you can pass any of `PREFIX`, `DATADIR`, and `SYSCONFDIR` to `make`. You can also pass `DESTDIR` to aid in packaging, or `PYTHON` to use a different Python executable.


User install

Similar to system-wide, type `make -f Makefile.user install` from the ibus-uniemoji directory. `PREFIX`, `CONFDIR`, `DATADIR` and `PYTHON` variables are available but `CONFDIR` is mapped by default to `$XDG_CONFIG_HOME` (`~/.config`) and `DATADIR` is to `$XDG_DATA_HOME` (`~/.local/share`)

Running
--------

Expand Down
1 change: 1 addition & 0 deletions environment.conf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IBUS_COMPONENT_PATH=/usr/share/ibus/component:@DATADIR@/ibus/component