From 9d4693d397e1d7a5abf88d4d571d2a39f029bf17 Mon Sep 17 00:00:00 2001 From: Jose Alonso Cardenas Marquez Date: Tue, 1 Aug 2006 11:20:58 +0000 Subject: [PATCH] New port: devel/pikdev PiKdev is a simple graphic IDE for the development of PIC-based applications. It currently supports assembly language. C language is also supported for PIC 18 devices. PiKdev is developed in C++ under Linux, FreeBSD and is based on the KDE environment. WWW: http://pikdev.free.fr/ Approved by: garga (mentor) --- devel/Makefile | 1 + devel/pikdev/Makefile | 66 ++++++++ devel/pikdev/distinfo | 3 + devel/pikdev/files/patch-pikdev_Config.cpp | 29 ++++ devel/pikdev/files/patch-pikdev_uparport.cc | 163 ++++++++++++++++++++ devel/pikdev/files/patch-pikdev_uparport.hh | 16 ++ devel/pikdev/files/pkg-message.in | 21 +++ devel/pikdev/pkg-descr | 6 + devel/pikdev/pkg-plist | 48 ++++++ 9 files changed, 353 insertions(+) create mode 100644 devel/pikdev/Makefile create mode 100644 devel/pikdev/distinfo create mode 100644 devel/pikdev/files/patch-pikdev_Config.cpp create mode 100644 devel/pikdev/files/patch-pikdev_uparport.cc create mode 100644 devel/pikdev/files/patch-pikdev_uparport.hh create mode 100644 devel/pikdev/files/pkg-message.in create mode 100644 devel/pikdev/pkg-descr create mode 100644 devel/pikdev/pkg-plist diff --git a/devel/Makefile b/devel/Makefile index 190b40028558..19626b543321 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -1542,6 +1542,7 @@ SUBDIR += picasm SUBDIR += picp SUBDIR += picprog + SUBDIR += pikdev SUBDIR += pinstall SUBDIR += pkg-config SUBDIR += plan9port diff --git a/devel/pikdev/Makefile b/devel/pikdev/Makefile new file mode 100644 index 000000000000..0ab6e462aca0 --- /dev/null +++ b/devel/pikdev/Makefile @@ -0,0 +1,66 @@ +# New ports collection makefile for: pikdev +# Date created: 2006-03-14 +# Whom: Jose Alonso Cardenas Marquez +# +# $FreeBSD$ +# + +PORTNAME= pikdev +PORTVERSION= 0.9.2 +CATEGORIES= devel kde +MASTER_SITES= http://pikdev.free.fr/ +DISTNAME= ${PORTNAME}-${PORTVERSION}-1 + +MAINTAINER= acm@FreeBSD.org +COMMENT= Simple graphic IDE for the development of PIC-based applications + +LIB_DEPENDS= fam.0:${PORTSDIR}/devel/gamin \ + png.5:${PORTSDIR}/graphics/png \ + jpeg.9:${PORTSDIR}/graphics/jpeg +RUN_DEPENDS= gpasm:${PORTSDIR}/devel/gputils + +USE_KDEBASE_VER=3 +GNU_CONFIGURE= yes +USE_GMAKE= yes +USE_AUTOTOOLS= libtool:15 +INSTALLS_ICONS= yes +CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} +LDFLAGS+= -L${LOCALBASE}/lib -L${X11BASE}/lib ${PTHREAD_LIBS} +CPPFLAGS+= -I${LOCALBASE}/include -I${X11BASE}/include +CONFIGURE_ENV= LDFLAGS="${LDFLAGS}" CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" +CONFIGURE_ARGS+= --with-pic=yes +MAKE_ENV= LDFLAGS="${LDFLAGS}" CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" +SUB_FILES= pkg-message + +OPTIONS= DEBUG "Enable debug information" off \ + NLS "Native Language Support" on + +.include + +.if defined(WITH_DEBUG) +CONFIGURE_ARGS+= --enable-debug=full +.endif + +.if defined(WITHOUT_NLS) +PLIST_SUB+= NLS="@comment " +.else +USE_GETTEXT= yes +PLIST_SUB+= NLS="" +FLAG_NLS= true +.endif + +post-patch: + ${REINPLACE_CMD} -e 's|-O2||g' ${WRKSRC}/configure + ${REINPLACE_CMD} -e 's|-Wmissing-prototypes||g' ${WRKSRC}/configure + +post-configure: + ${REINPLACE_CMD} -e 's|^install-data-am: install-docs install-nls|install-data-am:|g' \ + ${WRKSRC}/doc/en/${MAKEFILE} +.if !defined(FLAG_NLS) + ${REINPLACE_CMD} -e 's|^install-data-am: install-nls|install-data-am:|g' ${WRKSRC}/po/Makefile +.endif + +post-install: + ${CAT} ${PKGMESSAGE} + +.include diff --git a/devel/pikdev/distinfo b/devel/pikdev/distinfo new file mode 100644 index 000000000000..a906e1b48c0f --- /dev/null +++ b/devel/pikdev/distinfo @@ -0,0 +1,3 @@ +MD5 (pikdev-0.9.2-1.tar.gz) = fd15cdb53703dc55f21f640e63b98f98 +SHA256 (pikdev-0.9.2-1.tar.gz) = 52512962aec1df0dc0f76035dd20799676ec7dfac7a4cfc2cac95bdf3993ac6b +SIZE (pikdev-0.9.2-1.tar.gz) = 1301179 diff --git a/devel/pikdev/files/patch-pikdev_Config.cpp b/devel/pikdev/files/patch-pikdev_Config.cpp new file mode 100644 index 000000000000..9e11516765c9 --- /dev/null +++ b/devel/pikdev/files/patch-pikdev_Config.cpp @@ -0,0 +1,29 @@ +--- src/Config.cpp Mon Jul 31 18:21:46 2006 ++++ src/Config.cpp Mon Jul 31 18:22:14 2006 +@@ -123,7 +123,7 @@ + vdd = conf->readNumEntry("vdd", -4 ) ; + vpp = conf->readNumEntry("vpp", -5 ) ; + clkdelay = conf->readNumEntry("clkdelay", 0 ) ; +- port = conf->readEntry("device", "/dev/parport0" ) ; ++ port = conf->readEntry("device", "/dev/ppi0" ) ; + } + + +@@ -142,7 +142,7 @@ + vdd = conf->readNumEntry("vdd", 5 ) ; + vpp = conf->readNumEntry("vpp", 3 ) ; + clkdelay = conf->readNumEntry("clkdelay", 0 ) ; +- port = conf->readEntry("device", "/dev/ttyS0" ) ; ++ port = conf->readEntry("device", "/dev/sio0" ) ; + } + + void Config::getSer555PortConfig(QString &port, int &vpp, int& vdd, int &clock, +@@ -159,7 +159,7 @@ + vdd = conf->readNumEntry("vdd", 5 ) ; + vpp = conf->readNumEntry("vpp", 3 ) ; + clkdelay = conf->readNumEntry("clkdelay", 0 ) ; +- port = conf->readEntry("device", "/dev/ttyUSB0" ) ; ++ port = conf->readEntry("device", "/dev/usb" ) ; + } + + /** Write informations about known standard programming cards */ diff --git a/devel/pikdev/files/patch-pikdev_uparport.cc b/devel/pikdev/files/patch-pikdev_uparport.cc new file mode 100644 index 000000000000..d5fa7704e628 --- /dev/null +++ b/devel/pikdev/files/patch-pikdev_uparport.cc @@ -0,0 +1,163 @@ +--- src/uparport.cc Sat Jun 24 13:21:15 2006 ++++ src/uparport.cc Sat Jun 24 14:31:29 2006 +@@ -25,23 +25,23 @@ + struct parport::pintable parport::pin_table[26] = + { + { NA, NA ,0x00, &parport::errimg }, /* pin 0 Invalid pin # */ +- { PPRCONTROL, PPWCONTROL,0x01, &parport::controlimg }, /* pin 1 (out) !strobe */ +- { PPRDATA, PPWDATA ,0x01, &parport::dataimg },/* pin 2 (out) Data 0 */ +- { PPRDATA, PPWDATA ,0x02, &parport::dataimg },/* pin 3 (out) Data 1 */ +- { PPRDATA, PPWDATA ,0x04, &parport::dataimg },/* pin 4 (out) Data 2 */ +- { PPRDATA, PPWDATA ,0x08, &parport::dataimg },/* pin 5 (out) Data 3 */ +- { PPRDATA, PPWDATA ,0x10, &parport::dataimg },/* pin 6 (out) Data 4 */ +- { PPRDATA, PPWDATA ,0x20, &parport::dataimg },/* pin 7 (out) Data 5 */ +- { PPRDATA, PPWDATA ,0x40, &parport::dataimg },/* pin 8 (out) Data 6 */ +- { PPRDATA, PPWDATA ,0x80, &parport::dataimg },/* pin 9 (out) Data 7 */ +- { PPRSTATUS, NA ,0x40, &parport::statusimg },/* pin 10 (in) !ack */ +- { PPRSTATUS, NA ,0x80, &parport::statusimg }, /* pin 11 (in) busy */ +- { PPRSTATUS, NA ,0x20, &parport::statusimg }, /* pin 12 (in) Pout */ +- { PPRSTATUS, NA ,0x10, &parport::statusimg }, /* pin 13 (in) Select */ +- { PPRCONTROL, PPWCONTROL,0x02, &parport::controlimg },/* pin 14 (out) !feed */ +- { PPRSTATUS, NA ,0x08, &parport::statusimg },/* pin 15 (in) !error */ +- { PPRCONTROL, PPWCONTROL,0x04, &parport::controlimg },/* pin 16 (out) !init */ +- { PPRCONTROL, PPWCONTROL,0x08, &parport::controlimg },/* pin 17 (out) !SI */ ++ { PPIGCTRL, PPISCTRL ,0x01, &parport::controlimg }, /* pin 1 (out) !strobe */ ++ { PPIGDATA, PPISDATA ,0x01, &parport::dataimg },/* pin 2 (out) Data 0 */ ++ { PPIGDATA, PPISDATA ,0x02, &parport::dataimg },/* pin 3 (out) Data 1 */ ++ { PPIGDATA, PPISDATA ,0x04, &parport::dataimg },/* pin 4 (out) Data 2 */ ++ { PPIGDATA, PPISDATA ,0x08, &parport::dataimg },/* pin 5 (out) Data 3 */ ++ { PPIGDATA, PPISDATA ,0x10, &parport::dataimg },/* pin 6 (out) Data 4 */ ++ { PPIGDATA, PPISDATA ,0x20, &parport::dataimg },/* pin 7 (out) Data 5 */ ++ { PPIGDATA, PPISDATA ,0x40, &parport::dataimg },/* pin 8 (out) Data 6 */ ++ { PPIGDATA, PPISDATA ,0x80, &parport::dataimg },/* pin 9 (out) Data 7 */ ++ { PPIGSTATUS, NA ,0x40, &parport::statusimg },/* pin 10 (in) !ack */ ++ { PPIGSTATUS, NA ,0x80, &parport::statusimg }, /* pin 11 (in) busy */ ++ { PPIGSTATUS, NA ,0x20, &parport::statusimg }, /* pin 12 (in) Pout */ ++ { PPIGSTATUS, NA ,0x10, &parport::statusimg }, /* pin 13 (in) Select */ ++ { PPIGCTRL, PPISCTRL,0x02, &parport::controlimg },/* pin 14 (out) !feed */ ++ { PPIGSTATUS, NA ,0x08, &parport::statusimg },/* pin 15 (in) !error */ ++ { PPIGCTRL, PPISCTRL,0x04, &parport::controlimg },/* pin 16 (out) !init */ ++ { PPIGCTRL, PPISCTRL,0x08, &parport::controlimg },/* pin 17 (out) !SI */ + { NA, NA , 0x00, &parport::errimg }, /* pin 18 GND */ + { NA, NA , 0x00, &parport::errimg }, /* pin 19 GND */ + { NA, NA , 0x00, &parport::errimg }, /* pin 20 GND */ +@@ -68,7 +68,6 @@ + int parport::yield() + { + if(fd == -1) return -1; +- return ioctl(fd,PPYIELD) ; + } + + // -------------------------------------------------------- +@@ -83,22 +82,15 @@ + + int k; + +- if( ((sscanf(np,"/dev/parport%d",&k) == 1) || (sscanf(np,"/dev/parports/%d",&k) == 1)) ++ if( ((sscanf(np,"/dev/ppi%d",&k) == 1) || (sscanf(np,"/dev/ppi/%d",&k) == 1)) + && (k >= 0) && (k < 10)) + { + // seems correct .. + fd = open(np, O_RDWR) ; + +- if( fd != -1) ++ if( fd != 0) + { +- if( (k = ioctl(fd, PPCLAIM)) != 0) +- { +- char b[200] ; +- sprintf(b,"parport::setport (%.150s must be rw enabled)", np); +- perror(b) ; +- ::close(fd) ; +- fd = -1 ; +- } ++ return ; + } + else + perror("Cannot open parallel port") ; +@@ -110,7 +102,7 @@ + + int parport::writedata(unsigned char x) + { +- int s = ioctl(fd,PPWDATA,&x); ++ int s = ioctl(fd,PPISDATA,&x); + if( s ) + perror("parport::writedata") ; + else +@@ -120,7 +112,7 @@ + + int parport::readdata(unsigned char& x) + { +- int s = ioctl(fd,PPRDATA,&x); ++ int s = ioctl(fd,PPIGDATA,&x); + if( s ) + perror( "parport::readdata") ; + else +@@ -131,7 +123,7 @@ + + int parport::writecontrol(unsigned char x) + { +- int s = ioctl(fd,PPWCONTROL,&x); ++ int s = ioctl(fd, PPISCTRL,&x); + if( s ) perror( "parport::writecontrol") ; + else controlimg = x ; + return s ; +@@ -139,7 +131,7 @@ + + int parport::readcontrol(unsigned char& x) + { +- int s = ioctl(fd,PPRCONTROL,&x); ++ int s = ioctl(fd, PPIGCTRL,&x); + if( s ) + perror("parport::readcontrol"); + else +@@ -160,7 +152,7 @@ + + int parport::readstatus(unsigned char& x) + { +- int s = ioctl(fd,PPRSTATUS,&x); ++ int s = ioctl(fd,PPIGSTATUS,&x); + if( s ) + perror("parport::readstatus") ; + else +@@ -235,34 +227,18 @@ + int fd = open(pname, O_RDWR) ; + if( fd == -1 ) return -2 ; + +- int k = ioctl(fd, PPCLAIM) ; +- +- if( k != 0 ) +- { +- ::close(fd) ; +- return -1 ; +- } +- +- ioctl(fd,PPRELEASE) ; +- +- ::close(fd) ; ++ ::close(fd) ; + + return 0 ; +- + } + /** No descriptions */ + void parport::close() + { +- if( fd != -1) +- { +- int stat = ioctl(fd,PPRELEASE) ; +- ::close(fd) ; +- if( stat != 0) +- { +- perror("parport::~parport") ; +- } +- } +- fd = -1 ; ++ if( fd != -1) ++ { ++ ::close(fd) ; ++ } ++ fd = -1 ; + } + bool parport::isok() + { diff --git a/devel/pikdev/files/patch-pikdev_uparport.hh b/devel/pikdev/files/patch-pikdev_uparport.hh new file mode 100644 index 000000000000..a0e4f3662c4f --- /dev/null +++ b/devel/pikdev/files/patch-pikdev_uparport.hh @@ -0,0 +1,16 @@ +--- src/uparport.hh Sat Jun 24 13:19:29 2006 ++++ src/uparport.hh Sat Jun 24 13:20:31 2006 +@@ -15,10 +15,10 @@ + extern "C" + { + #include +-// in RedHat & Mandrake distro, ppdev.h is into /usr/include/linux +-#include + #include +-// #include ++#include ++#include ++#include + #include + } + diff --git a/devel/pikdev/files/pkg-message.in b/devel/pikdev/files/pkg-message.in new file mode 100644 index 000000000000..1eec14f93281 --- /dev/null +++ b/devel/pikdev/files/pkg-message.in @@ -0,0 +1,21 @@ +############################################################################### + +1) Add your user to wheel group +2) Modify user and group permissions of /dev/ppi0 to read/write. + + - FreeBSD 4.x + * chown root:wheel /dev/ppi0 + * chmod 660 /dev/ppi0 + + - FreeBSD >= 5.x + * Add these lines into /etc/devfs.conf + + own ppi0 root:wheel + perm ppi0 0660 + + * Run sh /etc/rc.d/devfs restart + +3) Run pikdev (gui) or pkp (cli) +4) Enjoy it ;) + +############################################################################### diff --git a/devel/pikdev/pkg-descr b/devel/pikdev/pkg-descr new file mode 100644 index 000000000000..8e0405fa57e4 --- /dev/null +++ b/devel/pikdev/pkg-descr @@ -0,0 +1,6 @@ +PiKdev is a simple graphic IDE for the development of PIC-based applications. +It currently supports assembly language. C language is also supported for PIC +18 devices. PiKdev is developed in C++ under Linux, FreeBSD and is based on +the KDE environment. + +WWW: http://pikdev.free.fr/ diff --git a/devel/pikdev/pkg-plist b/devel/pikdev/pkg-plist new file mode 100644 index 000000000000..609928e15e2b --- /dev/null +++ b/devel/pikdev/pkg-plist @@ -0,0 +1,48 @@ +bin/pikdev +bin/pkp +share/applnk/Utilities/pikdev.desktop +share/apps/katepart/syntax/picsrc_pikdev.xml +share/apps/pikdev/pics/splash.png +share/apps/pikdev/pikdev-main.rc +share/apps/pikdev/pikdev-prg.rc +share/icons/hicolor/16x16/actions/pikdev_addcurrentfile.png +share/icons/hicolor/16x16/actions/pikdev_addfile.png +share/icons/hicolor/16x16/actions/pikdev_burnchip.png +share/icons/hicolor/16x16/actions/pikdev_closeproject.png +share/icons/hicolor/16x16/actions/pikdev_compile.png +share/icons/hicolor/16x16/actions/pikdev_createproject.png +share/icons/hicolor/16x16/actions/pikdev_chip.png +share/icons/hicolor/16x16/actions/pikdev_decompile.png +share/icons/hicolor/16x16/actions/pikdev_editproject.png +share/icons/hicolor/16x16/actions/pikdev_erasechip.png +share/icons/hicolor/16x16/actions/pikdev_find_next.png +share/icons/hicolor/16x16/actions/pikdev_find_previous.png +share/icons/hicolor/16x16/actions/pikdev_openproject.png +share/icons/hicolor/16x16/actions/pikdev_readchip.png +share/icons/hicolor/16x16/actions/pikdev_verifychip.png +share/icons/hicolor/16x16/apps/pikdev.png +share/icons/hicolor/22x22/actions/pikdev_addcurrentfile.png +share/icons/hicolor/22x22/actions/pikdev_addfile.png +share/icons/hicolor/22x22/actions/pikdev_burnchip.png +share/icons/hicolor/22x22/actions/pikdev_closeproject.png +share/icons/hicolor/22x22/actions/pikdev_compile.png +share/icons/hicolor/22x22/actions/pikdev_createproject.png +share/icons/hicolor/22x22/actions/pikdev_chip.png +share/icons/hicolor/22x22/actions/pikdev_decompile.png +share/icons/hicolor/22x22/actions/pikdev_editproject.png +share/icons/hicolor/22x22/actions/pikdev_erasechip.png +share/icons/hicolor/22x22/actions/pikdev_find_next.png +share/icons/hicolor/22x22/actions/pikdev_find_previous.png +share/icons/hicolor/22x22/actions/pikdev_openproject.png +share/icons/hicolor/22x22/actions/pikdev_readchip.png +share/icons/hicolor/22x22/actions/pikdev_verifychip.png +share/icons/hicolor/32x32/actions/pikdev_config_asm.png +share/icons/hicolor/32x32/actions/pikdev_config_general.png +share/icons/hicolor/32x32/actions/pikdev_config_prg.png +share/icons/hicolor/32x32/apps/pikdev.png +%%NLS%%share/locale/de/LC_MESSAGES/pikdev.mo +%%NLS%%share/locale/es/LC_MESSAGES/pikdev.mo +%%NLS%%share/locale/fr/LC_MESSAGES/pikdev.mo +%%NLS%%share/locale/it/LC_MESSAGES/pikdev.mo +@dirrm share/apps/pikdev/pics +@dirrm share/apps/pikdev