source: trunk/dports/emulators/simulavr/Portfile

Last change on this file was 144548, checked in by ryandesign@…, 21 months ago

simulavr: update hack to recognize swig 3 (#44108)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.8 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 144548 2016-01-12 08:00:22Z ryandesign@macports.org $
3
4PortSystem 1.0
5
6name              simulavr
7version           1.0.0
8revision          2
9categories        emulators devel
10maintainers       nomaintainer
11description       Simulator for Atmel AVR microcontrollers
12long_description  The SimulAVR program is a simulator for the Atmel AVR family \
13                  of microcontrollers. (ATtiny and ATmega) SimulAVR can be used \
14                  either standalone or as a remote target for avr-gdb.
15homepage          http://www.nongnu.org/simulavr/
16platforms         darwin
17master_sites      http://savannah.nongnu.org/download/simulavr/
18
19checksums           rmd160  0e9eb32f398943449b564e919765348c32f4c600 \
20                    sha256  39d93faa3eeae2bee15f682dd6a48fb4d4366addd12a2abebb04c99f87809be7
21
22depends_build     bin:makeinfo:texinfo
23depends_lib       port:avr-binutils \
24                  port:swig-python \
25                  port:swig-tcl
26
27patchfiles        patch-src_systemclock.cpp \
28                  patch-msleep \
29                  patch-src_Makefile.in \
30                  patch-at90can-ivs \
31                  patch-at90can-elpm
32
33post-patch {
34    # Hack the swig macro into detecting a modern version of swig
35    reinplace "s|required=1.3.18|required=3.0.8|g" ${worksrcpath}/configure
36
37    # Apply changes from http://savannah.nongnu.org/bugs/?35737 to fix building
38    # against the later avr-libc releases
39    set regexps {
40        "s/SIG_INTERRUPT0/INT0_vect/"
41        "s/SIG_INTERRUPT1/INT1_vect/"
42        "s/SIG_INTERRUPT2/INT2_vect/"
43        "s/SIG_OUTPUT_COMPARE2/TIMER2_COMP_vect/"
44        "s/SIG_OUTPUT_COMPARE2A/TIMER2_COMPA_vect/"
45        "s/SIG_OUTPUT_COMPARE3B/TIMER3_COMPB_vect/"
46        "s/SIG_UART0_RECV/USART0_RX_vect/"
47        "s/SIG_UART0_DATA/USART0_UDRE_vect/"
48        "s/__attribute__((progmem))/PROGMEM/"
49        "s/__attribute__ ((progmem))/PROGMEM/"
50    } 
51
52    fs-traverse fpath ${worksrcpath} {
53        set ext [file extension "${fpath}"]
54        if {[file isfile "${fpath}"] && ($ext == ".c" || $ext == ".h" || $ext == ".cpp")} {
55            foreach r $regexps {
56                reinplace -locale C $r $fpath
57            }
58        }
59    }
60
61    reinplace "s|^static char unshifted|static const char unshifted|" ${worksrcpath}/examples/atmel_key/scancodes.h
62    reinplace {s|prog_char shifted\[\]\[2\]|static const char shifted\[\]\[2\] PROGMEM|g} ${worksrcpath}/examples/atmel_key/scancodes.h
63}
64
65# avr-binutils' libbfd.a can't find gettext and zlib (#41106)
66configure.ldflags-append -lintl -lz
67configure.args    --with-bfd="${prefix}/avr/host" \
68                  --with-libiberty="${prefix}/avr/host"
69#configure.args    --mandir=${prefix}/share/man
70
71livecheck.type      regex
72livecheck.url       [lindex ${master_sites} 0]
73livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.