summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD19
-rw-r--r--catkin.patch60
-rw-r--r--cmake.patch82
-rw-r--r--serialConfig.cmake14
-rw-r--r--serialConfigVersion.cmake21
6 files changed, 138 insertions, 70 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 52939228b26..39d6aa16545 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Fri Feb 19 00:26:47 UTC 2016
+# Thu Feb 16 20:55:41 UTC 2017
pkgbase = serial
pkgdesc = Cross-platform, Serial Port library written in C++
pkgver = 1.2.1
- pkgrel = 1
+ pkgrel = 2
url = http://wjwwood.io/serial/
arch = i686
arch = x86_64
@@ -15,10 +15,14 @@ pkgbase = serial
makedepends = cmake
makedepends = doxygen
source = https://github.com/wjwwood/serial/archive/1.2.1.tar.gz
- source = catkin.patch
+ source = cmake.patch
+ source = serialConfig.cmake
+ source = serialConfigVersion.cmake
source = LICENSE.txt
md5sums = b6d9ebdf821654715656577652b61b64
- md5sums = 49def33e7828e316c1baa66a69f8ba19
+ md5sums = 2a78667cd11a34cd24942037161861a5
+ md5sums = 4d13cd57ee5182a83f3dee5181a83162
+ md5sums = 8f756a98aad99d2f89d6969e4e6dd7d5
md5sums = cf59308969fbe23545aa5679666b553b
pkgname = serial
diff --git a/PKGBUILD b/PKGBUILD
index b82d2009b09..98aa6c9fb9f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,27 +2,34 @@
pkgname=serial
pkgver=1.2.1
-pkgrel=1
+pkgrel=2
pkgdesc="Cross-platform, Serial Port library written in C++"
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
url="http://wjwwood.io/serial/"
license=('MIT')
makedepends=('cmake' 'doxygen')
source=("https://github.com/wjwwood/${pkgname}/archive/${pkgver}.tar.gz"
- "catkin.patch"
+ "cmake.patch"
+ "serialConfig.cmake"
+ "serialConfigVersion.cmake"
"LICENSE.txt")
md5sums=('b6d9ebdf821654715656577652b61b64'
- '49def33e7828e316c1baa66a69f8ba19'
- 'cf59308969fbe23545aa5679666b553b')
+ '2a78667cd11a34cd24942037161861a5'
+ '4d13cd57ee5182a83f3dee5181a83162'
+ '8f756a98aad99d2f89d6969e4e6dd7d5'
+ 'cf59308969fbe23545aa5679666b553b')
prepare() {
cd "$srcdir/$pkgname-$pkgver"
- patch -p1 -i ../catkin.patch
+ patch -p1 -i ../cmake.patch
+ rm -rf cmake && mkdir cmake
+ cp ../serialConfig.cmake cmake/
+ cp ../serialConfigVersion.cmake cmake/
}
build() {
cd "$srcdir/$pkgname-$pkgver"
- mkdir build
+ rm -rf build && mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
diff --git a/catkin.patch b/catkin.patch
deleted file mode 100644
index 957dd59e77a..00000000000
--- a/catkin.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff -aur serial-1.2.1.pristine/CMakeLists.txt serial-1.2.1.new/CMakeLists.txt
---- serial-1.2.1.pristine/CMakeLists.txt 2016-02-18 23:09:09.037989467 +0100
-+++ serial-1.2.1.new/CMakeLists.txt 2016-02-19 01:19:59.568329056 +0100
-@@ -2,26 +2,34 @@
- project(serial)
-
- # Find catkin
--find_package(catkin REQUIRED)
-+option(BUILD_WITH_CATKIN "Build using catkin" OFF)
-+if(BUILD_WITH_CATKIN)
-+ find_package(catkin REQUIRED)
-+endif()
-
- if(APPLE)
- find_library(IOKIT_LIBRARY IOKit)
- find_library(FOUNDATION_LIBRARY Foundation)
- endif()
-
--if(UNIX AND NOT APPLE)
-- # If Linux, add rt and pthread
-- catkin_package(
-- LIBRARIES ${PROJECT_NAME}
-- INCLUDE_DIRS include
-- DEPENDS rt pthread
-- )
-+if(catkin_FOUND)
-+ if(UNIX AND NOT APPLE)
-+ # If Linux, add rt and pthread
-+ catkin_package(
-+ LIBRARIES ${PROJECT_NAME}
-+ INCLUDE_DIRS include
-+ DEPENDS rt pthread
-+ )
-+ else()
-+ # Otherwise normal call
-+ catkin_package(
-+ LIBRARIES ${PROJECT_NAME}
-+ INCLUDE_DIRS include
-+ )
-+ endif()
- else()
-- # Otherwise normal call
-- catkin_package(
-- LIBRARIES ${PROJECT_NAME}
-- INCLUDE_DIRS include
-- )
-+ set(CATKIN_PACKAGE_LIB_DESTINATION lib)
-+ set(CATKIN_GLOBAL_INCLUDE_DESTINATION include)
- endif()
-
- ## Sources
-@@ -45,7 +53,7 @@
- endif()
-
- ## Add serial library
--add_library(${PROJECT_NAME} ${serial_SRCS})
-+add_library(${PROJECT_NAME} SHARED ${serial_SRCS})
- if(APPLE)
- target_link_libraries(${PROJECT_NAME} ${FOUNDATION_LIBRARY} ${IOKIT_LIBRARY})
- elseif(UNIX)
diff --git a/cmake.patch b/cmake.patch
new file mode 100644
index 00000000000..6bd0b786cf0
--- /dev/null
+++ b/cmake.patch
@@ -0,0 +1,82 @@
+diff -aur serial-1.2.1.pristine/CMakeLists.txt serial-1.2.1.new/CMakeLists.txt
+--- serial-1.2.1.pristine/CMakeLists.txt 2015-04-22 06:50:41.000000000 +0200
++++ serial-1.2.1.new/CMakeLists.txt 2017-02-16 21:08:44.642188817 +0100
+@@ -1,29 +1,11 @@
+ cmake_minimum_required(VERSION 2.8.3)
+ project(serial)
+
+-# Find catkin
+-find_package(catkin REQUIRED)
+-
+ if(APPLE)
+ find_library(IOKIT_LIBRARY IOKit)
+ find_library(FOUNDATION_LIBRARY Foundation)
+ endif()
+
+-if(UNIX AND NOT APPLE)
+- # If Linux, add rt and pthread
+- catkin_package(
+- LIBRARIES ${PROJECT_NAME}
+- INCLUDE_DIRS include
+- DEPENDS rt pthread
+- )
+-else()
+- # Otherwise normal call
+- catkin_package(
+- LIBRARIES ${PROJECT_NAME}
+- INCLUDE_DIRS include
+- )
+-endif()
+-
+ ## Sources
+ set(serial_SRCS
+ src/serial.cc
+@@ -45,7 +27,7 @@
+ endif()
+
+ ## Add serial library
+-add_library(${PROJECT_NAME} ${serial_SRCS})
++add_library(${PROJECT_NAME} STATIC ${serial_SRCS})
+ if(APPLE)
+ target_link_libraries(${PROJECT_NAME} ${FOUNDATION_LIBRARY} ${IOKIT_LIBRARY})
+ elseif(UNIX)
+@@ -54,7 +36,7 @@
+ target_link_libraries(${PROJECT_NAME} setupapi)
+ endif()
+
+-## Uncomment for example
++## Add example project
+ add_executable(serial_example examples/serial_example.cc)
+ add_dependencies(serial_example ${PROJECT_NAME})
+ target_link_libraries(serial_example ${PROJECT_NAME})
+@@ -62,17 +44,23 @@
+ ## Include headers
+ include_directories(include)
+
++## Install
++set(INSTALL_LIB_DIR lib)
++set(INSTALL_INCLUDE_DIR include)
++set(INSTALL_CMAKE_DIR share/serial/cmake)
++
+ ## Install executable
+ install(TARGETS ${PROJECT_NAME}
+- ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
+- LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
++ DESTINATION ${INSTALL_LIB_DIR}
++ EXPORT ${PROJECT_NAME}-targets
+ )
+
+ ## Install headers
+ install(FILES include/serial/serial.h include/serial/v8stdint.h
+- DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/serial)
++ DESTINATION ${INSTALL_INCLUDE_DIR}/serial)
+
+-## Tests
+-if(CATKIN_ENABLE_TESTING)
+- add_subdirectory(tests)
+-endif()
++## Install CMake files
++install(EXPORT ${PROJECT_NAME}-targets DESTINATION ${INSTALL_CMAKE_DIR})
++
++install(FILES ${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake ${CMAKE_SOURCE_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake
++ DESTINATION ${INSTALL_CMAKE_DIR})
diff --git a/serialConfig.cmake b/serialConfig.cmake
new file mode 100644
index 00000000000..88a03b97db2
--- /dev/null
+++ b/serialConfig.cmake
@@ -0,0 +1,14 @@
+# Usage:
+#
+# find_package(serial REQUIRED)
+# include_directories(${serial_INCLUDE_DIRS})
+# target_link_libraries(<target> serial)
+
+if(serial_CONFIG_INCLUDED)
+ return()
+endif()
+set(serial_CONFIG_INCLUDED TRUE)
+
+get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+include(${SELF_DIR}/serial-targets.cmake)
+get_filename_component(serial_INCLUDE_DIRS "${SELF_DIR}/../../../include" ABSOLUTE)
diff --git a/serialConfigVersion.cmake b/serialConfigVersion.cmake
new file mode 100644
index 00000000000..cf8dbb5aeb7
--- /dev/null
+++ b/serialConfigVersion.cmake
@@ -0,0 +1,21 @@
+set(PACKAGE_VERSION "1.2.1")
+
+if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else()
+ if(PACKAGE_VERSION MATCHES "^([0-9]+)\\.")
+ set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
+ else()
+ set(CVF_VERSION_MAJOR PACKAGE_VERSION)
+ endif()
+
+ if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ else()
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+ endif()
+
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
+ set(PACKAGE_VERSION_EXACT TRUE)
+ endif()
+endif()