1PORTNAME=	gpsim
2DISTVERSION=	0.32.1
3CATEGORIES=	misc
4MASTER_SITES=	https://download.sourceforge.net/project/gpsim/gpsim/0.32.0/ # SF
5
6MAINTAINER=	yuri@FreeBSD.org
7COMMENT=	Software simulator for Microchip PIC microcontrollers
8WWW=		https://gpsim.sourceforge.net/
9
10LICENSE=	gpl2 lgpl2.1
11LICENSE_COMB=	multi
12
13BUILD_DEPENDS=	gpasm:devel/gputils
14LIB_DEPENDS=	libfontconfig.so:x11-fonts/fontconfig \
15		libfreetype.so:print/freetype2 \
16		libharfbuzz.so:print/harfbuzz \
17		libpopt.so:devel/popt
18RUN_DEPENDS=	gpasm:devel/gputils
19
20USES=		compiler:c++11-lang gmake gnome libtool localbase:ldflags pathfix pkgconfig readline
21USE_CXXSTD=	c++11
22USE_GNOME=	cairo gdkpixbuf glib20 gtk20 pango
23USE_LDCONFIG=	yes
24
25GNU_CONFIGURE=	yes
26
27INSTALL_TARGET=	install-strip
28
29CONFLICTS_BUILD=	ga
30
31DESKTOP_ENTRIES=	"GPSim" "" "" "gpsim" "Development;GTK;" ""
32
33OPTIONS_DEFINE=		DOCS EXAMPLES
34
35PORTDOCS=	*
36PORTEXAMPLES=	*
37
38post-patch:
39.for i in gpsim/Makefile.in modules/Makefile.in
40	@${REINPLACE_CMD} -e \
41		's|-lstdc++||' ${WRKSRC}/${i}
42.endfor
43
44post-install-DOCS-on:
45	@${MKDIR} ${STAGEDIR}${DOCSDIR}
46.for i in AUTHORS ChangeLog PROCESSORS README* doc/gpsim.pdf
47	(cd ${WRKSRC} && ${INSTALL_DATA} ${i} \
48		${STAGEDIR}${DOCSDIR})
49.endfor
50
51post-install-EXAMPLES-on:
52.for i in led_test logic_test mod_test usart_gui usart_test
53	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/modules/${i}
54	(cd ${WRKSRC}/examples/modules/${i} && ${INSTALL_DATA} *.asm *.stc \
55		${STAGEDIR}${EXAMPLESDIR}/modules/${i})
56.endfor
57.for i in digital_stim p16f628_test stack_test
58	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/projects/${i}
59	(cd ${WRKSRC}/examples/projects/${i} && ${INSTALL_DATA} *.asm *.stc \
60		${STAGEDIR}${EXAMPLESDIR}/projects/${i})
61.endfor
62
63.include <bsd.port.mk>
64