qtiplot-0.9.8.9-r2.ebuild 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit eutils qt4-r2 fdo-mime python-single-r1 toolchain-funcs
  6. DESCRIPTION="Qt based clone of the Origin plotting package"
  7. HOMEPAGE="http://soft.proindependent.com/qtiplot.html
  8. http://www.staff.science.uu.nl/~zeven101/qtiplot.html"
  9. SRC_URI="
  10. https://dev.gentoo.org/~dilfridge/distfiles/${P}.tar.bz2
  11. https://dev.gentoo.org/~dilfridge/distfiles/${P}-origin.patch.bz2"
  12. LICENSE="GPL-2 GPL-3"
  13. SLOT="0"
  14. KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
  15. IUSE="bindist doc mono latex python"
  16. LANGS="cn cz de es fr ja ro ru sv"
  17. for l in ${LANGS}; do
  18. lu=${l/cz/cs}
  19. lu=${lu/cn/zh_CN}
  20. IUSE="${IUSE} linguas_${lu}"
  21. done
  22. REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
  23. # qwtplot3d much modified from original upstream
  24. # >=x11-libs/qwt-5.3 they are using trunk checkouts
  25. CDEPEND="
  26. media-libs/libemf
  27. dev-qt/qthelp:4
  28. dev-qt/qtgui:4
  29. dev-qt/qtopengl:4
  30. dev-qt/qt3support:4
  31. dev-qt/qthelp:4[compat]
  32. dev-qt/qtsvg:4
  33. >=x11-libs/gl2ps-1.3.5[png]
  34. >=dev-cpp/muParser-1.32
  35. >=dev-libs/boost-1.35.0:=
  36. dev-libs/quazip[qt4]
  37. media-libs/libpng:=
  38. sci-libs/alglib:=
  39. <sci-libs/gsl-2
  40. sci-libs/tamu_anova
  41. latex? ( dev-tex/qtexengine )
  42. mono? ( dev-dotnet/libgdiplus )
  43. python? ( ${PYTHON_DEPS} )"
  44. DEPEND="${CDEPEND}
  45. virtual/pkgconfig
  46. python? ( >=dev-python/sip-4.9[${PYTHON_USEDEP}] )
  47. doc? (
  48. >=app-text/docbook-sgml-utils-0.6.14-r1
  49. >=app-text/docbook-xml-dtd-4.4-r2:4.4 )"
  50. RDEPEND="${CDEPEND}
  51. python? ( dev-python/PyQt4[X,${PYTHON_USEDEP}] )"
  52. PATCHES=(
  53. "${DISTDIR}"/${P}-origin.patch.bz2
  54. "${FILESDIR}"/${P}-origin-2.patch
  55. "${FILESDIR}"/${P}-qt48.patch
  56. "${FILESDIR}"/${PN}-0.9.8.8-system-gl2ps.patch
  57. "${FILESDIR}"/${PN}-0.9.7.10-dont-install-qwt.patch
  58. "${FILESDIR}"/${PN}-0.9.8.6-gold.patch
  59. "${FILESDIR}"/${PN}-0.9.8.7-kde.patch
  60. "${FILESDIR}"/${P}-set_col_values.patch
  61. "${FILESDIR}"/${P}-adopt_to_alglib3.patch
  62. "${FILESDIR}"/${P}-crasher_without_internet.patch
  63. "${FILESDIR}"/${P}-private.patch
  64. "${FILESDIR}"/${P}-sip-4.15.patch
  65. "${FILESDIR}"/${P}-PyQt4-4.10.patch
  66. )
  67. RESTRICT="!bindist? ( bindist )"
  68. pkg_setup() {
  69. use python && python-single-r1_pkg_setup
  70. }
  71. src_prepare() {
  72. local mylibs
  73. qt4-r2_src_prepare
  74. rm -rf 3rdparty/{liborigin,QTeXEngine,/qwtplot3d/3rdparty/gl2ps/,boost,alglib} || die
  75. sed \
  76. -e "s:dll:static:g" \
  77. -e "/INSTALLS/d" \
  78. -i 3rdparty/qwtplot3d/*.pro
  79. mylibs="${mylibs} -lquazip"
  80. use mono && mylibs="${mylibs} $($(tc-getPKG_CONFIG) --libs libgdiplus)"
  81. # Check build.conf for changes on bump.
  82. cat > build.conf <<-EOF
  83. # Automatically generated by Gentoo ebuild
  84. isEmpty( QTI_ROOT ) {
  85. message( "each file including this config needs to set QTI_ROOT to the dir containing this file!" )
  86. }
  87. MUPARSER_LIBS = $($(tc-getPKG_CONFIG) --libs muparser)
  88. GSL_LIBS = $($(tc-getPKG_CONFIG) --libs gsl)
  89. QWT_INCLUDEPATH = \$\$QTI_ROOT/3rdparty/qwt/src
  90. QWT_LIBS = \$\$QTI_ROOT/3rdparty/qwt/lib/libqwt.a
  91. QWT3D_INCLUDEPATH = \$\$QTI_ROOT/3rdparty/qwtplot3d/include
  92. QWT3D_LIBS = \$\$QTI_ROOT/3rdparty/qwtplot3d/lib/libqwtplot3d.a
  93. EMF_INCLUDEPATH = "${EPREFIX}/usr/include/libEMF
  94. SYS_LIBS = -lgl2ps ${mylibs} -lGLU
  95. LUPDATE = lupdate
  96. LRELEASE = lrelease
  97. SCRIPTING_LANGS += muParser
  98. CONFIG += release
  99. CONFIG += CustomInstall
  100. DEFINES += SCRIPTING_CONSOLE
  101. LIBPNG_LIBS = $($(tc-getPKG_CONFIG) --libs libpng)
  102. TAMUANOVA_LIBS = -ltamuanova
  103. TAMUANOVA_INCLUDEPATH = "${EPREFIX}/usr/include/tamu_anova"
  104. ALGLIB_LIBS = -lalglib
  105. EOF
  106. use bindist && echo "DEFINES += QTIPLOT_SUPPORT" >> build.conf
  107. use bindist || echo "DEFINES += QTIPLOT_PRO" >> build.conf
  108. use python && echo "SCRIPTING_LANGS += Python" >> build.conf
  109. use python && echo "PYTHON = ${EPYTHON}" >> build.conf
  110. use latex && echo "TEX_ENGINE_LIBS = -lQTeXEngine" >> build.conf
  111. sed \
  112. -e "s:doc/${PN}/manual:doc/${PN}/html:" \
  113. -e '/INSTALLS.*documentation/d' \
  114. -e '/INSTALLS.*manual/d' \
  115. -e "/INSTALLBASE/s: /usr: ${EPREFIX}/usr:g" \
  116. -e 's:/usr/local/qtiplot:$$INSTALLBASE:g' \
  117. -i qtiplot/qtiplot.pro || die
  118. if use python; then
  119. sed \
  120. -e "s:/usr/local/${PN}:${EPREFIX}$(python_get_sitedir)/qtiplot:" \
  121. -i qtiplot/qtiplot.pro || die
  122. fi
  123. sed \
  124. -e "/^target.path/s:/usr:${EPREFIX}/usr:g" \
  125. -i fitPlugins/*/*.pro || die
  126. sed -e '/manual/d' -i qtiplot.pro || die
  127. sed -e "s:QTIPLOT_PRO:QTIPLOT_PROFESSIONAL:g" -i qtiplot/src/core/main.cpp || die
  128. # Drop langs only if LINGUAS is not empty
  129. if [[ -n ${LINGUAS} ]]; then
  130. for l in ${LANGS}; do
  131. lu=${l/cz/cs}
  132. lu=${lu/cn/zh_CN}
  133. use linguas_${lu} || \
  134. sed -e "s:translations/qtiplot_${l}.[tq][sm]::" \
  135. -i qtiplot/qtiplot.pro || die
  136. done
  137. fi
  138. sed \
  139. -e "s:d_python_config_folder + \":\"${EPREFIX}/usr/share/qtiplot:g" \
  140. -i qtiplot/src/core/ApplicationWindow.cpp || die
  141. chmod -x qtiplot/qti_wordlist.txt
  142. # sed out debian paths
  143. sed -e 's:\(/usr/share/sgml/\)docbook/stylesheet/dsssl/modular\(/html/docbook.dsl\):\1stylesheets/dsssl/docbook\2:' \
  144. -i manual/qtiplot.dsl || die
  145. sed -e 's:\(/usr/share/\)xml/docbook/stylesheet/nwalsh\(/html/chunk.xsl\):\1sgml/docbook/xsl-stylesheets\2:' \
  146. -i manual/qtiplot_html.xsl || die
  147. sed \
  148. -e '1i#define OF(x) x' \
  149. -i 3rdparty/zlib/minigzip.c || die
  150. }
  151. src_configure() {
  152. use amd64 && export QMAKESPEC="linux-g++-64"
  153. eqmake4
  154. }
  155. src_compile() {
  156. emake
  157. lrelease qtiplot/qtiplot.pro || die
  158. if use doc; then
  159. cd manual
  160. emake web
  161. fi
  162. }
  163. src_install() {
  164. qt4-r2_src_install
  165. insinto /usr/share/qtiplot
  166. doins qtiplot/qti_wordlist.txt
  167. newicon qtiplot_logo.png qtiplot.png
  168. make_desktop_entry qtiplot "QtiPlot Scientific Plotting" qtiplot
  169. use doc && dohtml -r manual/html/*
  170. use python && python_optimize
  171. if [[ -n ${LINGUAS} ]]; then
  172. insinto /usr/share/${PN}/translations
  173. for l in ${LANGS}; do
  174. lu=${l/cz/cs}
  175. lu=${lu/cn/zh_CN}
  176. use linguas_${lu} && \
  177. doins qtiplot/translations/qtiplot_${l}.qm
  178. done
  179. fi
  180. }
  181. pkg_postinst() {
  182. if use python; then
  183. optfeature "Enhanced python support" \
  184. dev-python/pygsl dev-python/rpy sci-libs/scipy dev-python/sympy
  185. fi
  186. fdo-mime_desktop_database_update
  187. }
  188. pkg_postrm() {
  189. fdo-mime_desktop_database_update
  190. }