summaryrefslogtreecommitdiff
path: root/cross/bossa
diff options
context:
space:
mode:
authorreinoud <reinoud>2014-01-14 15:36:59 +0000
committerreinoud <reinoud>2014-01-14 15:36:59 +0000
commit0e9d5eabd85dbcd04d02bbeb492cd8d98fa6a35c (patch)
tree0287840dba4a11022ba0dd69ba7371f08a21c882 /cross/bossa
parentf522545752055783774913a5a3e0e9c50a661148 (diff)
downloadpkgsrc-0e9d5eabd85dbcd04d02bbeb492cd8d98fa6a35c.tar.gz
Add bossa-20140109:
BOSSA is a flash programming utility for Atmel's SAM family of flash-based ARM microcontrollers. The motivation behind BOSSA is to create a simple, easy-to-use, open source utility to replace Atmel's SAM-BA software.
Diffstat (limited to 'cross/bossa')
-rw-r--r--cross/bossa/DESCR3
-rw-r--r--cross/bossa/Makefile28
-rw-r--r--cross/bossa/PLIST4
-rw-r--r--cross/bossa/distinfo7
-rwxr-xr-xcross/bossa/files/NetBSDPortFactory.cpp83
-rwxr-xr-xcross/bossa/files/NetBSDPortFactory.h47
-rw-r--r--cross/bossa/patches/patch-Makefile-NetBSD27
-rw-r--r--cross/bossa/patches/patch-PortFactory.h16
8 files changed, 215 insertions, 0 deletions
diff --git a/cross/bossa/DESCR b/cross/bossa/DESCR
new file mode 100644
index 00000000000..6b4f4f81d17
--- /dev/null
+++ b/cross/bossa/DESCR
@@ -0,0 +1,3 @@
+BOSSA is a flash programming utility for Atmel's SAM family of flash-based ARM
+microcontrollers. The motivation behind BOSSA is to create a simple,
+easy-to-use, open source utility to replace Atmel's SAM-BA software.
diff --git a/cross/bossa/Makefile b/cross/bossa/Makefile
new file mode 100644
index 00000000000..73d76b741e3
--- /dev/null
+++ b/cross/bossa/Makefile
@@ -0,0 +1,28 @@
+# $NetBSD: Makefile,v 1.1 2014/01/14 15:36:59 reinoud Exp $
+
+PKGNAME= bossa-20140109
+DISTNAME= b-o-s-s-a-code-05bfcc39bc0453c3028b1161175b95a81af7a901
+CATEGORIES= comms
+MASTER_SITES= http://sourceforge.net/code-snapshots/git/b/b-/b-o-s-s-a/code.git/
+EXTRACT_SUFX= .zip
+
+MAINTAINER= pkgsrc@NetBSD.org
+HOMEPAGE= http://sourceforge.net/code-snapshots/git/b/b-/b-o-s-s-a/code.git/
+COMMENT= Open source SAM-BA compatible Atmel ARM programmer
+LICENSE= gnu-gpl-v3
+
+INSTALLATION_DIRS= bin
+
+post-patch:
+ ${CP} files/* ${WRKSRC}/src/
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/bin/* ${DESTDIR}${PREFIX}/bin
+
+
+USE_LANGUAGES= c++
+USE_TOOLS= gmake
+
+.include "../../devel/readline/buildlink3.mk"
+.include "../../x11/wxGTK28/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/cross/bossa/PLIST b/cross/bossa/PLIST
new file mode 100644
index 00000000000..622b12d0424
--- /dev/null
+++ b/cross/bossa/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1 2014/01/14 15:36:59 reinoud Exp $
+bin/bossa
+bin/bossac
+bin/bossash
diff --git a/cross/bossa/distinfo b/cross/bossa/distinfo
new file mode 100644
index 00000000000..96a48fd711c
--- /dev/null
+++ b/cross/bossa/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2014/01/14 15:36:59 reinoud Exp $
+
+SHA1 (b-o-s-s-a-code-05bfcc39bc0453c3028b1161175b95a81af7a901.zip) = 4a21cb6c19ad755fd31f6f0b96b6b1dd997c62c9
+RMD160 (b-o-s-s-a-code-05bfcc39bc0453c3028b1161175b95a81af7a901.zip) = eb9cc01f00bf9c8f1d59ea11e0b8cede532e4829
+Size (b-o-s-s-a-code-05bfcc39bc0453c3028b1161175b95a81af7a901.zip) = 692158 bytes
+SHA1 (patch-Makefile-NetBSD) = 5d3e27bc19ae7a4b8a6b36866da6efc025ab243a
+SHA1 (patch-PortFactory.h) = da62cd3b41297401b2a7fbdabf507678e492409c
diff --git a/cross/bossa/files/NetBSDPortFactory.cpp b/cross/bossa/files/NetBSDPortFactory.cpp
new file mode 100755
index 00000000000..1bf99fe2e68
--- /dev/null
+++ b/cross/bossa/files/NetBSDPortFactory.cpp
@@ -0,0 +1,83 @@
+///////////////////////////////////////////////////////////////////////////////
+// BOSSA
+//
+// Copyright (C) 2011-2012 ShumaTech http://www.shumatech.com/
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+///////////////////////////////////////////////////////////////////////////////
+#include "NetBSDPortFactory.h"
+#include "PosixSerialPort.h"
+
+#include <string.h>
+#include <stdio.h>
+
+#include <string>
+
+NetBSDPortFactory::NetBSDPortFactory()
+{
+ _dir = opendir("/dev");
+}
+
+NetBSDPortFactory::~NetBSDPortFactory()
+{
+ if (_dir)
+ closedir(_dir);
+}
+
+SerialPort::Ptr
+NetBSDPortFactory::create(const std::string& name)
+{
+ bool isUsb = false;
+
+ if (name.find("ttyU") != std::string::npos)
+ isUsb = true;
+
+ return SerialPort::Ptr(new PosixSerialPort(name, isUsb));
+}
+
+std::string
+NetBSDPortFactory::begin()
+{
+ if (!_dir)
+ return end();
+
+ rewinddir(_dir);
+
+ return next();
+}
+
+std::string
+NetBSDPortFactory::next()
+{
+ struct dirent* entry;
+
+ if (!_dir)
+ return end();
+
+ while ((entry = readdir(_dir)))
+ {
+ if (strncmp("ttyU", entry->d_name, sizeof("ttyU") - 1) == 0)
+ return std::string(entry->d_name);
+ else if (strncmp("ttyS", entry->d_name, sizeof("ttyS") - 1) == 0)
+ return std::string(entry->d_name);
+ }
+
+ return end();
+}
+
+std::string
+NetBSDPortFactory::end()
+{
+ return std::string();
+}
diff --git a/cross/bossa/files/NetBSDPortFactory.h b/cross/bossa/files/NetBSDPortFactory.h
new file mode 100755
index 00000000000..d48514630e1
--- /dev/null
+++ b/cross/bossa/files/NetBSDPortFactory.h
@@ -0,0 +1,47 @@
+///////////////////////////////////////////////////////////////////////////////
+// BOSSA
+//
+// Copyright (C) 2011-2012 ShumaTech http://www.shumatech.com/
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+///////////////////////////////////////////////////////////////////////////////
+#ifndef _NETBSDPORTFACTORY_H
+#define _NETBSDPORTFACTORY_H
+
+#include "SerialPort.h"
+
+#include <sys/types.h>
+#include <dirent.h>
+
+#include <string>
+
+
+class NetBSDPortFactory
+{
+public:
+ NetBSDPortFactory();
+ virtual ~NetBSDPortFactory();
+
+ virtual std::string begin();
+ virtual std::string end();
+ virtual std::string next();
+
+ virtual SerialPort::Ptr create(const std::string& name);
+
+private:
+ std::string _empty;
+ DIR* _dir;
+};
+
+#endif // _NETBSDPORTFACTORY_H
diff --git a/cross/bossa/patches/patch-Makefile-NetBSD b/cross/bossa/patches/patch-Makefile-NetBSD
new file mode 100644
index 00000000000..3f1924bce91
--- /dev/null
+++ b/cross/bossa/patches/patch-Makefile-NetBSD
@@ -0,0 +1,27 @@
+$NetBSD: patch-Makefile-NetBSD,v 1.1 2014/01/14 15:36:59 reinoud Exp $
+
+# Patching for NetBSD serial port detection code
+
+--- /usr/tmp/pkgsrc-aspire/comms/bossa/work/b-o-s-s-a-code-05bfcc39bc0453c3028b1161175b95a81af7a901/Makefile.orig 2012-04-08 13:55:52.000000000 +0000
++++ /usr/tmp/pkgsrc-aspire/comms/bossa/work/b-o-s-s-a-code-05bfcc39bc0453c3028b1161175b95a81af7a901/Makefile
+@@ -75,6 +75,20 @@ install: strip
+ endif
+
+ #
++# NetBSD rules
++#
++ifeq ($(OS),NetBSD)
++COMMON_SRCS+=PosixSerialPort.cpp NetBSDPortFactory.cpp
++COMMON_LIBS=-Wl,--as-needed
++WX_LIBS+=-lX11
++
++MACHINE:=$(shell uname -m)
++
++install: strip
++ tar cvzf $(BINDIR)/bossa-$(MACHINE)-$(VERSION).tgz -C $(BINDIR) bossa$(EXE) bossac$(EXE) bossash$(EXE)
++endif
++
++#
+ # OS X rules
+ #
+ ifeq ($(OS),Darwin)
diff --git a/cross/bossa/patches/patch-PortFactory.h b/cross/bossa/patches/patch-PortFactory.h
new file mode 100644
index 00000000000..d4a74a17dc6
--- /dev/null
+++ b/cross/bossa/patches/patch-PortFactory.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-PortFactory.h,v 1.1 2014/01/14 15:36:59 reinoud Exp $
+
+Add NetBSDPortFactory class
+
+--- /usr/tmp/pkgsrc-aspire/comms/bossa/work/b-o-s-s-a-code-05bfcc39bc0453c3028b1161175b95a81af7a901/src/PortFactory.h.orig 2012-04-08 13:55:52.000000000 +0000
++++ /usr/tmp/pkgsrc-aspire/comms/bossa/work/b-o-s-s-a-code-05bfcc39bc0453c3028b1161175b95a81af7a901/src/PortFactory.h
+@@ -45,6 +45,9 @@ typedef LinuxPortFactory PortFactory;
+ #elif defined(__APPLE__)
+ #include "OSXPortFactory.h"
+ typedef OSXPortFactory PortFactory;
++#elif defined(__NetBSD__)
++#include "NetBSDPortFactory.h"
++typedef NetBSDPortFactory PortFactory;
+ #else
+ #error "Platform is not supported"
+ #endif