|
| 1 | +# Copyright 1999-2020 Gentoo Authors |
| 2 | +# Distributed under the terms of the GNU General Public License v2 |
| 3 | + |
| 4 | +EAPI=6 |
| 5 | + |
| 6 | +inherit autotools flag-o-matic fortran-2 gnome2-utils java-pkg-opt-2 pax-utils toolchain-funcs xdg-utils |
| 7 | + |
| 8 | +DESCRIPTION="High-level interactive language for numerical computations" |
| 9 | +LICENSE="GPL-3" |
| 10 | +HOMEPAGE="https://www.gnu.org/software/octave/" |
| 11 | +SRC_URI="mirror://gnu/${PN}/${P}.tar.gz" |
| 12 | + |
| 13 | +SLOT="0/${PV}" |
| 14 | +IUSE="curl doc fftw +glpk gnuplot gui hdf5 java libressl opengl |
| 15 | + portaudio postscript +qhull +qrupdate readline sndfile +sparse |
| 16 | + ssl static-libs X zlib" |
| 17 | +KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux" |
| 18 | + |
| 19 | +RDEPEND=" |
| 20 | + app-arch/bzip2 |
| 21 | + app-text/ghostscript-gpl |
| 22 | + dev-libs/libpcre:3= |
| 23 | + sys-libs/ncurses:0= |
| 24 | + sys-libs/zlib |
| 25 | + virtual/blas |
| 26 | + virtual/lapack |
| 27 | + curl? ( net-misc/curl:0= ) |
| 28 | + fftw? ( sci-libs/fftw:3.0= ) |
| 29 | + glpk? ( sci-mathematics/glpk:0= ) |
| 30 | + gnuplot? ( sci-visualization/gnuplot ) |
| 31 | + gui? ( |
| 32 | + dev-qt/qtcore:5 |
| 33 | + dev-qt/qtgui:5 |
| 34 | + dev-qt/qthelp:5 |
| 35 | + dev-qt/qtnetwork:5 |
| 36 | + dev-qt/qtopengl:5 |
| 37 | + dev-qt/qtprintsupport:5 |
| 38 | + dev-qt/qtwidgets:5 |
| 39 | + x11-libs/qscintilla:= |
| 40 | + ) |
| 41 | + hdf5? ( sci-libs/hdf5:0= ) |
| 42 | + java? ( >=virtual/jre-1.6.0:* ) |
| 43 | + opengl? ( |
| 44 | + media-libs/freetype:2= |
| 45 | + media-libs/fontconfig:1.0= |
| 46 | + virtual/glu |
| 47 | + >=x11-libs/fltk-1.3:1=[opengl,xft] |
| 48 | + x11-libs/gl2ps:0= |
| 49 | + ) |
| 50 | + ssl? ( |
| 51 | + !libressl? ( dev-libs/openssl:0= ) |
| 52 | + libressl? ( dev-libs/libressl:0= ) |
| 53 | + ) |
| 54 | + portaudio? ( media-libs/portaudio ) |
| 55 | + postscript? ( |
| 56 | + app-text/epstool |
| 57 | + media-gfx/pstoedit |
| 58 | + media-gfx/transfig |
| 59 | + ) |
| 60 | + qhull? ( media-libs/qhull:0= ) |
| 61 | + qrupdate? ( sci-libs/qrupdate:0= ) |
| 62 | + readline? ( sys-libs/readline:0= ) |
| 63 | + sndfile? ( media-libs/libsndfile ) |
| 64 | + sparse? ( |
| 65 | + sci-libs/arpack:0= |
| 66 | + sci-libs/camd:0= |
| 67 | + sci-libs/ccolamd:0= |
| 68 | + sci-libs/cholmod:0= |
| 69 | + sci-libs/colamd:0= |
| 70 | + sci-libs/cxsparse:0= |
| 71 | + sci-libs/umfpack:0= |
| 72 | + ) |
| 73 | + X? ( x11-libs/libX11:0= )" |
| 74 | +DEPEND="${RDEPEND} |
| 75 | + dev-util/gperf |
| 76 | + sys-apps/texinfo |
| 77 | + virtual/pkgconfig |
| 78 | + doc? ( |
| 79 | + dev-texlive/texlive-fontsrecommended |
| 80 | + dev-texlive/texlive-plaingeneric |
| 81 | + dev-texlive/texlive-metapost |
| 82 | + virtual/latex-base |
| 83 | + ) |
| 84 | + gui? ( dev-qt/linguist-tools:5 ) |
| 85 | + java? ( >=virtual/jdk-1.6.0 ) |
| 86 | + qrupdate? ( app-misc/pax-utils ) |
| 87 | + sparse? ( app-misc/pax-utils )" |
| 88 | + |
| 89 | +# Removed "${FILESDIR}"/${PN}-4.2.0-zlib-underlinking.patch |
| 90 | +# because I think Z_LIBS are added to LIBOCTINTERP_LINK_DEPS |
| 91 | +# in the top-level configure.ac now. |
| 92 | +# |
| 93 | +# Both "${FILESDIR}"/${PN}-4.4.0-imagemagick-configure.patch |
| 94 | +# and "${FILESDIR}"/${PN}-4.4.0-imagemagick.patch were removed |
| 95 | +# because this support has been broken upstream for a long time, |
| 96 | +# and a fix that involves "using namespace Magick;" was rejected |
| 97 | +# as far as I can tell. Moreover, the configure.ac patch no longer |
| 98 | +# applies. In the meantime, I've remove support for USE=imagemagick |
| 99 | +# and USE=graphicsmagick. |
| 100 | +# |
| 101 | +# Removed "${FILESDIR}"/${PN}-4.4.0-qt-5.11.patch because it was fixed |
| 102 | +# in https://hg.savannah.gnu.org/hgweb/octave/rev/cdaa884568b1 |
| 103 | +# |
| 104 | +# The texi patch is upstream as https://savannah.gnu.org/bugs/?58057 |
| 105 | +# and should be in a future release. |
| 106 | +PATCHES=( |
| 107 | + "${FILESDIR}"/${PN}-4.4.0-texi.patch |
| 108 | + "${FILESDIR}"/${PN}-4.2.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch |
| 109 | + "${FILESDIR}"/${PN}-5.1.0-pkgbuilddir.patch |
| 110 | + "${FILESDIR}"/${PN}-4.2.2-ncurses-pkgconfig.patch |
| 111 | +) |
| 112 | + |
| 113 | +src_prepare() { |
| 114 | + # nasty prefix hacks for fltk:1 linking |
| 115 | + if use prefix; then |
| 116 | + use opengl && append-ldflags -Wl,-rpath,"${EPREFIX}/usr/$(get_libdir)/fltk-1" |
| 117 | + fi |
| 118 | + |
| 119 | + # occasional fail on install, force regeneration (bug #401189) |
| 120 | + rm doc/interpreter/contributors.texi || die |
| 121 | + |
| 122 | + default |
| 123 | + eautoreconf |
| 124 | +} |
| 125 | + |
| 126 | +src_configure() { |
| 127 | + # unfortunate dependency on mpi from hdf5 (bug #302621) |
| 128 | + use hdf5 && has_version sci-libs/hdf5[mpi] && \ |
| 129 | + export CXX=mpicxx CC=mpicc FC=mpif77 F77=mpif77 |
| 130 | + |
| 131 | + econf \ |
| 132 | + --localstatedir="${EPREFIX}/var/state/octave" \ |
| 133 | + --with-blas="$($(tc-getPKG_CONFIG) --libs blas)" \ |
| 134 | + --with-lapack="$($(tc-getPKG_CONFIG) --libs lapack)" \ |
| 135 | + --disable-64 \ |
| 136 | + --disable-jit \ |
| 137 | + --enable-shared \ |
| 138 | + --with-z \ |
| 139 | + --with-bz2 \ |
| 140 | + $(use_enable static-libs static) \ |
| 141 | + $(use_enable doc docs) \ |
| 142 | + $(use_enable java) \ |
| 143 | + $(use_enable readline) \ |
| 144 | + $(use_with curl) \ |
| 145 | + $(use_with fftw fftw3) \ |
| 146 | + $(use_with fftw fftw3f) \ |
| 147 | + $(use_enable fftw fftw-threads) \ |
| 148 | + $(use_with glpk) \ |
| 149 | + $(use_with hdf5) \ |
| 150 | + $(use_with opengl) \ |
| 151 | + $(use_with opengl fltk) \ |
| 152 | + $(use_with ssl openssl) \ |
| 153 | + $(use_with portaudio) \ |
| 154 | + $(use_with qhull) \ |
| 155 | + $(use_with qrupdate) \ |
| 156 | + $(use_with gui qt 5) \ |
| 157 | + $(use_with sndfile) \ |
| 158 | + $(use_with sparse arpack) \ |
| 159 | + $(use_with sparse umfpack) \ |
| 160 | + $(use_with sparse colamd) \ |
| 161 | + $(use_with sparse ccolamd) \ |
| 162 | + $(use_with sparse cholmod) \ |
| 163 | + $(use_with sparse cxsparse) \ |
| 164 | + $(use_with X x) |
| 165 | +} |
| 166 | + |
| 167 | +src_compile() { |
| 168 | + export VARTEXFONTS="${T}/fonts" # otherwise it will write to /var/cache/fonts/ and trip sandbox |
| 169 | + default |
| 170 | + if use java; then |
| 171 | + pax-mark m "${S}/src/.libs/octave-cli" |
| 172 | + fi |
| 173 | +} |
| 174 | + |
| 175 | +src_install() { |
| 176 | + default |
| 177 | + if use doc; then |
| 178 | + dodoc $(find doc -name '*.pdf') |
| 179 | + else |
| 180 | + # bug 566134, macros.texi is installed by make install if use doc |
| 181 | + insinto /usr/share/${PN}/${PV}/etc |
| 182 | + doins doc/interpreter/macros.texi |
| 183 | + fi |
| 184 | + [[ -e test/fntests.log ]] && dodoc test/fntests.log |
| 185 | + use java && \ |
| 186 | + java-pkg_regjar "${ED%/}/usr/share/${PN}/${PV}/m/java/octave.jar" |
| 187 | + echo "LDPATH=${EPREFIX}/usr/$(get_libdir)/${PN}/${PV}" > 99octave || die |
| 188 | + doenvd 99octave |
| 189 | +} |
| 190 | + |
| 191 | +pkg_postinst() { |
| 192 | + gnome2_icon_cache_update |
| 193 | + xdg_mimeinfo_database_update |
| 194 | + xdg_desktop_database_update |
| 195 | +} |
| 196 | + |
| 197 | +pkg_postrm() { |
| 198 | + gnome2_icon_cache_update |
| 199 | + xdg_mimeinfo_database_update |
| 200 | + xdg_desktop_database_update |
| 201 | +} |
0 commit comments