COMMENT =		simple, modular, scriptable schematics editor

V =			3.1.7b
DISTNAME =		pcb-rnd-${V}
PKGNAME =		pcb-rnd-${V}
CATEGORIES =		cad

HOMEPAGE =		http://repo.hu/projects/pcb-rnd/

# GPLv2
PERMIT_PACKAGE =	Yes

SITES =			http://repo.hu/projects/pcb-rnd/releases/

WANTLIB +=		c m xml2 freetype gd
#WANTLIB +=		rnd-3rd rnd-core rnd-font
#WANTLIB +=		rnd-font2 rnd-hid rnd-poly


BUILD_DEPENDS +=	cad/librnd \
			devel/fungw \
			archivers/bzip2

RUN_DEPENDS +=		devel/fungw \
			cad/librnd \
			devel/desktop-file-utils \
			x11/gtk+4,-guic

COMPILER =              base-clang ports-gcc base-gcc
USE_GMAKE =		Yes

CONFIGURE_STYLE =	none

CONFIGURE_ARGS +=	--confdir=${PREFIX}/share/examples/pcb-rnd
CONFIGURE_ARGS +=	--dot_pcb_rnd=.config/pcb-rnd
CONFIGURE_ARGS +=	--man1dir=/man/man1
CONFIGURE_ARGS +=	--all=plugin
CONFIGURE_ARGS +=	--prefix/libs/sul/freetype2=/usr/X11R6

do-configure:
	cd ${WRKSRC} && ./configure ${CONFIGURE_ARGS}

post-install:
	${INSTALL_DATA_DIR} ${PREFIX}/share/applications
	${INSTALL_DATA} ${FILESDIR}/pcb-rnd.desktop ${PREFIX}/share/applications
.for s in 16 32 64 128
	${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/${s}x${s}/apps
	${INSTALL_DATA} ${WRKSRC}/doc/resources/logo${s}.png \
                ${PREFIX}/share/icons/hicolor/${s}x${s}/apps/pcb-rnd${s}.png
.endfor
	${INSTALL_DATA_DIR} ${PREFIX}/share/icons/hicolor/scalable/apps
	${INSTALL_DATA} ${WRKSRC}/doc/resources/logo.svg \
                ${PREFIX}/share/icons/hicolor/scalable/apps/pcb-rnd.svg

.include <bsd.port.mk>
