xref: /OK3568_Linux_fs/buildroot/package/brltty/brltty.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# brltty
4#
5################################################################################
6
7BRLTTY_VERSION = 6.4
8BRLTTY_SOURCE = brltty-$(BRLTTY_VERSION).tar.xz
9BRLTTY_SITE = http://brltty.com/archive
10BRLTTY_INSTALL_STAGING_OPTS = INSTALL_ROOT=$(STAGING_DIR) install
11BRLTTY_INSTALL_TARGET_OPTS = INSTALL_ROOT=$(TARGET_DIR) install
12BRLTTY_LICENSE = LGPL-2.1+
13BRLTTY_LICENSE_FILES = LICENSE-LGPL README
14
15BRLTTY_DEPENDENCIES = \
16	$(TARGET_NLS_DEPENDENCIES) \
17	host-autoconf \
18	host-gawk \
19	host-pkgconf \
20	$(if $(BR2_PACKAGE_AT_SPI2_CORE),at-spi2-core)
21
22BRLTTY_CONF_ENV = \
23	PKG_CONFIG_FOR_BUILD=$(HOST_DIR)/bin/pkgconf
24
25BRLTTY_CONF_OPTS = \
26	--disable-java-bindings \
27	--disable-lisp-bindings \
28	--disable-ocaml-bindings \
29	--disable-python-bindings \
30	--disable-tcl-bindings \
31	--disable-x \
32	--without-espeak-ng \
33	--without-midi-package \
34	--without-mikropuhe --without-speechd --without-swift \
35	--without-theta
36
37# Autoreconf is needed because we're patching configure.ac in
38# 0001-Fix-linking-error-on-mips64el. However, a plain autoreconf doesn't work,
39# because this package is only autoconf-based.
40define BRLTTY_AUTOCONF
41	cd $(BRLTTY_SRCDIR) && $(AUTOCONF)
42endef
43
44BRLTTY_PRE_CONFIGURE_HOOKS += BRLTTY_AUTOCONF
45
46ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS),y)
47BRLTTY_DEPENDENCIES += bluez5_utils
48BRLTTY_CONF_OPTS += --with-bluetooth-package
49else
50BRLTTY_CONF_OPTS += --without-bluetooth-package
51endif
52
53ifeq ($(BR2_PACKAGE_ESPEAK),y)
54BRLTTY_DEPENDENCIES += espeak
55BRLTTY_CONF_OPTS += --with-espeak=$(TARGET_DIR)/usr
56else
57BRLTTY_CONF_OPTS += --without-espeak
58endif
59
60ifeq ($(BR2_PACKAGE_EXPAT),y)
61# host-expat is needed by tbl2hex's host program
62BRLTTY_DEPENDENCIES += host-expat expat
63BRLTTY_CONF_OPTS += --enable-expat
64else
65BRLTTY_CONF_OPTS += --disable-expat
66endif
67
68ifeq ($(BR2_PACKAGE_FLITE),y)
69BRLTTY_DEPENDENCIES += flite
70BRLTTY_CONF_OPTS += --with-flite=$(STAGING_DIR)/usr
71else
72BRLTTY_CONF_OPTS += --without-flite
73endif
74
75ifeq ($(BR2_PACKAGE_ICU),y)
76BRLTTY_DEPENDENCIES += icu
77BRLTTY_CONF_OPTS += --enable-icu
78else
79BRLTTY_CONF_OPTS += --disable-icu
80endif
81
82ifeq ($(BR2_PACKAGE_NCURSES),y)
83BRLTTY_DEPENDENCIES += ncurses
84BRLTTY_CONF_OPTS += --with-curses
85else
86BRLTTY_CONF_OPTS += --without-curses
87endif
88
89ifeq ($(BR2_PACKAGE_PCRE2_32),y)
90BRLTTY_DEPENDENCIES += pcre2
91BRLTTY_CONF_OPTS += --with-rgx-package
92else ifeq ($(BR2_PACKAGE_PCRE_32),y)
93BRLTTY_DEPENDENCIES += pcre
94BRLTTY_CONF_OPTS += --with-rgx-package
95else
96BRLTTY_CONF_OPTS += --without-rgx-package
97endif
98
99ifeq ($(BR2_PACKAGE_POLKIT),y)
100BRLTTY_DEPENDENCIES += polkit
101BRLTTY_CONF_OPTS += --enable-polkit
102else
103BRLTTY_CONF_OPTS += --disable-polkit
104endif
105
106ifeq ($(BR2_PACKAGE_SYSTEMD),y)
107BRLTTY_DEPENDENCIES += systemd
108BRLTTY_CONF_OPTS += --with-service-package
109else
110BRLTTY_CONF_OPTS += --without-service-package
111endif
112
113ifeq ($(BR2_SYSTEM_ENABLE_NLS),y)
114BRLTTY_CONF_OPTS += --enable-i18n
115else
116BRLTTY_CONF_OPTS += --disable-i18n
117endif
118
119BRLTTY_TEXT_TABLE = $(call qstrip,$(BR2_PACKAGE_BRLTTY_TEXT_TABLE))
120ifneq ($(BRLTTY_TEXT_TABLE),)
121BRLTTY_CONF_OPTS += --with-text-table=$(BRLTTY_TEXT_TABLE)
122endif
123
124define BRLTTY_INSTALL_CONF
125	$(INSTALL) -D -m 644 $(@D)/Documents/brltty.conf $(TARGET_DIR)/etc/brltty.conf
126endef
127
128BRLTTY_POST_INSTALL_TARGET_HOOKS += BRLTTY_INSTALL_CONF
129
130define BRLTTY_INSTALL_INIT_SYSV
131	$(INSTALL) -D -m 0755 package/brltty/S10brltty \
132		$(TARGET_DIR)/etc/init.d/S10brltty
133endef
134
135define BRLTTY_INSTALL_INIT_SYSTEMD
136	$(INSTALL) -D -m 0644 package/brltty/brltty.service \
137		$(TARGET_DIR)/usr/lib/systemd/system/brltty.service
138endef
139
140$(eval $(autotools-package))
141