1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
8 JAVA_PKG_WANT_SOURCE="1.8"
9 JAVA_PKG_WANT_TARGET="1.8"
11 inherit findlib eutils multilib toolchain-funcs java-pkg-opt-2 flag-o-matic usr-ldscript \
12 autotools udev systemd python-r1
14 DESCRIPTION="Daemon that provides access to the Linux/Unix console for a blind person"
15 HOMEPAGE="https://brltty.app/"
16 SRC_URI="https://brltty.app/archive/${P}.tar.xz"
18 LICENSE="GPL-2 LGPL-2.1"
20 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86"
21 IUSE="+api +beeper bluetooth +contracted-braille doc +fm gpm iconv icu
22 java louis +midi ncurses nls ocaml +pcm policykit python
23 usb systemd +speech tcl xml X"
24 REQUIRED_USE="doc? ( api )
27 python? ( api ${PYTHON_REQUIRED_USE} )
31 app-accessibility/at-spi2-core:2
32 dev-libs/libpcre2[pcre32]
34 bluetooth? ( net-wireless/bluez )
35 gpm? ( >=sys-libs/gpm-1.20 )
36 iconv? ( virtual/libiconv )
37 icu? ( dev-libs/icu:= )
38 louis? ( dev-libs/liblouis )
39 midi? ( media-libs/alsa-lib )
40 ncurses? ( sys-libs/ncurses:0= )
41 pcm? ( media-libs/alsa-lib )
42 policykit? ( sys-auth/polkit )
43 python? ( ${PYTHON_DEPS} )
45 app-accessibility/espeak
46 app-accessibility/flite
47 app-accessibility/speech-dispatcher
49 systemd? ( sys-apps/systemd )
50 tcl? ( >=dev-lang/tcl-8.4.15:0= )
51 usb? ( virtual/libusb:0 )
52 xml? ( dev-libs/expat )
59 DEPEND="${COMMON_DEP}"
62 java? ( >=virtual/jdk-1.4 )
63 nls? ( virtual/libintl )
64 python? ( >=dev-python/cython-0.16[${PYTHON_USEDEP}] )
66 RDEPEND="java? ( >=virtual/jre-1.4 )
69 HTML_DOCS=( "${S}"/Documents/Manual-BrlAPI/. )
72 "${FILESDIR}"/${PN}-6.0-udev.patch
73 "${FILESDIR}"/${PN}-5.2-respect-AR.patch
79 java-pkg-opt-2_src_prepare
81 # We run eautoconf instead of using eautoreconf because brltty uses
82 # a custom build system that uses autoconf without the rest of the
85 use python && python_copy_sources
89 tc-export AR LD PKG_CONFIG
92 export JAVA_JNI_FLAGS=""
94 export JAVA_HOME="$(java-config -g JAVA_HOME)"
95 export JAVAC_HOME="${JAVA_HOME}/bin"
96 export JAVA_JNI_FLAGS="$(java-pkg_get-jni-cflags)"
97 export JAVAC="$(java-pkg_get-javac) -encoding UTF-8 $(java-pkg_javac-args)"
100 # override prefix in order to install into /
101 # braille terminal needs to be available as soon in the boot process as
103 # Also override localstatedir so that the lib/brltty directory is installed
105 # Disable stripping since we do that ourselves.
107 --prefix="${EPREFIX}"/
108 --localedir="${EPREFIX}"/usr/share/locale
109 --includedir="${EPREFIX}"/usr/include
110 --localstatedir="${EPREFIX}"/var
112 --with-install-root="${D}"
113 --with-writable-directory="${EPREFIX}"/run/brltty
115 $(use_with beeper beep-package)
116 $(use_enable contracted-braille)
117 $(use_with fm fm-package)
121 $(use_enable java java-bindings)
122 $(use_enable louis liblouis)
123 $(use_with midi midi-package)
124 $(use_enable nls i18n)
125 $(use_enable ocaml ocaml-bindings)
126 $(use_with pcm pcm-package)
127 $(use_enable policykit polkit)
128 $(use_enable python python-bindings)
129 $(use_enable speech speech-support)
130 $(use_with systemd service-package)
131 $(use_enable tcl tcl-bindings)
132 $(use_enable xml expat)
134 $(use_with bluetooth bluetooth-package)
135 $(use_with ncurses curses)
136 $(use_with usb usb-package) )
144 python_foreach_impl run_in_build_dir python_configure
149 emake JAVA_JNI_FLAGS="${JAVA_JNI_FLAGS}" JAVAC="${JAVAC}"
153 cd "Bindings/Python" || die
156 python_foreach_impl run_in_build_dir python_build
165 emake OCAML_LDCONF= install
169 cd "Bindings/Python" || die
172 python_foreach_impl run_in_build_dir python_install
176 java-pkg_doso Bindings/Java/libbrlapi_java.so
177 java-pkg_dojar Bindings/Java/brlapi.jar
181 doins Documents/brltty.conf
182 udev_newrules Autostart/Udev/rules 70-brltty.rules
183 newinitd "${FILESDIR}"/brltty.rc brltty
184 systemd_dounit Autostart/Systemd/brltty@.service
185 systemd_dotmpfilesd "${FILESDIR}/${PN}.tmpfiles.conf"
188 local libdir="$(get_libdir)"
189 mkdir -p "${ED}"/usr/${libdir}/ || die
190 mv "${ED}"/${libdir}/*.a "${ED}"/usr/${libdir}/ || die
191 gen_usr_ldscript libbrlapi.so
195 mv Manual-BRLTTY/English/BRLTTY.txt BRLTTY-en.txt || die
196 mv Manual-BRLTTY/French/BRLTTY.txt BRLTTY-fr.txt || die
197 mv Manual-BrlAPI/English/BrlAPI.txt BrlAPI-en.txt || die
198 dodoc CONTRIBUTORS ChangeLog HISTORY README* TODO BRLTTY-*.txt
201 HTML_DOCS="Manual-BRLTTY" einstalldocs
204 keepdir /var/lib/BrlAPI
205 rmdir "${ED}/run/brltty" || die
206 rmdir "${ED}/run" || die
211 elog "please be sure ${ROOT}/etc/brltty.conf is correct for your system."
213 elog "To make brltty start on boot, type this command as root:"
215 elog "rc-update add brltty boot"