450a5abfd4b27a268991a818fe47f2e178221d62
[pkgsrc.git] / math / octave / Makefile
1 # $NetBSD: Makefile,v 1.85 2010/01/17 12:02:26 wiz Exp $
2
3 DISTNAME=       octave-${OCTAVE_VER}
4 PKGREVISION=    2
5 CATEGORIES=     math
6 MASTER_SITES=   ftp://ftp.octave.org/pub/octave/
7 EXTRACT_SUFX=   .tar.bz2
8
9 MAINTAINER=     adam@NetBSD.org
10 HOMEPAGE=       http://www.octave.org/
11 COMMENT=        High-level language, intended for numerical computations
12
13 BUILD_DEPENDS+= bison>=1.875:../../devel/bison
14 BUILD_DEPENDS+= gperf>=2.7:../../devel/gperf
15 DEPENDS+=       gnuplot>=3.7:../../graphics/gnuplot
16
17 OCTAVE_VER=     3.2.3
18 CONFLICTS+=     octave-2.*
19
20 .if (${MACHINE_ARCH} == "arm32")
21 BROKEN=         Internal compiler error occurs on arm32 (even with gcc-2.95.3)
22 .endif
23
24 PKG_DESTDIR_SUPPORT=    user-destdir
25
26 USE_GNU_READLINE=       yes
27 USE_LIBTOOL=            yes
28 USE_TOOLS+=             autoconf gsed gmake makeinfo perl pkg-config
29 GNU_CONFIGURE=          yes
30
31 GCC_REQD+=              3.0
32 USE_LANGUAGES=          c c++ fortran
33
34 # needed for loading of shared objects such as those in the
35 # octave-forge package or user written ones compiled with mkoctfile
36 CONFIGURE_ARGS+=        --enable-dl
37 # shared libraries are handled automatically in pkgsrc
38 CONFIGURE_ARGS+=        --enable-static
39 CONFIGURE_ARGS+=        --disable-shared
40
41 # trick pkgsrc into real gsed, needed for "mkf77def"
42 TOOLS_PLATFORM.gsed=    #empty
43
44 .include "options.mk"
45
46 GNU_PLATFORM_DIR!=      ${.CURDIR}/../../mk/gnu-config/config.sub ${MACHINE_GNU_PLATFORM}
47 PLIST_SUBST+=           GNU_PLATFORM_DIR=${GNU_PLATFORM_DIR}
48
49 INFO_FILES=     yes
50 OCTAVE_DOC=     faq/Octave-FAQ.ps  liboctave/liboctave.ps \
51                 refcard/refcard-a4.ps refcard/refcard-legal.ps \
52                 refcard/refcard-letter.ps
53
54 INSTALLATION_DIRS+=     share/octave/${OCTAVE_VER}/doc
55 UNWRAP_FILES+=          mkoctfile octave-bug src/oct-conf.h
56
57 # Doesn't work yet, needs to sort out libtool shared libraries handling:
58 #TEST_TARGET=   check
59
60 pre-configure:
61         cd ${WRKSRC} && autoconf
62
63 post-extract:
64         find ${WRKSRC}/doc -type f -name '*.info*' -print | xargs rm -f
65         mkdir ${WRKSRC}/src/pic
66
67 # substitute in the real path to various bits of the toolchain because
68 # mkoctfile will be used potentially by users and it needs to point at the same
69 # compilers as were used in building octave.  We also fix up the path to sed
70 # otherwise we end up with the buildlink directory in mkoctfile
71 post-build:
72         mv ${WRKSRC}/mkoctfile ${WRKSRC}/mkoctfile.bak
73         sed     -e 's;"${CC}";"${CCPATH}";g' \
74                 -e 's;"${CXX}";"${CXXPATH}";g' \
75                 -e 's;"${FC}";"${FCPATH}";g' \
76                 -e 's@^:[ \t]*\$${SED=.*@: \$$\{SED="${SED}"\}@g' \
77                 ${WRKSRC}/mkoctfile.bak > ${WRKSRC}/mkoctfile
78         chmod a+x ${WRKSRC}/mkoctfile
79         (cd ${WRKSRC}/doc/interpreter && gmake octave.ps)
80
81 post-install:
82         cd ${WRKSRC}/doc/liboctave;                                     \
83         for f in liboctave.info liboctave.info-[0-9]*; do               \
84                 ${TEST} ! -f "$$f" ||                                   \
85                 ${INSTALL_DATA} "$$f" ${DESTDIR}${PREFIX}/${PKGINFODIR};                \
86         done
87 .for f in ${OCTAVE_DOC}
88         ${INSTALL_DATA} ${WRKSRC}/doc/${f} ${DESTDIR}${PREFIX}/share/octave/${OCTAVE_VER}/doc
89 .endfor
90
91 .include "../../audio/libsndfile/buildlink3.mk"
92 .include "../../devel/ncurses/buildlink3.mk"
93 .include "../../devel/readline/buildlink3.mk"
94 .include "../../devel/zlib/buildlink3.mk"
95 .include "../../math/blas/buildlink3.mk"
96 .include "../../math/fftw/buildlink3.mk"
97 .include "../../math/lapack/buildlink3.mk"
98 .include "../../www/curl/buildlink3.mk"
99 .include "../../x11/libX11/buildlink3.mk"
100
101 .include "../../sysutils/desktop-file-utils/desktopdb.mk"
102 .include "../../mk/bsd.pkg.mk"