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 $
7 inherit toolchain-funcs eutils versionator
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"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="ace doc examples zlib"
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
23 zlib? ( sys-libs/zlib )"
26 doc? ( app-doc/doxygen )"
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"
37 use $1 && echo "y" || echo "n"
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}"
47 # * xqilla is not required, this is only whether or not to include the xpath
48 # examples which require xqilla
51 build/import/lib{ace,boost,cult,backend-elements,xerces-c,xqilla,xsd-frontend,z}
53 cat >> build/configuration-dynamic.make <<- EOF
54 xsd_with_zlib := $(use_yesno zlib)
55 xsd_with_ace := $(use_yesno ace)
59 xsd_with_boost_date_time := y
60 xsd_with_boost_serialization := y
63 cat >> build/cxx/configuration-dynamic.make <<- EOF
68 cxx_pp_extra_options :=
69 cxx_extra_options := ${CXXFLAGS} -DBOOST_FILESYSTEM_VERSION=2 -I${BOOST_INC}
70 cxx_ld_extra_options := ${LDFLAGS}
72 cxx_extra_lib_paths :=
75 cat >> build/cxx/gnu/configuration-dynamic.make <<- EOF
76 cxx_gnu := $(tc-getCXX)
78 cxx_gnu_optimization_options :=
81 cat >> build/import/libace/configuration-dynamic.make <<- EOF
85 cat >> build/import/libbackend-elements/configuration-dynamic.make <<- EOF
86 libbackend_elements_installed := y
89 cat >> build/import/libboost/configuration-dynamic.make <<- EOF
90 libboost_installed := y
91 libboost_suffix := -mt-${BOOST_VER}
95 cat >> build/import/libcult/configuration-dynamic.make <<- EOF
96 libcult_installed := y
99 cat >> build/import/libxerces-c/configuration-dynamic.make <<- EOF
100 libxerces_c_installed := y
103 cat >> build/import/libxqilla/configuration-dynamic.make <<- EOF
104 libxqilla_installed := y
107 cat >> build/import/libxsd-frontend/configuration-dynamic.make <<- EOF
108 libxsd_frontend_installed := y
111 cat >> build/import/libz/configuration-dynamic.make <<- EOF
115 MAKEOPTS+=" verbose=1"
121 emake -C "${S}/documentation/cxx/tree/reference" || die "generating reference docs failed"
124 XERCESC_NLS_HOME="${ROOT}usr/share/xerces-c/msg" emake -C "${S}/tests" || die "building tests failed"
129 emake install_prefix="${D}/usr" install || die "emake install failed"
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
135 rm -rf "${D}/usr/share/doc"
137 dohtml -r -A xhtml -A pdf documentation/*
139 dodoc NEWS README FLOSSE documentation/custom-literals.xsd
140 newdoc libxsd/README README.libxsd
141 newdoc libxsd/FLOSSE FLOSSE.libxsd
143 if use examples; then
144 insinto /usr/share/doc/${PF}
150 XERCESC_NLS_HOME="${ROOT}usr/share/xerces-c/msg" emake -C "${S}/tests" test || die "tests failed"