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

Last change on this file since 149057 was 149057, checked in by mcalhoun@…, 3 years ago

octave family: generate icons with XCode prior to 4.5 (#51487)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 23.1 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 149057 2016-05-27 12:30:37Z mcalhoun@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        13
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# main octave port lists as a depends_lib
192# configure.ac list it among the "[p]rograms used in Makefiles"
193depends_build-append port:gawk
194configure.awk ${prefix}/bin/gawk
195
196# in configure.ac, said to be "[p]rograms used to generate icons file formats
197depends_build-append \
198    port:icoutils    \
199    port:librsvg
200configure.env-append              \
201    ICOTOOL=${prefix}/bin/icotool \
202    RSVG_CONVERT=${prefix}/bin/rsvg-convert
203
204# main octave port lists as a depends_lib
205# configure.ac list it among the "[p]rograms used in Makefiles"
206depends_build-append port:grep
207configure.env-append  GREP=${prefix}/bin/grep
208configure.env-append EGREP=${prefix}/bin/egrep
209configure.env-append FGREP=${prefix}/bin/fgrep
210
211# configure.ac list it among the "[p]rograms used in Makefiles"
212depends_build-append port:findutils
213configure.env-append FIND=${prefix}/bin/gfind
214
215# main octave port lists as a depends_lib
216# configure.ac list it among the "[p]rograms used in Makefiles"
217depends_build-append port:gsed
218configure.env-append SED=${prefix}/bin/gsed
219
220depends_build-append port:flex
221configure.env-append LEX=${prefix}/bin/flex
222
223depends_build-append port:bison
224configure.env-append YACC="${prefix}/bin/bison -y"
225
226depends_build-append port:gperf
227configure.env-append GPERF=/usr/bin/gperf
228
229# configure.ac list it among the "[p]rograms used in Makefiles"
230depends_build-append port:perl5
231configure.perl ${prefix}/bin/perl5
232
233# avoid depends_build-append port:desktop-file-utils
234#configure.env-append DESKTOP_FILE_INSTALL=""
235configure.env-append ac_cv_prog_DESKTOP_FILE_INSTALL=""
236
237depends_build-append \
238    port:pkgconfig
239
240compilers.choose    fc f77 f90 cc cxx
241
242# for now, limit the number of variants
243# some of these compilers may work fine
244compilers.setup     \
245    require_fortran \
246    -dragonegg      \
247    -gcc49          \
248    -gcc48          \
249    -gcc47          \
250    -gcc46          \
251    -gcc45          \
252    -gcc44          \
253    -g95            \
254    -llvm           \
255    -clang36        \
256    -clang35        \
257    -clang34        \
258    -clang33
259
260# help prevent conflicts with various octave ports
261configure.args-append \
262    --infodir=${prefix}/share/info/octave_${version}
263
264# offscreen rendering with OpenGL via osmesa would be nice to have, but the following
265#    causes a segmentation fault:
266#    h = figure ("visible", "off"); fn = tempname (); sombrero (); __osmesa_print__ (h, fn, "svg");
267#
268# solution is ???
269#
270#depends_lib-append port:mesa
271configure.args-append       \
272    --without-OSMesa
273
274#configure.args-append --with-shell=???
275
276configure.args-append       \
277    --with-framework-carbon \
278    --without-x             \
279    --enable-static
280
281configure.args-append       \
282    --disable-openmp
283
284configure.args-append       \
285    --disable-java          \
286    --without-fltk          \
287    --without-opengl        \
288    --disable-jit           \
289    --without-sndfile       \
290    --without-portaudio     \
291    --without-magick        \
292    --disable-docs
293
294if { ${subport} eq "octave-devel-rc" || ${subport} eq "octave-devel-release" } {
295    configure.args-append       \
296        --disable-gui
297} else {
298    configure.args-append       \
299        --without-qt
300}
301
302# in configure.ac, listed as one of "[p]rograms used when running Octave"
303depends_lib-append port:python27
304configure.python ${prefix}/bin/python2.7
305
306# in configure.ac, listed as one of "[p]rograms used when running Octave"
307depends_lib-append port:ghostscript
308configure.env-append GHOSTSCRIPT=${prefix}/bin/gs
309
310# in configure.ac, listed as one of "[p]rograms used when running Octave"
311depends_lib-append port:gnuplot
312configure.env-append GNUPLOT=${prefix}/bin/gnuplot
313
314# in configure.ac, listed as one of "[p]rograms used when running Octave"
315depends_lib-append port:less
316configure.env-append DEFAULT_PAGER=${prefix}/bin/less
317
318depends_lib-append   port:ncurses
319depends_lib-append   port:readline
320depends_lib-append   port:pcre
321
322#--without-amd
323#--without-camd
324#--without-colamd
325#--without-cholmod
326#--without-cxsparse
327#--without-umfpack
328depends_lib-append  port:SuiteSparse
329foreach lib {amd camd colamd cholmod cxsparse umfpack} {
330    configure.args-append \
331        --with-${lib}="-l${lib} -lsuitesparseconfig"
332}
333
334#--without-qhull
335depends_lib-append  port:qhull
336
337#--without-z
338depends_lib-append  port:zlib
339
340#--without-hdf5
341if { ${name} eq ${subport} } {
342    # see #51080
343    depends_lib-append  port:hdf5-18
344    configure.args-append \
345        --with-hdf5-libdir=${prefix}/lib/hdf5-18 \
346        --with-hdf5-includedir=${prefix}/include/hdf5-18
347} else {
348    depends_lib-append  port:hdf5
349}
350
351#--disable-fftw-threads
352#--without-fftw3
353#--without-fftw3f
354depends_lib-append  port:fftw-3
355depends_lib-append  port:fftw-3-single
356
357#--without-glpk
358depends_lib-append  port:glpk
359
360#--without-curl
361depends_lib-append  port:curl
362
363#--without-qrupdate
364depends_lib-append port:qrupdate
365
366#--without-arpack
367depends_lib-append port:arpack
368
369#--without-openssl
370depends_lib-append port:openssl
371
372# fortran arch flag is not set automatically
373if {![variant_isset universal]} {
374    if {${build_arch} eq "x86_64" || ${build_arch} eq "ppc64"} {
375        configure.fflags-append -m64
376    } else {
377        configure.fflags-append -m32
378    }
379}
380
381# see etc/README.MacOS
382depends_run-append   \
383    port:epstool     \
384    port:ghostscript \
385    port:transfig    \
386    port:pstoedit
387
388depends_run-append port:octave_select
389
390variant accelerate description {use BLAS from Apple's Accelerate.framework} conflicts atlas openblas {
391    depends_lib-append port:vecLibFort
392
393    configure.args-append        \
394        --with-blas=-lvecLibFort \
395        --with-lapack=""
396}
397
398variant openblas description {use BLAS from MacPorts' openblas port} conflicts atlas accelerate {
399
400    depends_lib-append path:lib/libopenblas.dylib:OpenBLAS
401    # LAPACK required
402    require_active_variants path:lib/libopenblas.dylib:OpenBLAS lapack
403
404    # replicate default values if configure script finds openblas on its own
405    configure.args-append        \
406        --with-blas=-lopenblas   \
407        --with-lapack=""
408}
409
410variant atlas description {use BLAS from MacPorts' atlas port} conflicts accelerate openblas {
411    depends_lib-append port:atlas
412
413    # replicate default values if configure script finds atlas on its own
414    configure.args-append        \
415        --with-blas="-lcblas -lf77blas -latlas" \
416        --with-lapack=-llapack
417}
418
419if {![variant_isset accelerate] && ![variant_isset openblas] && ![variant_isset atlas] } {
420    default_variants-append +accelerate
421}
422
423if {![variant_isset accelerate] && ![variant_isset openblas] && ![variant_isset atlas] } {
424    ui_error "\n\nYou must select either the +accelerate, +atlas, or +openblas variant.\n"
425    return -code error "Invalid variant selection"
426}
427
428variant java description {enable Java interface} {
429    PortGroup java 1.0
430    configure.args-replace --disable-java --enable-java
431}
432# java variant seems to cause problems for both users and build bots
433#    https://lists.macosforge.org/pipermail/macports-users/2016-May/thread.html#41052
434#    #51480
435#default_variants-append +java
436
437variant qt4gui description {build the GUI using Qt4} {
438    PortGroup qt4 1.0
439    depends_lib-append  port:qscintilla
440
441    if { ${subport} eq "octave-devel-rc" || ${subport} eq "octave-devel-release" } {
442        configure.args-replace --disable-gui --enable-gui
443    } else {
444        configure.args-replace --without-qt --with-qt
445    }
446}
447default_variants-append +qt4gui
448
449variant fltk description {enable fltk as a graphics toolkit for plotting} {
450    depends_lib-append path:lib/libfltk.dylib:fltk
451
452    configure.args-replace --without-fltk --with-fltk
453}
454default_variants-append +fltk
455
456if {[variant_isset fltk] || [variant_isset qt4gui]} {
457
458    # native_graphics (fltk) and gui (Qt) require OpenGL and font and printing capabilities
459    depends_lib-append  \
460        port:fontconfig \
461        port:freetype   \
462        port:gl2ps
463
464    configure.args-replace --without-opengl --with-framework-opengl
465}
466
467if {[variant_isset fltk] && [variant_isset qt4gui]} {
468    notes-append "unless octave is run with --no-gui-libs, graphics_toolkit(\"fltk\") will cause a crash"
469}
470
471variant jit description {enable JIT compiler (EXPERIMENTAL)} {
472    # JIT requires LLVM, so select a version to use
473    set llvm_ver 3.8
474
475    # prevent multiple versions of llvm being required
476    # if clangXY compiler is requested, use llvm-X.Y
477    foreach clang ${compilers.clang_variants} {
478        if { [variant_exists ${clang}] && [variant_isset ${clang}] } {
479            set llvm_ver [string index ${clang} end-1].[string index ${clang} end]
480        }
481    }
482
483    depends_lib-append port:llvm-${llvm_ver}
484    configure.args-replace --disable-jit --enable-jit
485    configure.env-append LLVM_CONFIG=${prefix}/bin/llvm-config-mp-${llvm_ver}
486    configure.cxxflags-append -std=c++11
487}
488
489variant sound description {enable audio support (file I/O and playback)} {
490    depends_lib-append port:libsndfile
491    depends_lib-append port:portaudio
492
493    configure.args-replace --without-sndfile   --with-sndfile
494    configure.args-replace --without-portaudio --with-portaudio
495}
496default_variants-append +sound
497
498variant app description "build application bundle to launch ${subport}" {
499    depends_build-append port:ImageMagick
500
501    if {[vercmp ${xcodeversion} 4.5] < 0} {
502        # need a way to generate icns file for XCode prior to 4.5
503        # see #51487
504        depends_build-append port:libicns
505    }
506
507    global appName
508    set appName Octave_${version}.app
509
510    post-build {
511        xinstall -d -p -m 0755 ${worksrcpath}/${appName}/Contents
512        xinstall -d -p -m 0755 ${worksrcpath}/${appName}/Contents/Resources
513        xinstall -d -p -m 0755 ${worksrcpath}/${appName}/Contents/MacOS
514
515        set script [open "${worksrcpath}/${appName}/Contents/MacOS/Octave" w 0755]
516        if { [variant_isset qt4gui] } {
517            puts ${script} "#!/bin/sh"
518            puts ${script} ""
519            puts ${script} "${prefix}/bin/octave-${version} --force-gui"
520        } else {
521            puts ${script} "#!/usr/bin/osascript"
522            puts ${script} ""
523            puts ${script} "tell application \"Terminal\" to do script \"${prefix}/bin/octave-${version} --no-gui-libs; exit\""
524        }
525        close ${script}
526
527        #NSHumanReadableCopyright      ''
528        #LSUIElement                   1
529        set values "
530            CFBundleDevelopmentRegion     English
531            CFBundleExecutable            Octave
532            CFBundleIconFile              Octave.icns
533            CFBundleDocumentTypes         {-array \'{\"CFBundleTypeExtensions\" = (\"m\"); \"CFBundleTypeOSTypes\" = (\"Mfile\"); \"CFBundleTypeRole\" = \"Editor\";}\'}
534            CFBundleIdentifier            org.octave.Octave
535            CFBundleInfoDictionaryVersion 6.0
536            CFBundleSignature             Octave
537            CFBundleVersion               ${version}
538            CFBundleShortVersionString    ${version}
539        "
540        foreach {key value} ${values} {
541            system "/usr/bin/defaults write ${worksrcpath}/${appName}/Contents/Info ${key} ${value}"
542        }
543
544        # have Info.plist be human readable
545        system "/usr/bin/plutil -convert xml1 ${worksrcpath}/${appName}/Contents/Info.plist"
546
547        # conversion by plutil set verys limited permissions
548        system "/bin/chmod 0644 ${worksrcpath}/${appName}/Contents/Info.plist"
549
550        xinstall -d -m 0755 ${worksrcpath}/Octave.iconset
551
552        # values from original SVG file
553        set svg    etc/icons/octave-logo.svg
554        set width  283.28912
555        set height 283.28833
556        set dpi    90
557
558        foreach res {16 32 128 256 512} {
559
560            set hres [expr 2*${res}]
561
562            # find new density so that converted PNG files do not look pixelated
563            set denw  [expr ${dpi}*${res}/${width}]
564            set denh  [expr ${dpi}*${res}/${height}]
565
566            set hdenw [expr 2*${denw}]
567            set hdenh [expr 2*${denh}]
568
569            system -W ${worksrcpath} "${prefix}/bin/convert -background transparent -resize ${res}x${res}   -density ${denw}x${denh}   ${svg} Octave.iconset/icon_${res}x${res}.png"
570            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"
571        }
572
573        if {[vercmp ${xcodeversion} 4.5] >= 0} {
574            system -W ${worksrcpath} "/usr/bin/iconutil -c icns -o ${appName}/Contents/Resources/Octave.icns Octave.iconset"
575        } else {
576            # /usr/bin/iconutil introduced in XCode 4.5
577            # see #51487
578            system -W ${worksrcpath}/Octave.iconset \
579                "${prefix}/bin/png2icns ${worksrcpath}/${appName}/Contents/Resources/Octave.icns icon_16x16.png icon_32x32.png icon_128x128.png icon_256x256.png icon_512x512.png"
580        }
581    }
582
583    post-destroot {
584        copy ${worksrcpath}/${appName} ${destroot}${applications_dir}
585    }
586}
587default_variants-append +app
588
589variant docs description {build documentation files} {
590    depends_build-append port:texinfo
591    configure.env-append                \
592        MAKEINFO=${prefix}/bin/makeinfo \
593        TEXI2DVI=${prefix}/bin/texi2dvi \
594        TEXI2PDF=${prefix}/bin/texi2pdf
595
596    # see https://lists.macosforge.org/pipermail/macports-dev/2016-January/032293.html
597    depends_build-append \
598        port:texlive-basic \
599        port:texlive-latex
600
601    # see #51132
602    depends_build-append \
603        port:texlive-fonts-recommended
604
605    configure.args-replace --disable-docs --enable-docs
606}
607default_variants-append +docs
608
609# GraphicsMagick and octave need to be built with the same C++ standard library
610# or else undefined symbols:
611#    "Magick::Image::ping(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)"
612set magickConflict {}
613set magickDefault yes
614if {${configure.cxx_stdlib} ne "libstdc++"} {
615    foreach gccVar ${compilers.gcc_variants} {
616        if {[variant_exists ${gccVar}] } {
617            lappend magickConflict ${gccVar}
618
619            if {[variant_isset ${gccVar}] } {
620                set magickDefault no
621            }
622        }
623    }
624}
625eval "variant graphicsmagick description {use GraphicsMagick for image I/O} conflicts ${magickConflict} {
626    depends_lib-append port:GraphicsMagick
627    configure.args-replace --without-magick --with-magick=GraphicsMagick
628}"
629if {${magickDefault}} {
630    default_variants-append +graphicsmagick
631}
632
633if { ${subport} eq "octave-devel-rc" || ${subport} eq "octave-devel-release" } {
634    # remove architecture flags from header file
635    if { [variant_exists universal] && [variant_isset universal] } {
636        merger-post-destroot {
637            foreach arch ${universal_archs_to_use} {
638                set hfile ${destroot}-${arch}${prefix}/include/octave-${version}/octave/oct-conf.h
639                reinplace -E "s:\\w*-arch ${arch}::g" ${hfile}
640                reinplace -E {s:\\w*-m32::g}          ${hfile}
641                reinplace -E {s:\\w*-m64::g}          ${hfile}
642            }
643        }
644    } else {
645        post-destroot {
646            set hfile ${destroot}${prefix}/include/octave-${version}/octave/oct-conf.h
647            reinplace -E "s:\\w*-arch ${build_arch}::g" ${hfile}
648            reinplace -E {s:\\w*-m32::g}                ${hfile}
649            reinplace -E {s:\\w*-m64::g}                ${hfile}
650        }
651    }
652}
653
654# remove or rename conflicting files
655post-destroot {
656    foreach bin {mkoctfile octave octave-cli octave-config} {
657        # delete since just a link to versioned name
658        file delete ${destroot}${prefix}/bin/${bin}
659
660        if { [variant_isset docs] } {
661            # put version number in man file to avoid conflict
662            move ${destroot}${prefix}/share/man/man1/${bin}.1 ${destroot}${prefix}/share/man/man1/${bin}-${version}.1
663        }
664    }
665
666    # put any startup commands in ${destroot}${prefix}/share/octave/${version}/m/startup/octaverc
667    # see https://www.gnu.org/software/octave/doc/interpreter/Startup-Files.html
668    file delete ${destroot}${prefix}/share/octave/site/m/startup/octaverc
669
670    # move appdata and icons into a versioned directory
671    xinstall -d -m 0755 ${destroot}${prefix}/share/octave/${version}/appdata
672    move \
673        ${destroot}${prefix}/share/appdata/www.octave.org-octave.appdata.xml \
674        ${destroot}${prefix}/share/octave/${version}/appdata/
675    foreach num {16 22 24 32 48 64 128 256 512} {
676        xinstall -d -m 0755 -p ${destroot}${prefix}/share/octave/${version}/icons/hicolor/${num}x${num}/apps
677        move \
678            ${destroot}${prefix}/share/icons/hicolor/${num}x${num}/apps/octave.png \
679            ${destroot}${prefix}/share/octave/${version}/icons/hicolor/${num}x${num}/apps/octave.png
680    }
681    xinstall -d -m 0755 -p ${destroot}${prefix}/share/octave/${version}/icons/hicolor/scalable/apps
682    move \
683        ${destroot}${prefix}/share/icons/hicolor/scalable/apps/octave.svg \
684        ${destroot}${prefix}/share/octave/${version}/icons/hicolor/scalable/apps/octave.svg
685
686    if {[file exists ${worksrcpath}/liboctave/operators/libcxx-fix.h]} {
687        # install the libc++ fix, no matter if used or not, since it is
688        # required for projects including these headers.
689        xinstall -m 644 ${worksrcpath}/liboctave/operators/libcxx-fix.h \
690            ${destroot}${prefix}/include/${name}-${version}/${name}/libcxx-fix.h
691    }
692}
693
694test.run    yes
695test.target check
696
697livecheck.type    regexm
698livecheck.url     http://hg.savannah.gnu.org/hgweb/octave/tags
699livecheck.version ${hg.tag}
Note: See TracBrowser for help on using the repository browser.