]> vaikene.ee Git - ebuild/blob - dev-cpp/xsd/xsd-3.3.0-r1.ebuild
Lisatud RIA poolt tellitud ametliku ID kaardi tarkvara v3.5_rc ebuild failid.
[ebuild] / dev-cpp / xsd / xsd-3.3.0-r1.ebuild
1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-cpp/xsd/xsd-3.3.0.ebuild,v 1.2 2010/10/21 05:49:02 dev-zero Exp $
4
5 EAPI="2"
6
7 inherit toolchain-funcs eutils versionator
8
9 DESCRIPTION="An open-source, cross-platform W3C XML Schema to C++ data binding compiler."
10 HOMEPAGE="http://www.codesynthesis.com/products/xsd/"
11 SRC_URI="http://www.codesynthesis.com/download/${PN}/$(get_version_component_range 1-2)/${P}.tar.bz2"
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="ace doc examples zlib"
16
17 RDEPEND=">=dev-libs/xerces-c-3
18 >=dev-libs/boost-1.40.0
19 >=dev-cpp/libcult-1.4.6
20 >=dev-cpp/libxsd-frontend-1.17.0
21 >=dev-cpp/libbackend-elements-1.7.2
22 ace? ( dev-libs/ace )
23 zlib? ( sys-libs/zlib )"
24 DEPEND="${RDEPEND}
25 dev-util/build
26 doc? ( app-doc/doxygen )"
27
28 src_prepare() {
29 epatch \
30 "${FILESDIR}/${PV}-disable_examples_and_tests.patch" \
31 "${FILESDIR}/${PV}-xsdcxx-rename.patch" \
32 "${FILESDIR}/${PV}-fix_include.patch" \
33 "${FILESDIR}/${PV}-fix_tests.patch"
34 }
35
36 use_yesno() {
37 use $1 && echo "y" || echo "n"
38 }
39
40 src_configure() {
41 BOOST_PKG="$(best_version ">=dev-libs/boost-1.40.0")"
42 BOOST_VER="$(get_version_component_range 1-2 "${BOOST_PKG/*boost-/}")"
43 BOOST_VER="$(replace_all_version_separators _ "${BOOST_VER}")"
44 BOOST_INC="/usr/include/boost-${BOOST_VER}"
45
46 # Maintainer notes:
47 # * xqilla is not required, this is only whether or not to include the xpath
48 # examples which require xqilla
49 mkdir -p \
50 build/cxx/gnu \
51 build/import/lib{ace,boost,cult,backend-elements,xerces-c,xqilla,xsd-frontend,z}
52
53 cat >> build/configuration-dynamic.make <<- EOF
54 xsd_with_zlib := $(use_yesno zlib)
55 xsd_with_ace := $(use_yesno ace)
56 xsd_with_xdr := y
57 xsd_with_dbxml := n
58 xsd_with_xqilla := y
59 xsd_with_boost_date_time := y
60 xsd_with_boost_serialization := y
61 EOF
62
63 cat >> build/cxx/configuration-dynamic.make <<- EOF
64 cxx_id := gnu
65 cxx_optimize := n
66 cxx_debug := n
67 cxx_rpath := n
68 cxx_pp_extra_options :=
69 cxx_extra_options := ${CXXFLAGS} -DBOOST_FILESYSTEM_VERSION=2 -I${BOOST_INC}
70 cxx_ld_extra_options := ${LDFLAGS}
71 cxx_extra_libs :=
72 cxx_extra_lib_paths :=
73 EOF
74
75 cat >> build/cxx/gnu/configuration-dynamic.make <<- EOF
76 cxx_gnu := $(tc-getCXX)
77 cxx_gnu_libraries :=
78 cxx_gnu_optimization_options :=
79 EOF
80
81 cat >> build/import/libace/configuration-dynamic.make <<- EOF
82 libace_installed := y
83 EOF
84
85 cat >> build/import/libbackend-elements/configuration-dynamic.make <<- EOF
86 libbackend_elements_installed := y
87 EOF
88
89 cat >> build/import/libboost/configuration-dynamic.make <<- EOF
90 libboost_installed := y
91 libboost_suffix := -mt-${BOOST_VER}
92 libboost_system := n
93 EOF
94
95 cat >> build/import/libcult/configuration-dynamic.make <<- EOF
96 libcult_installed := y
97 EOF
98
99 cat >> build/import/libxerces-c/configuration-dynamic.make <<- EOF
100 libxerces_c_installed := y
101 EOF
102
103 cat >> build/import/libxqilla/configuration-dynamic.make <<- EOF
104 libxqilla_installed := y
105 EOF
106
107 cat >> build/import/libxsd-frontend/configuration-dynamic.make <<- EOF
108 libxsd_frontend_installed := y
109 EOF
110
111 cat >> build/import/libz/configuration-dynamic.make <<- EOF
112 libz_installed := y
113 EOF
114
115 MAKEOPTS+=" verbose=1"
116 }
117
118 src_compile() {
119 default
120 if use doc ; then
121 emake -C "${S}/documentation/cxx/tree/reference" || die "generating reference docs failed"
122 fi
123 if use test ; then
124 XERCESC_NLS_HOME="${ROOT}usr/share/xerces-c/msg" emake -C "${S}/tests" || die "building tests failed"
125 fi
126 }
127
128 src_install() {
129 emake install_prefix="${D}/usr" install || die "emake install failed"
130
131 # Renaming binary/manpage to avoid collision with mono-2.0's xsd/xsd2
132 mv "${D}"/usr/bin/xsd{,cxx}
133 mv "${D}"/usr/share/man/man1/xsd{,cxx}.1
134
135 rm -rf "${D}/usr/share/doc"
136
137 dohtml -r -A xhtml -A pdf documentation/*
138
139 dodoc NEWS README FLOSSE documentation/custom-literals.xsd
140 newdoc libxsd/README README.libxsd
141 newdoc libxsd/FLOSSE FLOSSE.libxsd
142
143 if use examples; then
144 insinto /usr/share/doc/${PF}
145 doins -r examples
146 fi
147 }
148
149 src_test() {
150 XERCESC_NLS_HOME="${ROOT}usr/share/xerces-c/msg" emake -C "${S}/tests" test || die "tests failed"
151 }