New port: devel/simavr

This is a port of simavr, an AVR simulator using avr-gcc's register
definitions.

WWW: https://github.com/buserror/simavr

PR:		208475
Submitted by:	Felix Palmen <felix@palmen-it.de>
This commit is contained in:
Kurt Jaeger 2016-04-06 16:09:05 +00:00
parent 844c50f452
commit b4cef57a43
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=412631
8 changed files with 278 additions and 0 deletions

View file

@ -5240,6 +5240,7 @@
SUBDIR += sigslot
SUBDIR += silc-toolkit
SUBDIR += silentbob
SUBDIR += simavr
SUBDIR += simgear
SUBDIR += simian
SUBDIR += simple_components

87
devel/simavr/Makefile Normal file
View file

@ -0,0 +1,87 @@
# Created by: Felix Palmen <felix@palmen-it.de>
# $FreeBSD$
PORTNAME= simavr
PORTVERSION= 1.3
CATEGORIES= devel
PATCH_DIST_STRIP= -p1
MAINTAINER= felix@palmen-it.de
COMMENT= Simulator for several Atmel AVR chips
LICENSE= GPLv3
BUILD_DEPENDS= avr-gcc:devel/avr-gcc \
bash:shells/bash \
${LOCALBASE}/avr/lib/libc.a:devel/avr-libc
USE_GITHUB= yes
GH_ACCOUNT= buserror
GH_TAGNAME= v${PORTVERSION}
USES= gmake pkgconfig
ALL_TARGET= build-simavr
MAKE_ARGS= "RELEASE=1 PREFIX=${PREFIX} DESTDIR=${STAGEDIR}${PREFIX}"
USE_LDCONFIG= yes
OPTIONS_DEFINE= DOCS EXAMPLES THREADSAFE
THREADSAFE_DESC= Add a patch to make debugging output thread-safe
DOCS_ALL_TARGET= doc
DOCS_USE= tex=latex:build tex=pdftex:build tex=texmf:build
EXAMPLES_ALL_TARGET= build-examples
EXAMPLES_USE= xorg=xdamage xorg=xcb xorg=xext xorg=xfixes \
xorg=xrandr gl=glut
THREADSAFE_PATCH_SITES= https://github.com/zirias/simavr/commit/
THREADSAFE_PATCHFILES= 4b7c8c5245e1bbb8cac04948564622f47178b5f0.diff
AVR_STRIP_CMD?= avr-strip
DUMPMACHINE= ${CC} -dumpmachine
OBJDIRNAME= obj-$$(${DUMPMACHINE})
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/simavr
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libsimavr.so.1
post-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_MAN} ${WRKSRC}/doc/manual/manual.pdf ${STAGEDIR}${DOCSDIR}
${INSTALL_MAN} ${WRKSRC}/doc/simavr_callgraph.pdf ${STAGEDIR}${DOCSDIR}
post-install-EXAMPLES-on:
.for BOARDELF in hd77480,charlcd i2ctest ledramp simduino ssd1306,ssd1306demo timer_64led
BOARDELF=${BOARDELF}; \
BOARD=$${BOARDELF%%,*}; \
ELF=$${BOARDELF##*,}; \
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/board_$${BOARD}; \
${INSTALL_PROGRAM} \
${WRKSRC}/examples/board_$${BOARD}/${OBJDIRNAME}/$${ELF}.elf \
${STAGEDIR}${EXAMPLESDIR}/board_$${BOARD}/$${ELF}; \
${INSTALL_DATA} ${WRKSRC}/examples/board_$${BOARD}/*.[aihc]* \
${WRKSRC}/examples/board_$${BOARD}/README \
${WRKSRC}/examples/board_$${BOARD}/Makefile \
${STAGEDIR}${EXAMPLESDIR}/board_$${BOARD}/
.endfor
.for AXF in \
hd77480/atmega48_charlcd \
i2ctest/atmega1280_i2ctest \
ledramp/atmega48_ledramp \
ssd1306/atmega32_ssd1306 \
timer_64led/atmega168_timer_64led
${AVR_STRIP_CMD} ${STAGEDIR}${EXAMPLESDIR}/board_${AXF}.axf
.endfor
.for EXDIR in parts shared
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/${EXDIR}
${INSTALL_DATA} ${WRKSRC}/examples/${EXDIR}/*.[hc] \
${STAGEDIR}${EXAMPLESDIR}/${EXDIR}
.endfor
${INSTALL_DATA} ${WRKSRC}/Makefile.common ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/examples/Makefile ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/examples/Makefile.opengl \
${STAGEDIR}${EXAMPLESDIR}
.include <bsd.port.mk>

4
devel/simavr/distinfo Normal file
View file

@ -0,0 +1,4 @@
SHA256 (buserror-simavr-1.3-v1.3_GH0.tar.gz) = ddaaf9745b62b0c032a773365375a6f1b12c50ff4a89ae4d531e7b516846e357
SIZE (buserror-simavr-1.3-v1.3_GH0.tar.gz) = 741336
SHA256 (4b7c8c5245e1bbb8cac04948564622f47178b5f0.diff) = 0bb3af41d9a64a372b64d2849bcfb9da00a685f54a31ee70fd7caf26d7db9c6c
SIZE (4b7c8c5245e1bbb8cac04948564622f47178b5f0.diff) = 1551

View file

@ -0,0 +1,13 @@
--- examples/Makefile.opengl.orig 2016-01-19 09:41:55 UTC
+++ examples/Makefile.opengl
@@ -11,8 +11,8 @@ else
ifeq (${shell uname -o}, Msys)
LDFLAGS += -mwindows -lopengl32 -lfreeglut
else
-CPPFLAGS += ${shell pkg-config --cflags glu glut} -DFREEBSD=1
-LDFLAGS += ${shell pkg-config --libs glu glut}
+CPPFLAGS += ${shell pkg-config --cflags glu} -DFREEBSD=1
+LDFLAGS += ${shell pkg-config --libs glu} -lglut
endif
endif
endif

View file

@ -0,0 +1,18 @@
--- examples/parts/uart_pty.c.orig 2016-01-19 09:41:55 UTC
+++ examples/parts/uart_pty.c
@@ -30,8 +30,15 @@
#ifdef __APPLE__
#include <util.h>
#else
+#ifdef FREEBSD
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <termios.h>
+#include <libutil.h>
+#else
#include <pty.h>
#endif
+#endif
#include "uart_pty.h"
#include "avr_uart.h"

View file

@ -0,0 +1,35 @@
--- simavr/Makefile.orig 2016-01-19 09:41:55 UTC
+++ simavr/Makefile
@@ -73,12 +73,9 @@ ${OBJ}/libsimavr.so : ${OBJ}/libsimavr.
ln -sf libsimavr.so.1 $@
libsimavr : config ${OBJ}/libsimavr.a
-# shared library won't work that easily on non-linux
-ifeq (${shell uname}, Linux)
libsimavr : ${OBJ}/libsimavr.so
-endif
-${OBJ}/${target}.elf : ${OBJ}/${target}.o
+${OBJ}/${target}.elf : ${OBJ}/${target}.o | libsimavr
${target} : ${OBJ}/${target}.elf
@@ -103,15 +100,13 @@ install : all
$(INSTALL) -m644 sim/avr/*.h $(DESTDIR)/include/simavr/avr/
$(MKDIR) $(DESTDIR)/lib
$(INSTALL) ${OBJ}/libsimavr.a $(DESTDIR)/lib/
- $(MKDIR) $(DESTDIR)/lib/pkgconfig/
+ $(MKDIR) $(DESTDIR)/libdata/pkgconfig/
sed -e "s|PREFIX|${PREFIX}|g" -e "s|VERSION|${SIMAVR_VERSION}|g" \
- simavr-avr.pc >$(DESTDIR)/lib/pkgconfig/simavr-avr.pc
+ simavr-avr.pc >$(DESTDIR)/libdata/pkgconfig/simavr-avr.pc
sed -e "s|PREFIX|${PREFIX}|g" -e "s|VERSION|${SIMAVR_VERSION}|g" \
- simavr.pc >$(DESTDIR)/lib/pkgconfig/simavr.pc
-ifeq (${shell uname}, Linux)
+ simavr.pc >$(DESTDIR)/libdata/pkgconfig/simavr.pc
$(INSTALL) ${OBJ}/libsimavr.so.1 $(DESTDIR)/lib/
ln -sf libsimavr.so.1 $(DESTDIR)/lib/libsimavr.so
-endif
$(MKDIR) $(DESTDIR)/bin
$(INSTALL) ${OBJ}/${target}.elf $(DESTDIR)/bin/simavr

4
devel/simavr/pkg-descr Normal file
View file

@ -0,0 +1,4 @@
This is a port of simavr, an AVR simulator using avr-gcc's register
definitions.
WWW: https://github.com/buserror/simavr

116
devel/simavr/pkg-plist Normal file
View file

@ -0,0 +1,116 @@
bin/simavr
include/simavr/avr/avr_mcu_section.h
include/simavr/avr_adc.h
include/simavr/avr_bitbang.h
include/simavr/avr_eeprom.h
include/simavr/avr_extint.h
include/simavr/avr_flash.h
include/simavr/avr_ioport.h
include/simavr/avr_lin.h
include/simavr/avr_spi.h
include/simavr/avr_timer.h
include/simavr/avr_twi.h
include/simavr/avr_uart.h
include/simavr/avr_usb.h
include/simavr/avr_watchdog.h
include/simavr/fifo_declare.h
include/simavr/sim_avr.h
include/simavr/sim_avr_types.h
include/simavr/sim_core.h
include/simavr/sim_core_config.h
include/simavr/sim_core_decl.h
include/simavr/sim_cycle_timers.h
include/simavr/sim_elf.h
include/simavr/sim_gdb.h
include/simavr/sim_hex.h
include/simavr/sim_interrupts.h
include/simavr/sim_io.h
include/simavr/sim_irq.h
include/simavr/sim_network.h
include/simavr/sim_regbit.h
include/simavr/sim_time.h
include/simavr/sim_vcd_file.h
lib/libsimavr.a
lib/libsimavr.so
lib/libsimavr.so.1
libdata/pkgconfig/simavr-avr.pc
libdata/pkgconfig/simavr.pc
%%PORTDOCS%%%%DOCSDIR%%/manual.pdf
%%PORTDOCS%%%%DOCSDIR%%/simavr_callgraph.pdf
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/Makefile
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/Makefile.common
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/Makefile.opengl
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_hd77480/Makefile
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_hd77480/README
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_hd77480/atmega48_charlcd.axf
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_hd77480/atmega48_charlcd.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_hd77480/avr_hd44780.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_hd77480/avr_hd44780.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_hd77480/avr_hd44780_conf.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_hd77480/charlcd
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_hd77480/charlcd.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_hd77480/font.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_i2ctest/Makefile
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_i2ctest/README
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_i2ctest/atmega1280_i2ctest.axf
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_i2ctest/atmega1280_i2ctest.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_i2ctest/i2ctest
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_i2ctest/i2ctest.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ledramp/Makefile
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ledramp/README
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ledramp/atmega48_ledramp.axf
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ledramp/atmega48_ledramp.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ledramp/ledramp
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ledramp/ledramp.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_simduino/ATmegaBOOT_168_atmega328.ihex
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_simduino/Makefile
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_simduino/README
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_simduino/atmega328p_dummy_blinky.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_simduino/atmega328p_dummy_blinky.hex
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_simduino/simduino
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_simduino/simduino.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ssd1306/Makefile
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ssd1306/README
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ssd1306/atmega32_ssd1306.axf
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ssd1306/atmega32_ssd1306.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ssd1306/images.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ssd1306/images.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ssd1306/ssd1306.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ssd1306/ssd1306.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ssd1306/ssd1306demo
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_ssd1306/ssd1306demo.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_timer_64led/Makefile
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_timer_64led/README
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_timer_64led/atmega168_timer_64led.axf
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_timer_64led/atmega168_timer_64led.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_timer_64led/atmega168_timer_64led.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_timer_64led/timer_64led
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/board_timer_64led/timer_64led.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/ac_input.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/ac_input.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/button.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/button.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/hc595.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/hc595.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/hd44780.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/hd44780.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/hd44780_glut.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/hd44780_glut.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/i2c_eeprom.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/i2c_eeprom.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/ssd1306_glut.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/ssd1306_glut.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/ssd1306_virt.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/ssd1306_virt.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/uart_pty.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/uart_pty.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/uart_udp.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/uart_udp.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/vhci_usb.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/parts/vhci_usb.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/shared/arduidiot_pins.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/shared/arduidiot_pins.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/shared/avr_twi_master.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/shared/avr_twi_master.h
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/shared/twimaster.c
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/shared/twimaster.h