source: trunk/dports/math/octave-devel/Portfile

Last change on this file was 153046, checked in by ram@…, 14 months ago

octave/octave-devel: fix build with Xcode8 (#52301)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 23.9 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 153046 2016-09-22 20:21:54Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           compilers  1.0
6PortGroup           muniversal 1.0
7PortGroup           active_variants 1.1
8PortGroup           compiler_blacklist_versions 1.0
9PortGroup           select     1.0
10
11name                octave-devel
12categories          math science
13platforms           darwin
14license             GPL-3+
15maintainers         mcalhoun openmaintainer
16description         a high-level language for numerical computations
17long_description    \
18    GNU Octave is a high-level language, primarily intended for numerical \
19    computations. It provides a convenient command-line interface for \
20    solving linear and nonlinear problems numerically.
21
22homepage            http://www.gnu.org/software/octave
23
24#fetch.type          hg
25#hg.url              http://hg.savannah.gnu.org/hgweb/octave/
26
27set version_release 4.0.2
28set version_rc      4.0.1-rc4
29set version_tip     4.1.0+
30
31if { ${name} eq ${subport} } {
32    version         ${version_tip}
33    revision        14
34    hg.tag          19e8eddd4773
35
36    # see http://savannah.gnu.org/bugs/?41027
37    patchfiles-append   \
38        octave-bug_41027-half.patch
39
40    # see http://savannah.gnu.org/bugs/index.php?47886
41    patchfiles-append   \
42        patch-configure.diff
43
44    checksums-append               \
45        ${hg.tag}${extract.suffix} \
46        rmd160  bf6d26b12fa1f0e2a8434a54ffa395c2b4e7f31e \
47        sha256  934b7f116018e3f8d97c7bbd2d213a77c823d934a4865155e24eac5cb42a636b
48
49    livecheck.regex   "<a href=\"/hgweb/octave/rev/(\[a-zA-Z0-9.\]+)\">\ntip"
50}
51
52subport octave-devel-rc {
53    version         ${version_rc}
54    revision        7
55    hg.tag          2b66f30a0de7
56
57    if {${version_rc} eq ${version_release}} {
58        conflicts-append octave-devel-release
59    }
60
61    # see http://savannah.gnu.org/bugs/?func=detailitem&item_id=46592
62    patchfiles-append \
63        patch-e870a68742a6.diff
64
65    # see http://savannah.gnu.org/bugs/?41027
66    patchfiles-append   \
67        octave-bug_41027.patch
68
69    checksums-append               \
70        ${hg.tag}${extract.suffix} \
71        rmd160  4bf919790f28f21752381e127cf55b3a5f4d7344 \
72        sha256  4785967cff091dddd7d82dbbd094658a39ad26d4a7219abc1f1bbc4fe696d43a
73
74    livecheck.regex   "<a href=\"/hgweb/octave/rev/(\[a-zA-Z0-9.\]+)\">\nrc-"
75}
76
77subport octave-devel-release {
78    version         ${version_release}
79    revision        3
80    hg.tag          acaf1e137c5e
81
82    if {${version_release} eq ${version_rc}} {
83        conflicts-append octave-devel-release
84    }
85
86    # see http://savannah.gnu.org/bugs/?func=detailitem&item_id=46592
87    patchfiles-append \
88        patch-e870a68742a6.diff
89
90    # see http://savannah.gnu.org/bugs/?41027
91    patchfiles-append   \
92        octave-bug_41027.patch
93
94    checksums-append               \
95        ${hg.tag}${extract.suffix} \
96        rmd160  454f0f6ef1657a49f9a41ff5bae03c09a332d77f \
97        sha256  3aafb5568bd46c1c6e6bae494cf8fdf457e8a84fea402b14a454e992c0885a8c
98
99    livecheck.regex   "<a href=\"/hgweb/octave/rev/(\[a-zA-Z0-9.\]+)\">\nrelease-"
100}
101
102# Block compilers: Some older versions of CLANG do not honor the CPATH
103# environment variables, which is required for compiling this port
104# when using MacPorts.  The versions seem to be: MacPorts CLANG 2.9 or
105# earlier, and Apple CLANG 318.0.58 or older.
106#
107# See also < http://llvm.org/bugs/show_bug.cgi?id=8971 >
108#          < https://trac.macports.org/ticket/40250 >.
109compiler.blacklist-append { clang <= 318.0.61 }
110
111select.group octave
112select.file  ${filespath}/${subport}
113
114# see ${worksrcpath}/.hgsubstate to find revision of gnulib-hg subrepository that should be used
115if { ${subport} eq "octave-devel-rc" || ${subport} eq "octave-devel-release" } {
116    set hg_gnu_tag      7f19e7f2afa2
117
118    checksums-append \
119        ${hg_gnu_tag}${extract.suffix} \
120        rmd160  9d906212fdb4201f8592da10524606dadb3f50e3 \
121        sha256  85add8ce0c53e8868d903c28c407d864ca54bd42e8d472e09b1a1bb4b105b741
122} else {
123    # check http://hg.savannah.gnu.org/hgweb/octave/gnulib-hg/rev for latest version
124    set hg_gnu_tag      4a3a7c6111c8
125
126    checksums-append \
127        ${hg_gnu_tag}${extract.suffix} \
128        rmd160  367b2811b5d4e3bab5ed22382c4ecfed808335e7 \
129        sha256  39f09d2000654d0d75a95b756fdd0724f869dfe65ef08f47814fbad230e8b25c
130}
131
132master_sites        http://hg.savannah.gnu.org/hgweb/octave/archive:octave \
133                    http://hg.savannah.gnu.org/hgweb/octave/gnulib-hg/archive:gnulib
134
135distfiles           \
136    ${hg.tag}${extract.suffix}:octave \
137    ${hg_gnu_tag}${extract.suffix}:gnulib
138
139worksrcdir          octave-${hg.tag}
140
141post-extract {
142    # mimic presence of mercurial subrepository
143    move ${worksrcpath}/../gnulib-hg-${hg_gnu_tag} ${worksrcpath}/gnulib-hg
144}
145
146pre-patch {
147    # code located in pre-patch because variants from PortGroup compilers must
148    #    be evaluated before it can be determined if clang is being used
149
150    # see http://trac.macports.org/ticket/45011
151    # see http://savannah.gnu.org/bugs/?43298
152    set libcxxbug no
153    if { ${configure.cc} eq "/usr/bin/clang" && [lindex [split ${xcodeversion} .] 0] eq 6 } {
154        set libcxxbug yes
155    } elseif { [variant_exists clang35] && [variant_isset clang35] } {
156        set libcxxbug yes
157    }
158    if { ${libcxxbug} } {
159        patchfiles-append   \
160            clang-libcxx-fix.patch
161    }
162
163    # see https://trac.macports.org/ticket/44704
164    set gl2psbug no
165    if { ${configure.cc} eq "/usr/bin/clang" && [vercmp ${xcodeversion} 5.0.0] < 0 } {
166        set gl2psbug yes
167    } elseif { [variant_exists clang33] && [variant_isset clang33] } {
168        set gl2psbug yes
169    }
170    if { ${gl2psbug} } {
171        patchfiles-append   patch-gl2ps_renderer.diff
172    }
173}
174
175# need for autoconf
176depends_build-append \
177    port:autoconf    \
178    port:automake    \
179    port:libtool
180
181use_autoconf         yes
182autoconf.cmd         ./bootstrap
183autoconf.args
184
185# avoid depends_build-append port:coreutils
186configure.env-append MKDIR_P="/bin/mkdir -p"
187
188# avoid depends_build-append port:cctools
189configure.env-append RANLIB=/usr/bin/ranlib
190
191# workaround for build failure with Xcode8 (#52301)
192configure.env-append "ac_cv_func_mkostemp=no"
193
194# main octave port lists as a depends_lib
195# configure.ac list it among the "[p]rograms used in Makefiles"
196depends_build-append port:gawk
197configure.awk ${prefix}/bin/gawk
198
199# in configure.ac, said to be "[p]rograms used to generate icons file formats
200depends_build-append \
201    port:icoutils    \
202    port:librsvg
203configure.env-append              \
204    ICOTOOL=${prefix}/bin/icotool \
205    RSVG_CONVERT=${prefix}/bin/rsvg-convert
206
207# main octave port lists as a depends_lib
208# configure.ac list it among the "[p]rograms used in Makefiles"
209depends_build-append port:grep
210configure.env-append  GREP=${prefix}/bin/grep
211configure.env-append EGREP=${prefix}/bin/egrep
212configure.env-append FGREP=${prefix}/bin/fgrep
213
214# configure.ac list it among the "[p]rograms used in Makefiles"
215depends_build-append port:findutils
216configure.env-append FIND=${prefix}/bin/gfind
217
218# main octave port lists as a depends_lib
219# configure.ac list it among the "[p]rograms used in Makefiles"
220depends_build-append port:gsed
221configure.env-append SED=${prefix}/bin/gsed
222
223depends_build-append port:flex
224configure.env-append LEX=${prefix}/bin/flex
225
226depends_build-append port:bison
227configure.env-append YACC="${prefix}/bin/bison -y"
228
229depends_build-append port:gperf
230configure.env-append GPERF=/usr/bin/gperf
231
232# configure.ac list it among the "[p]rograms used in Makefiles"
233depends_build-append port:perl5
234configure.perl ${prefix}/bin/perl5
235
236# avoid depends_build-append port:desktop-file-utils
237#configure.env-append DESKTOP_FILE_INSTALL=""
238configure.env-append ac_cv_prog_DESKTOP_FILE_INSTALL=""
239
240depends_build-append \
241    port:pkgconfig
242
243compilers.choose    fc f77 f90 cc cxx
244
245# for now, limit the number of variants
246# some of these compilers may work fine
247compilers.setup     \
248    require_fortran \
249    -dragonegg      \
250    -gcc49          \
251    -gcc48          \
252    -gcc47          \
253    -gcc46          \
254    -gcc45          \
255    -gcc44          \
256    -g95            \
257    -llvm           \
258    -clang36        \
259    -clang35        \
260    -clang34        \
261    -clang33
262
263# help prevent conflicts with various octave ports
264configure.args-append \
265    --infodir=${prefix}/share/info/octave_${version}
266
267# offscreen rendering with OpenGL via osmesa would be nice to have, but the following
268#    causes a segmentation fault:
269#    h = figure ("visible", "off"); fn = tempname (); sombrero (); __osmesa_print__ (h, fn, "svg");
270#
271# solution is ???
272#
273#depends_lib-append port:mesa
274configure.args-append       \
275    --without-OSMesa
276
277#configure.args-append --with-shell=???
278
279configure.args-append       \
280    --with-framework-carbon \
281    --without-x             \
282    --enable-static
283
284configure.args-append       \
285    --disable-openmp
286
287configure.args-append       \
288    --disable-java          \
289    --without-fltk          \
290    --without-opengl        \
291    --disable-jit           \
292    --without-sndfile       \
293    --without-portaudio     \
294    --without-magick        \
295    --disable-docs
296
297if { ${subport} eq "octave-devel-rc" || ${subport} eq "octave-devel-release" } {
298    configure.args-append       \
299        --disable-gui
300} else {
301    configure.args-append       \
302        --without-qt
303}
304
305# in configure.ac, listed as one of "[p]rograms used when running Octave"
306depends_lib-append port:python27
307configure.python ${prefix}/bin/python2.7
308
309# in configure.ac, listed as one of "[p]rograms used when running Octave"
310depends_lib-append port:ghostscript
311configure.env-append GHOSTSCRIPT=${prefix}/bin/gs
312
313# in configure.ac, listed as one of "[p]rograms used when running Octave"
314depends_lib-append port:gnuplot
315configure.env-append GNUPLOT=${prefix}/bin/gnuplot
316
317# in configure.ac, listed as one of "[p]rograms used when running Octave"
318depends_lib-append port:less
319configure.env-append DEFAULT_PAGER=${prefix}/bin/less
320
321depends_lib-append   port:ncurses
322depends_lib-append   port:readline
323depends_lib-append   port:pcre
324
325#--without-amd
326#--without-camd
327#--without-colamd
328#--without-cholmod
329#--without-cxsparse
330#--without-umfpack
331depends_lib-append  port:SuiteSparse
332foreach lib {amd camd colamd cholmod cxsparse umfpack} {
333    configure.args-append \
334        --with-${lib}="-l${lib} -lsuitesparseconfig"
335}
336
337#--without-qhull
338depends_lib-append  port:qhull
339
340#--without-z
341depends_lib-append  port:zlib
342
343#--without-hdf5
344if { ${name} eq ${subport} } {
345    # see #51080
346    # see http://savannah.gnu.org/bugs/?47858 for upstream report
347    depends_lib-append  port:hdf5-18
348    configure.args-append \
349        --with-hdf5-libdir=${prefix}/lib/hdf5-18/lib \
350        --with-hdf5-includedir=${prefix}/lib/hdf5-18/include
351} else {
352    depends_lib-append  port:hdf5
353}
354
355#--disable-fftw-threads
356#--without-fftw3
357#--without-fftw3f
358depends_lib-append  port:fftw-3
359depends_lib-append  port:fftw-3-single
360
361#--without-glpk
362depends_lib-append  port:glpk
363
364#--without-curl
365depends_lib-append  port:curl
366
367#--without-qrupdate
368depends_lib-append port:qrupdate
369
370#--without-arpack
371depends_lib-append port:arpack
372
373#--without-openssl
374depends_lib-append port:openssl
375
376# fortran arch flag is not set automatically
377if {![variant_isset universal]} {
378    if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} {
379        configure.fflags-append -m64
380    } else {
381        configure.fflags-append -m32
382    }
383}
384
385# see etc/README.MacOS
386depends_run-append   \
387    port:epstool     \
388    port:ghostscript \
389    port:transfig    \
390    port:pstoedit
391
392depends_run-append port:octave_select
393
394variant accelerate description {use BLAS from Apple's Accelerate.framework} conflicts atlas openblas {
395    depends_lib-append port:vecLibFort
396
397    configure.args-append        \
398        --with-blas=-lvecLibFort \
399        --with-lapack=""
400}
401
402variant openblas description {use BLAS from MacPorts' openblas port} conflicts atlas accelerate {
403
404    depends_lib-append path:lib/libopenblas.dylib:OpenBLAS
405    # LAPACK required
406    require_active_variants path:lib/libopenblas.dylib:OpenBLAS lapack
407
408    # replicate default values if configure script finds openblas on its own
409    configure.args-append        \
410        --with-blas=-lopenblas   \
411        --with-lapack=""
412}
413
414variant atlas description {use BLAS from MacPorts' atlas port} conflicts accelerate openblas {
415    depends_lib-append port:atlas
416
417    # replicate default values if configure script finds atlas on its own
418    configure.args-append        \
419        --with-blas="-lcblas -lf77blas -latlas" \
420        --with-lapack=-llapack
421}
422
423if {![variant_isset accelerate] && ![variant_isset openblas] && ![variant_isset atlas] } {
424    default_variants-append +accelerate
425}
426
427if {![variant_isset accelerate] && ![variant_isset openblas] && ![variant_isset atlas] } {
428    ui_error "\n\nYou must select either the +accelerate, +atlas, or +openblas variant.\n"
429    return -code error "Invalid variant selection"
430}
431
432variant java description {enable Java interface} {
433    PortGroup java 1.0
434    configure.args-replace --disable-java --enable-java
435}
436# java variant seems to cause problems for both users and build bots
437#    https://lists.macosforge.org/pipermail/macports-users/2016-May/thread.html#41052
438#    #51480
439#default_variants-append +java
440
441variant qt4gui description {build the GUI using Qt4} {
442    PortGroup qt4 1.0
443    depends_lib-append  port:qscintilla
444
445    if { ${subport} eq "octave-devel-rc" || ${subport} eq "octave-devel-release" } {
446        configure.args-replace --disable-gui --enable-gui
447    } else {
448        configure.args-replace --without-qt --with-qt
449    }
450}
451default_variants-append +qt4gui
452
453variant fltk description {enable fltk as a graphics toolkit for plotting} {
454    depends_lib-append path:lib/libfltk.dylib:fltk
455
456    configure.args-replace --without-fltk --with-fltk
457}
458default_variants-append +fltk
459
460if {[variant_isset fltk] || [variant_isset qt4gui]} {
461
462    # native_graphics (fltk) and gui (Qt) require OpenGL and font and printing capabilities
463    depends_lib-append  \
464        port:fontconfig \
465        port:freetype   \
466        port:gl2ps
467
468    configure.args-replace --without-opengl --with-framework-opengl
469}
470
471if {[variant_isset fltk] && [variant_isset qt4gui]} {
472    notes-append "unless octave is run with --no-gui-libs, graphics_toolkit(\"fltk\") will cause a crash"
473}
474
475variant jit description {enable JIT compiler (EXPERIMENTAL)} {
476    # JIT requires LLVM, so select a version to use
477    set llvm_ver 3.8
478
479    # prevent multiple versions of llvm being required
480    # if clangXY compiler is requested, use llvm-X.Y
481    foreach clang ${compilers.clang_variants} {
482        if { [variant_exists ${clang}] && [variant_isset ${clang}] } {
483            set llvm_ver [string index ${clang} end-1].[string index ${clang} end]
484        }
485    }
486
487    depends_lib-append port:llvm-${llvm_ver}
488    configure.args-replace --disable-jit --enable-jit
489    configure.env-append LLVM_CONFIG=${prefix}/bin/llvm-config-mp-${llvm_ver}
490    configure.cxxflags-append -std=c++11
491}
492
493variant sound description {enable audio support (file I/O and playback)} {
494    depends_lib-append port:libsndfile
495    depends_lib-append port:portaudio
496
497    configure.args-replace --without-sndfile   --with-sndfile
498    configure.args-replace --without-portaudio --with-portaudio
499}
500default_variants-append +sound
501
502variant app description "build application bundle to launch ${subport}" {
503    depends_build-append port:ImageMagick
504
505    if {[vercmp ${xcodeversion} 4.5] < 0} {
506        # need a way to generate icns file for XCode prior to 4.5
507        # see #51487
508        depends_build-append port:libicns
509    }
510
511    global appName
512    set appName Octave_${version}.app
513
514    post-build {
515        xinstall -d -m 0755 ${worksrcpath}/${appName}/Contents
516        xinstall -d -m 0755 ${worksrcpath}/${appName}/Contents/Resources
517        xinstall -d -m 0755 ${worksrcpath}/${appName}/Contents/MacOS
518
519        set script [open "${worksrcpath}/${appName}/Contents/MacOS/Octave" w 0755]
520        if { [variant_isset qt4gui] } {
521            puts ${script} "#!/bin/sh"
522            puts ${script} ""
523            puts ${script} "${prefix}/bin/octave-${version} --force-gui"
524        } else {
525            puts ${script} "#!/usr/bin/osascript"
526            puts ${script} ""
527            puts ${script} "tell application \"Terminal\" to do script \"${prefix}/bin/octave-${version} --no-gui-libs; exit\""
528        }
529        close ${script}
530
531        #NSHumanReadableCopyright      ''
532        #LSUIElement                   1
533        set values "
534            CFBundleDevelopmentRegion                         string  English
535            CFBundleExecutable                                string  Octave
536            CFBundleIconFile                                  string  Octave.icns
537            CFBundleIdentifier                                string  org.octave.Octave
538            CFBundleInfoDictionaryVersion                     string  6.0
539            CFBundleSignature                                 string  Octave
540            CFBundleVersion                                   string  ${version}
541            CFBundleShortVersionString                        string  ${version}
542            CFBundleDocumentTypes                             array   {}
543            CFBundleDocumentTypes:                            dict    {}
544            CFBundleDocumentTypes:0:CFBundleTypeRole          string  \"Editor\"
545            CFBundleDocumentTypes:0:CFBundleTypeExtensions    array   {}
546            CFBundleDocumentTypes:0:CFBundleTypeExtensions:   string  \"m\"
547            CFBundleDocumentTypes:0:CFBundleTypeOSTypes       array   {}
548            CFBundleDocumentTypes:0:CFBundleTypeOSTypes:      string  \"Mfile\"
549        "
550
551        foreach {key type value} ${values} {
552            system -W "${worksrcpath}/${appName}/Contents" "/usr/libexec/PlistBuddy -c \"Add :${key} ${type} ${value}\" Info.plist"
553        }
554
555        # have Info.plist be human readable
556        system "/usr/bin/plutil -convert xml1 ${worksrcpath}/${appName}/Contents/Info.plist"
557
558        # conversion by plutil set verys limited permissions
559        system "/bin/chmod 0644 ${worksrcpath}/${appName}/Contents/Info.plist"
560
561        xinstall -d -m 0755 ${worksrcpath}/Octave.iconset
562
563        # values from original SVG file
564        set svg    etc/icons/octave-logo.svg
565        set width  283.28912
566        set height 283.28833
567        set dpi    90
568
569        foreach res {16 32 128 256 512} {
570
571            set hres [expr 2*${res}]
572
573            # find new density so that converted PNG files do not look pixelated
574            set denw  [expr ${dpi}*${res}/${width}]
575            set denh  [expr ${dpi}*${res}/${height}]
576
577            set hdenw [expr 2*${denw}]
578            set hdenh [expr 2*${denh}]
579
580            system -W ${worksrcpath} "${prefix}/bin/convert -background transparent -resize ${res}x${res}   -density ${denw}x${denh}   ${svg} Octave.iconset/icon_${res}x${res}.png"
581            system -W ${worksrcpath} "${prefix}/bin/convert -background transparent -resize ${hres}x${hres} -density ${hdenw}x${hdenh} ${svg} Octave.iconset/icon_${res}x${res}@2x.png"
582        }
583
584        if {[vercmp ${xcodeversion} 4.5] >= 0} {
585            system -W ${worksrcpath} "/usr/bin/iconutil -c icns -o ${appName}/Contents/Resources/Octave.icns Octave.iconset"
586        } else {
587            # /usr/bin/iconutil introduced in XCode 4.5
588            # see #51487
589            system -W ${worksrcpath}/Octave.iconset \
590                "${prefix}/bin/png2icns ${worksrcpath}/${appName}/Contents/Resources/Octave.icns icon_16x16.png icon_32x32.png icon_128x128.png icon_256x256.png icon_512x512.png"
591        }
592    }
593
594    post-destroot {
595        copy ${worksrcpath}/${appName} ${destroot}${applications_dir}
596    }
597}
598default_variants-append +app
599
600variant docs description {build documentation files} {
601    depends_build-append port:texinfo
602    configure.env-append                \
603        MAKEINFO=${prefix}/bin/makeinfo \
604        TEXI2DVI=${prefix}/bin/texi2dvi \
605        TEXI2PDF=${prefix}/bin/texi2pdf
606
607    # see https://lists.macosforge.org/pipermail/macports-dev/2016-January/032293.html
608    depends_build-append \
609        port:texlive-basic \
610        port:texlive-latex
611
612    # see #51132
613    depends_build-append \
614        port:texlive-fonts-recommended
615
616    configure.args-replace --disable-docs --enable-docs
617}
618default_variants-append +docs
619
620# GraphicsMagick and octave need to be built with the same C++ standard library
621# or else undefined symbols:
622#    "Magick::Image::ping(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)"
623set magickConflict {}
624set magickDefault yes
625if {${configure.cxx_stdlib} ne "libstdc++"} {
626    foreach gccVar ${compilers.gcc_variants} {
627        if {[variant_exists ${gccVar}] } {
628            lappend magickConflict ${gccVar}
629
630            if {[variant_isset ${gccVar}] } {
631                set magickDefault no
632            }
633        }
634    }
635}
636eval "variant graphicsmagick description {use GraphicsMagick for image I/O} conflicts ${magickConflict} {
637    depends_lib-append port:GraphicsMagick
638    configure.args-replace --without-magick --with-magick=GraphicsMagick
639}"
640if {${magickDefault}} {
641    default_variants-append +graphicsmagick
642}
643
644if { ${subport} eq "octave-devel-rc" || ${subport} eq "octave-devel-release" } {
645    # remove architecture flags from header file
646    if { [variant_exists universal] && [variant_isset universal] } {
647        merger-post-destroot {
648            foreach arch ${universal_archs_to_use} {
649                set hfile ${destroot}-${arch}${prefix}/include/octave-${version}/octave/oct-conf.h
650                reinplace -E "s:\\w*-arch ${arch}::g" ${hfile}
651                reinplace -E {s:\\w*-m32::g}          ${hfile}
652                reinplace -E {s:\\w*-m64::g}          ${hfile}
653            }
654        }
655    } else {
656        post-destroot {
657            set hfile ${destroot}${prefix}/include/octave-${version}/octave/oct-conf.h
658            reinplace -E "s:\\w*-arch ${build_arch}::g" ${hfile}
659            reinplace -E {s:\\w*-m32::g}                ${hfile}
660            reinplace -E {s:\\w*-m64::g}                ${hfile}
661        }
662    }
663}
664
665# remove or rename conflicting files
666post-destroot {
667    foreach bin {mkoctfile octave octave-cli octave-config} {
668        # delete since just a link to versioned name
669        file delete ${destroot}${prefix}/bin/${bin}
670
671        if { [variant_isset docs] } {
672            # put version number in man file to avoid conflict
673            move ${destroot}${prefix}/share/man/man1/${bin}.1 ${destroot}${prefix}/share/man/man1/${bin}-${version}.1
674        }
675    }
676
677    # put any startup commands in ${destroot}${prefix}/share/octave/${version}/m/startup/octaverc
678    # see https://www.gnu.org/software/octave/doc/interpreter/Startup-Files.html
679    file delete ${destroot}${prefix}/share/octave/site/m/startup/octaverc
680
681    # move appdata and icons into a versioned directory
682    xinstall -d -m 0755 ${destroot}${prefix}/share/octave/${version}/appdata
683    move \
684        ${destroot}${prefix}/share/appdata/www.octave.org-octave.appdata.xml \
685        ${destroot}${prefix}/share/octave/${version}/appdata/
686    foreach num {16 22 24 32 48 64 128 256 512} {
687        xinstall -d -m 0755 ${destroot}${prefix}/share/octave/${version}/icons/hicolor/${num}x${num}/apps
688        move \
689            ${destroot}${prefix}/share/icons/hicolor/${num}x${num}/apps/octave.png \
690            ${destroot}${prefix}/share/octave/${version}/icons/hicolor/${num}x${num}/apps/octave.png
691    }
692    xinstall -d -m 0755 ${destroot}${prefix}/share/octave/${version}/icons/hicolor/scalable/apps
693    move \
694        ${destroot}${prefix}/share/icons/hicolor/scalable/apps/octave.svg \
695        ${destroot}${prefix}/share/octave/${version}/icons/hicolor/scalable/apps/octave.svg
696
697    if {[file exists ${worksrcpath}/liboctave/operators/libcxx-fix.h]} {
698        # install the libc++ fix, no matter if used or not, since it is
699        # required for projects including these headers.
700        xinstall -m 644 ${worksrcpath}/liboctave/operators/libcxx-fix.h \
701            ${destroot}${prefix}/include/${name}-${version}/${name}/libcxx-fix.h
702    }
703}
704
705test.run    yes
706test.target check
707
708livecheck.type    regexm
709livecheck.url     http://hg.savannah.gnu.org/hgweb/octave/tags
710livecheck.version ${hg.tag}
Note: See TracBrowser for help on using the repository browser.