-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
49 lines (41 loc) · 1.98 KB
/
Makefile
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
#!/usr/bin/make -f
LIB_DIR := $(DESTDIR)/lib
BINDTEXTDOMAIN := bindtextdomain.so
HW_PLATFORM := $(shell uname --hardware-platform)
ARCH_32 := i386-linux-gnu
SM_NO_THEME := $(shell grep SOMMELIER_NO_THEME ${SNAPCRAFT_PROJECT_DIR}/snap/snapcraft.yaml | cut -d':' -f2 | sed 's/^ *//;s/"//g' || true)
build:
# Build the 32-bit version of the bindtextdomain patch. This patch
# makes it easier for applications to find gettext translations shipped
# by snaps.
#
# The Gnome extensions only compile the library for 64-bit arch.
ifeq ($(HW_PLATFORM), x86_64)
dpkg -l libc6-dev-i386 || apt-get -y install libc6-dev-i386
dpkg -l gcc-multilib || apt-get -y install gcc-multilib
mkdir -p $(ARCH_32)
/usr/bin/gcc -m32 -Wall -O2 -o $(ARCH_32)/$(BINDTEXTDOMAIN) -fPIC -shared /snap/snapcraft/current/share/snapcraft/extensions/desktop/src/bindtextdomain.c -ldl
endif
clean:
rm -rf $(ARCH_32)
install:
# The sommelier script itself
install -D -m755 scripts/sommelier "$(DESTDIR)"/bin/sommelier
# Empty directories for mounting content snaps
install -d "$(DESTDIR)"/wine-runtime
install -d "$(DESTDIR)"/wine-platform
# cjk languages config
install -D -m644 config/noto-sans-cjk-jp.reg "$(DESTDIR)"/sommelier/config/noto-sans-cjk-jp.reg
install -D -m644 config/noto-sans-cjk-kr.reg "$(DESTDIR)"/sommelier/config/noto-sans-cjk-kr.reg
install -D -m644 config/noto-sans-cjk-tc.reg "$(DESTDIR)"/sommelier/config/noto-sans-cjk-tc.reg
install -D -m644 config/noto-sans-cjk-hk.reg "$(DESTDIR)"/sommelier/config/noto-sans-cjk-hk.reg
install -D -m644 config/noto-sans-cjk-sc.reg "$(DESTDIR)"/sommelier/config/noto-sans-cjk-sc.reg
# Themes
ifneq ($(SM_NO_THEME), 1)
install -D -m644 themes/light/light.msstyles "$(DESTDIR)"/sommelier/themes/light/light.msstyles
install -D -m644 themes/light/light.reg "$(DESTDIR)"/sommelier/themes/light/light.reg
endif
# bindtextdomain patch
ifeq ($(HW_PLATFORM), x86_64)
install -D -m644 $(ARCH_32)/$(BINDTEXTDOMAIN) "$(LIB_DIR)"/$(ARCH_32)/$(BINDTEXTDOMAIN)
endif