app-pda/pilot-link-0.12.5-r2: alpha stable
[gentoo.git] / app-pda / pilot-link / pilot-link-0.12.5-r2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 )
6
7 inherit autotools distutils-r1 perl-module java-pkg-opt-2
8
9 DESCRIPTION="Suite of tools for moving data between a Palm device and a desktop"
10 HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
11 SRC_URI="mirror://gentoo/${P}.tar.bz2
12         https://dev.gentoo.org/~mgorny/dist/${P}-gentoo-patchset.tar.bz2"
13
14 LICENSE="|| ( GPL-2 LGPL-2 )"
15 SLOT="0"
16 KEYWORDS="alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
17 IUSE="bluetooth debug java perl png python static-libs threads usb"
18
19 COMMON_DEPEND="
20         dev-libs/popt
21         >=sys-libs/ncurses-5.7-r7:0=
22         >=sys-libs/readline-6:0=
23         virtual/libiconv
24         bluetooth? ( net-wireless/bluez )
25         perl? ( >=dev-lang/perl-5.12 )
26         png? ( media-libs/libpng:0= )
27         usb? ( virtual/libusb:0 )
28 "
29 DEPEND="${COMMON_DEPEND}
30         java? ( >=virtual/jdk-1.4 )
31 "
32 RDEPEND="${COMMON_DEPEND}
33         java? ( >=virtual/jre-1.4 )
34 "
35
36 RESTRICT="test" #672872
37
38 src_prepare() {
39         default
40
41         eapply -p0 "${WORKDIR}/${P}-gentoo-patchset"/${PN}-0.12.3-java-install.patch
42         eapply -p0 "${WORKDIR}/${P}-gentoo-patchset"/${PN}-0.12.3-respect-javacflags.patch
43         eapply -p0 "${WORKDIR}/${P}-gentoo-patchset"/${PN}-0.12.2-werror_194921.patch
44         eapply -p1 "${WORKDIR}/${P}-gentoo-patchset"/${PN}-0.12.2-threads.patch
45         eapply -p0 "${WORKDIR}/${P}-gentoo-patchset"/${PN}-0.12.3-libpng14.patch
46         eapply -p1 "${WORKDIR}/${P}-gentoo-patchset"/${PN}-0.12.3-png.patch
47         eapply -p0 "${WORKDIR}/${P}-gentoo-patchset"/${PN}-0.12.3-distutils.patch
48         eapply -p1 "${WORKDIR}/${P}-gentoo-patchset"/${PN}-0.12.3-libusb-compat-usb_open.patch
49         eapply -p1 "${WORKDIR}/${P}-gentoo-patchset"/${PN}-0.12.5-perl514.patch
50
51         sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die #467600
52
53         AT_M4DIR="m4" eautoreconf
54 }
55
56 src_configure() {
57         # tcl/tk support is disabled as per upstream request.
58         # readline is not really optional, bug #626504
59         econf \
60                 --includedir="${EPREFIX}"/usr/include/libpisock \
61                 $(use_enable static-libs static) \
62                 --enable-conduits \
63                 --with-readline \
64                 $(use_enable threads) \
65                 $(use_enable usb libusb) \
66                 $(use_enable debug) \
67                 $(use_with png libpng) \
68                 $(use_with bluetooth bluez) \
69                 $(use_with perl) \
70                 $(use_with java) \
71                 --without-tcl \
72                 $(use_with python)
73 }
74
75 src_compile() {
76         emake
77
78         if use perl; then
79                 cd "${S}"/bindings/Perl
80                 perl-module_src_configure
81                 local mymake=( OTHERLDFLAGS="${LDFLAGS} -L../../libpisock/.libs -lpisock" ) #308629
82                 perl-module_src_compile
83         fi
84
85         if use python; then
86                 cd "${S}"/bindings/Python
87                 distutils-r1_src_compile
88         fi
89 }
90
91 src_install() {
92         emake DESTDIR="${D}" install
93         dodoc ChangeLog NEWS README doc/{README*,TODO}
94
95         if use java; then
96                 cd "${S}"/bindings/Java
97                 java-pkg_newjar ${PN}.jar
98                 java-pkg_doso libjpisock.so
99         fi
100
101         if use perl; then
102                 cd "${S}"/bindings/Perl
103                 perl-module_src_install
104         fi
105
106         if use python; then
107                 cd "${S}"/bindings/Python
108                 distutils-r1_src_install
109         fi
110
111         find "${D}" -name '*.la' -delete || die
112 }
113
114 pkg_preinst() {
115         perl_set_version
116         java-pkg-opt-2_pkg_preinst
117 }