summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Veness2015-08-09 00:23:11 -0700
committerTyler Veness2015-08-12 03:25:16 -0700
commit5caac8856f58118dd0b22954f8ab1e7bc76dfff7 (patch)
tree99233eb0c2f0d73067ca5171cc6647f0d1a66d62
parentba10f2ce133495a20c83b21dcc26b65de4955db4 (diff)
downloadaur-5caac8856f58118dd0b22954f8ab1e7bc76dfff7.tar.gz
Package now builds using gradle instead of CMake since the latter is no longer supported by allwpilib
-rw-r--r--.SRCINFO4
-rw-r--r--0001-Fixed-build-failures-introduced-by-43f1651.-Headers-.patch445
-rw-r--r--PKGBUILD32
3 files changed, 13 insertions, 468 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ce270c321e3f..c9773473501b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -7,17 +7,15 @@ pkgbase = arm-frc-linux-gnueabi-wpilib-git
arch = x86_64
groups = frc-2015
license = custom=FRC-BSD
- makedepends = cmake
makedepends = git
depends = arm-frc-linux-gnueabi-gcc
provides = arm-frc-linux-gnueabi-wpilib
options = !strip
options = libtool
options = staticlibs
+ options = !emptydirs
source = git+https://usfirst.collab.net/gerrit/allwpilib
- source = 0001-Fixed-build-failures-introduced-by-43f1651.-Headers-.patch
sha512sums = SKIP
- sha512sums = cad43e25abd72403fffde532e0a6766509ecff9165f1ca1f50b5973f2df3bbe3655332a7f458401855cc21835acf54a95719c4f9bb932d224bbb8df747463183
pkgname = arm-frc-linux-gnueabi-wpilib-git
diff --git a/0001-Fixed-build-failures-introduced-by-43f1651.-Headers-.patch b/0001-Fixed-build-failures-introduced-by-43f1651.-Headers-.patch
deleted file mode 100644
index 2f68dd9b92ad..000000000000
--- a/0001-Fixed-build-failures-introduced-by-43f1651.-Headers-.patch
+++ /dev/null
@@ -1,445 +0,0 @@
-From a1818850834205d0a2a315ce452d5bd357a6cc86 Mon Sep 17 00:00:00 2001
-From: Tyler Veness <calcmogul@gmail.com>
-Date: Fri, 31 Jul 2015 21:06:47 -0700
-Subject: [PATCH] Fixed build failures introduced by 43f1651. Headers are
- missing in robot projects which use CANTalon.
-
-Change-Id: If840154d6a75a391ccd19b63f3f47b17c1cb87e1
----
- hal/include/HAL/CanTalonSRX.h | 1 -
- hal/include/HAL/ctre/CtreCanNode.h | 115 ++++++++++++++++++++++++++++++++++++
- hal/include/HAL/ctre/ctre.h | 50 ++++++++++++++++
- hal/lib/Athena/HAL.cpp | 2 +-
- hal/lib/Athena/ctre/CtreCanNode.cpp | 2 +-
- hal/lib/Athena/ctre/CtreCanNode.h | 115 ------------------------------------
- hal/lib/Athena/ctre/PCM.h | 3 +-
- hal/lib/Athena/ctre/PDP.h | 3 +-
- hal/lib/Athena/ctre/ctre.h | 50 ----------------
- 9 files changed, 169 insertions(+), 172 deletions(-)
- create mode 100644 hal/include/HAL/ctre/CtreCanNode.h
- create mode 100644 hal/include/HAL/ctre/ctre.h
- delete mode 100644 hal/lib/Athena/ctre/CtreCanNode.h
- delete mode 100644 hal/lib/Athena/ctre/ctre.h
-
-diff --git a/hal/include/HAL/CanTalonSRX.h b/hal/include/HAL/CanTalonSRX.h
-index f04ce3c..f59b02c 100644
---- a/hal/include/HAL/CanTalonSRX.h
-+++ b/hal/include/HAL/CanTalonSRX.h
-@@ -71,7 +71,6 @@
- */
- #ifndef CanTalonSRX_H_
- #define CanTalonSRX_H_
--#include "ctre/ctre.h" //BIT Defines + Typedefs
- #include "ctre/CtreCanNode.h"
- #include <NetworkCommunication/CANSessionMux.h> //CAN Comm
- #include <map>
-diff --git a/hal/include/HAL/ctre/CtreCanNode.h b/hal/include/HAL/ctre/CtreCanNode.h
-new file mode 100644
-index 0000000..70ce567
---- /dev/null
-+++ b/hal/include/HAL/ctre/CtreCanNode.h
-@@ -0,0 +1,115 @@
-+#ifndef CtreCanNode_H_
-+#define CtreCanNode_H_
-+#include "ctre.h" //BIT Defines + Typedefs
-+#include <NetworkCommunication/CANSessionMux.h> //CAN Comm
-+#include <map>
-+#include <string.h> // memcpy
-+#include <sys/time.h>
-+class CtreCanNode
-+{
-+public:
-+ CtreCanNode(UINT8 deviceNumber);
-+ ~CtreCanNode();
-+
-+ UINT8 GetDeviceNumber()
-+ {
-+ return _deviceNumber;
-+ }
-+protected:
-+
-+
-+ template <typename T> class txTask{
-+ public:
-+ uint32_t arbId;
-+ T * toSend;
-+ T * operator -> ()
-+ {
-+ return toSend;
-+ }
-+ T & operator*()
-+ {
-+ return *toSend;
-+ }
-+ bool IsEmpty()
-+ {
-+ if(toSend == 0)
-+ return true;
-+ return false;
-+ }
-+ };
-+ template <typename T> class recMsg{
-+ public:
-+ uint32_t arbId;
-+ uint8_t bytes[8];
-+ CTR_Code err;
-+ T * operator -> ()
-+ {
-+ return (T *)bytes;
-+ }
-+ T & operator*()
-+ {
-+ return *(T *)bytes;
-+ }
-+ };
-+ UINT8 _deviceNumber;
-+ void RegisterRx(uint32_t arbId);
-+ void RegisterTx(uint32_t arbId, uint32_t periodMs);
-+
-+ CTR_Code GetRx(uint32_t arbId,uint8_t * dataBytes,uint32_t timeoutMs);
-+ void FlushTx(uint32_t arbId);
-+
-+ template<typename T> txTask<T> GetTx(uint32_t arbId)
-+ {
-+ txTask<T> retval = {0, nullptr};
-+ txJobs_t::iterator i = _txJobs.find(arbId);
-+ if(i != _txJobs.end()){
-+ retval.arbId = i->second.arbId;
-+ retval.toSend = (T*)i->second.toSend;
-+ }
-+ return retval;
-+ }
-+ template<class T> void FlushTx(T & par)
-+ {
-+ FlushTx(par.arbId);
-+ }
-+
-+ template<class T> recMsg<T> GetRx(uint32_t arbId, uint32_t timeoutMs)
-+ {
-+ recMsg<T> retval;
-+ retval.err = GetRx(arbId,retval.bytes, timeoutMs);
-+ return retval;
-+ }
-+
-+private:
-+
-+ class txJob_t {
-+ public:
-+ uint32_t arbId;
-+ uint8_t toSend[8];
-+ uint32_t periodMs;
-+ };
-+
-+ class rxEvent_t{
-+ public:
-+ uint8_t bytes[8];
-+ struct timespec time;
-+ rxEvent_t()
-+ {
-+ bytes[0] = 0;
-+ bytes[1] = 0;
-+ bytes[2] = 0;
-+ bytes[3] = 0;
-+ bytes[4] = 0;
-+ bytes[5] = 0;
-+ bytes[6] = 0;
-+ bytes[7] = 0;
-+ }
-+ };
-+
-+ typedef std::map<uint32_t,txJob_t> txJobs_t;
-+ txJobs_t _txJobs;
-+
-+ typedef std::map<uint32_t,rxEvent_t> rxRxEvents_t;
-+ rxRxEvents_t _rxRxEvents;
-+};
-+#endif
-diff --git a/hal/include/HAL/ctre/ctre.h b/hal/include/HAL/ctre/ctre.h
-new file mode 100644
-index 0000000..c2d3f69
---- /dev/null
-+++ b/hal/include/HAL/ctre/ctre.h
-@@ -0,0 +1,50 @@
-+#ifndef GLOBAL_H
-+#define GLOBAL_H
-+
-+//Bit Defines
-+#define BIT0 0x01
-+#define BIT1 0x02
-+#define BIT2 0x04
-+#define BIT3 0x08
-+#define BIT4 0x10
-+#define BIT5 0x20
-+#define BIT6 0x40
-+#define BIT7 0x80
-+#define BIT8 0x0100
-+#define BIT9 0x0200
-+#define BIT10 0x0400
-+#define BIT11 0x0800
-+#define BIT12 0x1000
-+#define BIT13 0x2000
-+#define BIT14 0x4000
-+#define BIT15 0x8000
-+
-+//Signed
-+typedef signed char INT8;
-+typedef signed short INT16;
-+typedef signed int INT32;
-+typedef signed long long INT64;
-+
-+//Unsigned
-+typedef unsigned char UINT8;
-+typedef unsigned short UINT16;
-+typedef unsigned int UINT32;
-+typedef unsigned long long UINT64;
-+
-+//Other
-+typedef unsigned char UCHAR;
-+typedef unsigned short USHORT;
-+typedef unsigned int UINT;
-+typedef unsigned long ULONG;
-+
-+typedef enum {
-+ CTR_OKAY, //!< No Error - Function executed as expected
-+ CTR_RxTimeout, //!< CAN frame has not been received within specified period of time.
-+ CTR_TxTimeout, //!< Not used.
-+ CTR_InvalidParamValue, //!< Caller passed an invalid param
-+ CTR_UnexpectedArbId, //!< Specified CAN Id is invalid.
-+ CTR_TxFailed, //!< Could not transmit the CAN frame.
-+ CTR_SigNotUpdated, //!< Have not received an value response for signal.
-+}CTR_Code;
-+
-+#endif
-diff --git a/hal/lib/Athena/HAL.cpp b/hal/lib/Athena/HAL.cpp
-index 185f2be..3aac51f 100644
---- a/hal/lib/Athena/HAL.cpp
-+++ b/hal/lib/Athena/HAL.cpp
-@@ -2,7 +2,7 @@
-
- #include "HAL/Port.h"
- #include "HAL/Errors.hpp"
--#include "ctre/ctre.h"
-+#include "HAL/ctre/ctre.h"
- #include "visa/visa.h"
- #include "ChipObject.h"
- #include "NetworkCommunication/FRCComm.h"
-diff --git a/hal/lib/Athena/ctre/CtreCanNode.cpp b/hal/lib/Athena/ctre/CtreCanNode.cpp
-index b2e3620..1c6243e 100644
---- a/hal/lib/Athena/ctre/CtreCanNode.cpp
-+++ b/hal/lib/Athena/ctre/CtreCanNode.cpp
-@@ -1,6 +1,6 @@
- #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
-
--#include "CtreCanNode.h"
-+#include <HAL/ctre/CtreCanNode.h>
- #include "NetworkCommunication/CANSessionMux.h"
- #include <string.h> // memset
- #include <unistd.h> // usleep
-diff --git a/hal/lib/Athena/ctre/CtreCanNode.h b/hal/lib/Athena/ctre/CtreCanNode.h
-deleted file mode 100644
-index 70ce567..0000000
---- a/hal/lib/Athena/ctre/CtreCanNode.h
-+++ /dev/null
-@@ -1,115 +0,0 @@
--#ifndef CtreCanNode_H_
--#define CtreCanNode_H_
--#include "ctre.h" //BIT Defines + Typedefs
--#include <NetworkCommunication/CANSessionMux.h> //CAN Comm
--#include <map>
--#include <string.h> // memcpy
--#include <sys/time.h>
--class CtreCanNode
--{
--public:
-- CtreCanNode(UINT8 deviceNumber);
-- ~CtreCanNode();
--
-- UINT8 GetDeviceNumber()
-- {
-- return _deviceNumber;
-- }
--protected:
--
--
-- template <typename T> class txTask{
-- public:
-- uint32_t arbId;
-- T * toSend;
-- T * operator -> ()
-- {
-- return toSend;
-- }
-- T & operator*()
-- {
-- return *toSend;
-- }
-- bool IsEmpty()
-- {
-- if(toSend == 0)
-- return true;
-- return false;
-- }
-- };
-- template <typename T> class recMsg{
-- public:
-- uint32_t arbId;
-- uint8_t bytes[8];
-- CTR_Code err;
-- T * operator -> ()
-- {
-- return (T *)bytes;
-- }
-- T & operator*()
-- {
-- return *(T *)bytes;
-- }
-- };
-- UINT8 _deviceNumber;
-- void RegisterRx(uint32_t arbId);
-- void RegisterTx(uint32_t arbId, uint32_t periodMs);
--
-- CTR_Code GetRx(uint32_t arbId,uint8_t * dataBytes,uint32_t timeoutMs);
-- void FlushTx(uint32_t arbId);
--
-- template<typename T> txTask<T> GetTx(uint32_t arbId)
-- {
-- txTask<T> retval = {0, nullptr};
-- txJobs_t::iterator i = _txJobs.find(arbId);
-- if(i != _txJobs.end()){
-- retval.arbId = i->second.arbId;
-- retval.toSend = (T*)i->second.toSend;
-- }
-- return retval;
-- }
-- template<class T> void FlushTx(T & par)
-- {
-- FlushTx(par.arbId);
-- }
--
-- template<class T> recMsg<T> GetRx(uint32_t arbId, uint32_t timeoutMs)
-- {
-- recMsg<T> retval;
-- retval.err = GetRx(arbId,retval.bytes, timeoutMs);
-- return retval;
-- }
--
--private:
--
-- class txJob_t {
-- public:
-- uint32_t arbId;
-- uint8_t toSend[8];
-- uint32_t periodMs;
-- };
--
-- class rxEvent_t{
-- public:
-- uint8_t bytes[8];
-- struct timespec time;
-- rxEvent_t()
-- {
-- bytes[0] = 0;
-- bytes[1] = 0;
-- bytes[2] = 0;
-- bytes[3] = 0;
-- bytes[4] = 0;
-- bytes[5] = 0;
-- bytes[6] = 0;
-- bytes[7] = 0;
-- }
-- };
--
-- typedef std::map<uint32_t,txJob_t> txJobs_t;
-- txJobs_t _txJobs;
--
-- typedef std::map<uint32_t,rxEvent_t> rxRxEvents_t;
-- rxRxEvents_t _rxRxEvents;
--};
--#endif
-diff --git a/hal/lib/Athena/ctre/PCM.h b/hal/lib/Athena/ctre/PCM.h
-index a3c61ef..975f577 100644
---- a/hal/lib/Athena/ctre/PCM.h
-+++ b/hal/lib/Athena/ctre/PCM.h
-@@ -1,8 +1,7 @@
- #ifndef PCM_H_
- #define PCM_H_
--#include "ctre.h" //BIT Defines + Typedefs
- #include <NetworkCommunication/CANSessionMux.h> //CAN Comm
--#include "CtreCanNode.h"
-+#include <HAL/ctre/CtreCanNode.h>
- class PCM : public CtreCanNode
- {
- public:
-diff --git a/hal/lib/Athena/ctre/PDP.h b/hal/lib/Athena/ctre/PDP.h
-index 42b62a2..342b6e4 100644
---- a/hal/lib/Athena/ctre/PDP.h
-+++ b/hal/lib/Athena/ctre/PDP.h
-@@ -1,8 +1,7 @@
- #ifndef PDP_H_
- #define PDP_H_
--#include "ctre.h" //BIT Defines + Typedefs
- #include <NetworkCommunication/CANSessionMux.h> //CAN Comm
--#include "CtreCanNode.h"
-+#include <HAL/ctre/CtreCanNode.h>
- class PDP : public CtreCanNode
- {
- public:
-diff --git a/hal/lib/Athena/ctre/ctre.h b/hal/lib/Athena/ctre/ctre.h
-deleted file mode 100644
-index c2d3f69..0000000
---- a/hal/lib/Athena/ctre/ctre.h
-+++ /dev/null
-@@ -1,50 +0,0 @@
--#ifndef GLOBAL_H
--#define GLOBAL_H
--
--//Bit Defines
--#define BIT0 0x01
--#define BIT1 0x02
--#define BIT2 0x04
--#define BIT3 0x08
--#define BIT4 0x10
--#define BIT5 0x20
--#define BIT6 0x40
--#define BIT7 0x80
--#define BIT8 0x0100
--#define BIT9 0x0200
--#define BIT10 0x0400
--#define BIT11 0x0800
--#define BIT12 0x1000
--#define BIT13 0x2000
--#define BIT14 0x4000
--#define BIT15 0x8000
--
--//Signed
--typedef signed char INT8;
--typedef signed short INT16;
--typedef signed int INT32;
--typedef signed long long INT64;
--
--//Unsigned
--typedef unsigned char UINT8;
--typedef unsigned short UINT16;
--typedef unsigned int UINT32;
--typedef unsigned long long UINT64;
--
--//Other
--typedef unsigned char UCHAR;
--typedef unsigned short USHORT;
--typedef unsigned int UINT;
--typedef unsigned long ULONG;
--
--typedef enum {
-- CTR_OKAY, //!< No Error - Function executed as expected
-- CTR_RxTimeout, //!< CAN frame has not been received within specified period of time.
-- CTR_TxTimeout, //!< Not used.
-- CTR_InvalidParamValue, //!< Caller passed an invalid param
-- CTR_UnexpectedArbId, //!< Specified CAN Id is invalid.
-- CTR_TxFailed, //!< Could not transmit the CAN frame.
-- CTR_SigNotUpdated, //!< Have not received an value response for signal.
--}CTR_Code;
--
--#endif
---
-2.5.0
-
diff --git a/PKGBUILD b/PKGBUILD
index 30e1ab89fcbf..df023ea12a33 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -10,36 +10,28 @@ url="https://usfirst.collab.net/sf/projects/wpilib/"
license=('custom=FRC-BSD')
groups=('frc-2015')
depends=('arm-frc-linux-gnueabi-gcc')
-makedepends=('cmake' 'git')
-options=('!strip' 'libtool' 'staticlibs')
-source=("git+https://usfirst.collab.net/gerrit/allwpilib"
- "0001-Fixed-build-failures-introduced-by-43f1651.-Headers-.patch")
-sha512sums=('SKIP'
- 'cad43e25abd72403fffde532e0a6766509ecff9165f1ca1f50b5973f2df3bbe3655332a7f458401855cc21835acf54a95719c4f9bb932d224bbb8df747463183')
+makedepends=('git')
+options=('!strip' 'libtool' 'staticlibs' '!emptydirs')
+source=("git+https://usfirst.collab.net/gerrit/allwpilib")
+sha512sums=('SKIP')
pkgver() {
cd allwpilib
echo $(git rev-list --count master).$(git rev-parse --short master)
}
-prepare() {
- cd "$srcdir/allwpilib"
-
- # Apply upstream patches
- patch -p1 < ../0001-Fixed-build-failures-introduced-by-43f1651.-Headers-.patch
-}
-
build() {
cd "$srcdir/allwpilib"
- mkdir build && cd build
- cmake .. -DCMAKE_TOOLCHAIN_FILE=../arm-toolchain.cmake
- make ${MAKEFLAGS} || return 1
+ ./gradlew wpilibcZip
}
package() {
- cd "$srcdir/allwpilib/build"
- make ${MAKEFLAGS} DESTDIR="${pkgdir}" install || return 1
- mv $pkgdir/usr/local $pkgdir/usr/arm-frc-linux-gnueabi
- install -Dm644 ../wpilibj/BSD_License_for_WPILib_code.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE
+ cd "$srcdir/allwpilib/wpilibc/build"
+ mkdir -p $pkgdir/usr/arm-frc-linux-gnueabi/share
+
+ yes A | unzip -d $pkgdir/usr/arm-frc-linux-gnueabi wpilibc.zip
+ mv $pkgdir/usr/arm-frc-linux-gnueabi/docs $pkgdir/usr/arm-frc-linux-gnueabi/share/doc
+
+ install -Dm644 ../../wpilibj/BSD_License_for_WPILib_code.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE
}
# vim:set ts=2 sw=2 et: