[hamradio-commits] [soapysdr] 01/03: Imported Upstream version 0.5.1

Andreas E. Bombe aeb at moszumanska.debian.org
Sun Aug 14 20:59:21 UTC 2016


This is an automated email from the git hooks/post-receive script.

aeb pushed a commit to branch master
in repository soapysdr.

commit f2a3539d27fff65f04ba129511fb16ca687d7472
Author: Andreas Bombe <aeb at debian.org>
Date:   Fri Aug 5 04:21:57 2016 +0200

    Imported Upstream version 0.5.1
---
 CMakeLists.txt               |  4 ++--
 Changelog.txt                | 12 ++++++++++--
 apps/SoapySDRUtil.cpp        |  1 +
 cmake/SoapySDRConfig.cmake   | 14 ++++++++++++++
 cmake/SoapySDRUtil.cmake     |  2 +-
 debian/changelog             | 18 ++++++++++++++++++
 debian/control               |  2 +-
 include/SoapySDR/Logger.h    |  2 +-
 include/SoapySDR/Logger.hpp  |  2 +-
 include/SoapySDR/Version.h   | 39 ++++++++++++++++++++++++++++++++++++---
 include/SoapySDR/Version.hpp | 23 +++++++++++++++++++----
 lib/CMakeLists.txt           | 12 +-----------
 lib/LoggerC.cpp              |  8 ++++----
 lib/Modules.in.cpp           |  7 ++++---
 lib/Version.in.cpp           | 14 ++++++++++++--
 lib/VersionC.cpp             |  8 +++++++-
 16 files changed, 132 insertions(+), 36 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b1a7b0..221b9bb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,7 @@ enable_testing()
 # gather version information
 # packagers may specify -DSOAPY_SDR_EXTVER="foo" to replace the git hash
 ########################################################################
-set(SOAPY_SDR_LIBVER "0.5.0")
+set(SOAPY_SDR_LIBVER "0.5.1")
 
 if (NOT SOAPY_SDR_EXTVER)
     include(${PROJECT_SOURCE_DIR}/cmake/GetGitRevisionDescription.cmake)
@@ -157,5 +157,5 @@ message(STATUS "## ${PROJECT_NAME} disabled features")
 message(STATUS "######################################################")
 feature_summary(WHAT DISABLED_FEATURES)
 message(STATUS "SoapySDR version: v${SOAPY_SDR_VERSION}")
-message(STATUS "ABI/so version: v${SOAPY_SDR_SOVER}")
+message(STATUS "ABI/so version: v${SOAPY_SDR_ABI_VERSION}")
 message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
diff --git a/Changelog.txt b/Changelog.txt
index e22fe36..8bd8c6d 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,6 +1,14 @@
 This this the changelog file for the SoapySDR project.
 
-Release 0.5.0 (pending)
+Release 0.5.1 (2016-08-02)
+==========================
+
+- Added SoapySDR_getLibVersion() and SOAPY_SDR_API_VERSION
+- debian allow any swig >= 2.0.0 using the swig meta-package
+- Only use stderr in the default logger for command line tools
+- ABI-specific modules directory for multi-version install
+
+Release 0.5.0 (2016-07-10)
 ==========================
 
 Deprecated Device API calls:
@@ -22,7 +30,7 @@ General additions and changes:
 - Use current DLL path to determine the system install root
 - Implemented channel-specific settings API
 
-Release 0.4.4 (pending)
+Release 0.4.4 (2016-07-10)
 ==========================
 
 - Add known python version 3.5 to FindPython3Libs.cmake
diff --git a/apps/SoapySDRUtil.cpp b/apps/SoapySDRUtil.cpp
index 18095d5..ed52a0a 100644
--- a/apps/SoapySDRUtil.cpp
+++ b/apps/SoapySDRUtil.cpp
@@ -34,6 +34,7 @@ static int printHelp(void)
  **********************************************************************/
 static int printInfo(void)
 {
+    std::cout << "Lib Version: v" << SoapySDR::getLibVersion() << std::endl;
     std::cout << "API Version: v" << SoapySDR::getAPIVersion() << std::endl;
     std::cout << "ABI Version: v" << SoapySDR::getABIVersion() << std::endl;
     std::cout << "Install root: " << SoapySDR::getRootPath() << std::endl;
diff --git a/cmake/SoapySDRConfig.cmake b/cmake/SoapySDRConfig.cmake
index 2af2d23..984e1a0 100644
--- a/cmake/SoapySDRConfig.cmake
+++ b/cmake/SoapySDRConfig.cmake
@@ -115,6 +115,18 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
 endif()
 
 ########################################################################
+# extract the ABI version string from the Version.h header
+########################################################################
+function(_SOAPY_SDR_GET_ABI_VERSION VERSION SOAPY_SDR_INCLUDE_DIR)
+    file(READ "${SOAPY_SDR_INCLUDE_DIR}/SoapySDR/Version.h" version_h)
+    string(REGEX MATCH "\\#define SOAPY_SDR_ABI_VERSION \"([0-9]+\\.[0-9]+-[0-9]+)\"" SOAPY_SDR_ABI_VERSION_MATCHES "${version_h}")
+    if(NOT SOAPY_SDR_ABI_VERSION_MATCHES)
+        message(FATAL_ERROR "Failed to extract version number from Version.h")
+    endif(NOT SOAPY_SDR_ABI_VERSION_MATCHES)
+    set(${VERSION} "${CMAKE_MATCH_1}" PARENT_SCOPE)
+endfunction(_SOAPY_SDR_GET_ABI_VERSION)
+
+########################################################################
 # In-tree settings
 ########################################################################
 if (SOAPY_SDR_IN_TREE_SOURCE_DIR)
@@ -123,6 +135,7 @@ if (SOAPY_SDR_IN_TREE_SOURCE_DIR)
     endif(NOT SOAPY_SDR_ROOT)
     set(SoapySDR_INCLUDE_DIRS ${SOAPY_SDR_IN_TREE_SOURCE_DIR}/include)
     set(SoapySDR_LIBRARIES SoapySDR)
+    _SOAPY_SDR_GET_ABI_VERSION(SOAPY_SDR_ABI_VERSION ${SoapySDR_INCLUDE_DIRS})
     return()
 endif (SOAPY_SDR_IN_TREE_SOURCE_DIR)
 
@@ -161,3 +174,4 @@ if(NOT SOAPY_SDR_INCLUDE_DIR)
     message(FATAL_ERROR "cannot find SoapySDR includes in ${SOAPY_SDR_ROOT}/include")
 endif()
 set(SoapySDR_INCLUDE_DIRS ${SOAPY_SDR_INCLUDE_DIR})
+_SOAPY_SDR_GET_ABI_VERSION(SOAPY_SDR_ABI_VERSION ${SoapySDR_INCLUDE_DIRS})
diff --git a/cmake/SoapySDRUtil.cmake b/cmake/SoapySDRUtil.cmake
index 96b89bd..26c5044 100644
--- a/cmake/SoapySDRUtil.cmake
+++ b/cmake/SoapySDRUtil.cmake
@@ -38,7 +38,7 @@ function(SOAPY_SDR_MODULE_UTIL)
     set_target_properties(${MODULE_TARGET} PROPERTIES DEBUG_POSTFIX "") #same name in debug mode
 
     if (NOT MODULE_DESTINATION)
-        set(MODULE_DESTINATION lib${LIB_SUFFIX}/SoapySDR/modules/)
+        set(MODULE_DESTINATION lib${LIB_SUFFIX}/SoapySDR/modules${SOAPY_SDR_ABI_VERSION}/)
     endif()
 
     if (MODULE_PREFIX)
diff --git a/debian/changelog b/debian/changelog
index bd47458..e5903a5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
+soapysdr (0.5.1) unstable; urgency=low
+
+  * Release 0.5.1 (2016-08-02)
+
+ -- Josh Blum <josh at pothosware.com>  Tue, 02 Aug 2016 14:55:15 -0700
+
+soapysdr (0.5.0) unstable; urgency=low
+
+  * Release 0.5.0 (2016-07-10)
+
+ -- Josh Blum <josh at pothosware.com>  Sun, 10 Jul 2016 16:59:08 -0700
+
+soapysdr (0.4.4) unstable; urgency=low
+
+  * Release 0.4.4 (2016-07-10)
+
+ -- Josh Blum <josh at pothosware.com>  Sun, 10 Jul 2016 16:55:33 -0700
+
 soapysdr (0.4.3) unstable; urgency=low
 
   * Release 0.4.3 (2016-04-21)
diff --git a/debian/control b/debian/control
index 10d5d4d..8a580ff 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Josh Blum <josh at pothosware.com>
 Build-Depends:
     debhelper (>= 9.0.0),
     cmake (>= 2.8.7),
-    swig2.0,
+    swig (>= 2.0.0),
     python,
     python-dev,
     python3,
diff --git a/include/SoapySDR/Logger.h b/include/SoapySDR/Logger.h
index 7f03ee6..24d28c2 100644
--- a/include/SoapySDR/Logger.h
+++ b/include/SoapySDR/Logger.h
@@ -3,7 +3,7 @@
 ///
 /// Logger API for SoapySDR devices.
 /// Implementations should use the logger rather than stdio.
-/// The default log handler prints to the stdout and stderr.
+/// The default log handler prints to stderr.
 ///
 /// \copyright
 /// Copyright (c) 2014-2015 Josh Blum
diff --git a/include/SoapySDR/Logger.hpp b/include/SoapySDR/Logger.hpp
index 2fad49d..f4b78f2 100644
--- a/include/SoapySDR/Logger.hpp
+++ b/include/SoapySDR/Logger.hpp
@@ -3,7 +3,7 @@
 ///
 /// Logger API for SoapySDR devices.
 /// Implementations should use the logger rather than stdio.
-/// The default log handler prints to the stdout and stderr.
+/// The default log handler prints to stderr.
 ///
 /// \copyright
 /// Copyright (c) 2014-2015 Josh Blum
diff --git a/include/SoapySDR/Version.h b/include/SoapySDR/Version.h
index e4b1446..049eb92 100644
--- a/include/SoapySDR/Version.h
+++ b/include/SoapySDR/Version.h
@@ -13,7 +13,27 @@
 #include <SoapySDR/Config.h>
 
 /*!
+ * API version number which can be used as a preprocessor check.
+ * The format of the version number is encoded as follows:
+ * <b>(major << 24) | (minor << 16) | (16 bit increment)</b>.
+ * Where the increment can be used to indicate implementation
+ * changes, fixes, or API additions within a minor release series.
+ *
+ * The macro is typically used in an application as follows:
+ * \code
+ * #if defined(SOAPY_SDR_API_VERSION) && (SOAPY_SDR_API_VERSION >= 0x00001234)
+ * // Use a newer feature from the SoapySDR library API
+ * #endif
+ * \endcode
+ */
+#define SOAPY_SDR_API_VERSION 0x00050001
+
+/*!
  * ABI Version Information - incremented when the ABI is changed.
+ * The ABI version format is <b>major.minor-bump</b>. The <i>major.minor</i>
+ * comes from the in-progress library version when the change was made,
+ * and <i>bump</i> signifies a change to the ABI during library development.
+ * The ABI should remain constant across patch releases of the library.
  */
 #define SOAPY_SDR_ABI_VERSION "0.5-2"
 
@@ -107,16 +127,29 @@ extern "C" {
 #endif
 
 /*!
- * Query the API version string.
+ * Get the SoapySDR library API version as a string.
+ * The format of the version string is <b>major.minor.increment</b>,
+ * where the digits are taken directly from <b>SOAPY_SDR_API_VERSION</b>.
  */
 SOAPY_SDR_API const char *SoapySDR_getAPIVersion(void);
 
 /*!
- * Get the ABI version string.
- * This is the SOAPY_SDR_ABI_VERSION that the library was built against.
+ * Get the ABI version string that the library was built against.
+ * A client can compare <b>SOAPY_SDR_ABI_VERSION</b> to getABIVersion()
+ * to check for ABI incompatibility before using the library.
+ * If the values are not equal then the client code was
+ * compiled against a different ABI than the library.
  */
 SOAPY_SDR_API const char *SoapySDR_getABIVersion(void);
 
+/*!
+ * Get the library version and build information string.
+ * The format of the version string is <b>major.minor.patch-buildInfo</b>.
+ * This function is commonly used to identify the software back-end
+ * to the user for command-line utilities and graphical applications.
+ */
+SOAPY_SDR_API const char *SoapySDR_getLibVersion(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/SoapySDR/Version.hpp b/include/SoapySDR/Version.hpp
index 2dcb2b6..071baca 100644
--- a/include/SoapySDR/Version.hpp
+++ b/include/SoapySDR/Version.hpp
@@ -4,7 +4,7 @@
 /// Utility functions to query version information.
 ///
 /// \copyright
-/// Copyright (c) 2014-2014 Josh Blum
+/// Copyright (c) 2014-2016 Josh Blum
 /// SPDX-License-Identifier: BSL-1.0
 ///
 
@@ -16,13 +16,28 @@
 namespace SoapySDR
 {
 
-//! Query the API version string
+/*!
+ * Get the SoapySDR library API version as a string.
+ * The format of the version string is <b>major.minor.increment</b>,
+ * where the digits are taken directly from <b>SOAPY_SDR_API_VERSION</b>.
+ */
 SOAPY_SDR_API std::string getAPIVersion(void);
 
 /*!
- * Get the ABI version string.
- * This is the SOAPY_SDR_ABI_VERSION that the library was built against.
+ * Get the ABI version string that the library was built against.
+ * A client can compare <b>SOAPY_SDR_ABI_VERSION</b> to getABIVersion()
+ * to check for ABI incompatibility before using the library.
+ * If the values are not equal then the client code was
+ * compiled against a different ABI than the library.
  */
 SOAPY_SDR_API std::string getABIVersion(void);
 
+/*!
+ * Get the library version and build information string.
+ * The format of the version string is <b>major.minor.patch-buildInfo</b>.
+ * This function is commonly used to identify the software back-end
+ * to the user for command-line utilities and graphical applications.
+ */
+SOAPY_SDR_API std::string getLibVersion(void);
+
 }
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 581fac6..e87dbb9 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -67,23 +67,13 @@ if (MSVC)
 endif ()
 
 ########################################################################
-# Extract SOVERSION
-########################################################################
-file(READ "${PROJECT_SOURCE_DIR}/include/SoapySDR/Version.h" version_h)
-string(REGEX MATCH "\\#define SOAPY_SDR_ABI_VERSION \"([0-9]+\\.[0-9]+-[0-9]+)\"" SOAPY_SDR_ABI_VERSION_MATCHES "${version_h}")
-if(NOT SOAPY_SDR_ABI_VERSION_MATCHES)
-    message(FATAL_ERROR "Failed to extract version number from Version.h")
-endif(NOT SOAPY_SDR_ABI_VERSION_MATCHES)
-set(SOAPY_SDR_SOVER "${CMAKE_MATCH_1}" CACHE INTERNAL "")
-
-########################################################################
 # Build the library
 ########################################################################
 add_library(SoapySDR SHARED ${SOAPY_SDR_SOURCES})
 if (SOAPY_SDR_LIBRARIES)
     target_link_libraries(SoapySDR ${SOAPY_SDR_LIBRARIES})
 endif()
-set_target_properties(SoapySDR PROPERTIES SOVERSION ${SOAPY_SDR_SOVER})
+set_target_properties(SoapySDR PROPERTIES SOVERSION ${SOAPY_SDR_ABI_VERSION})
 set_target_properties(SoapySDR PROPERTIES VERSION ${SOAPY_SDR_LIBVER})
 set_target_properties(SoapySDR PROPERTIES DEFINE_SYMBOL "SOAPY_SDR_DLL_EXPORTS")
 
diff --git a/lib/LoggerC.cpp b/lib/LoggerC.cpp
index b7d73d6..e9137e7 100644
--- a/lib/LoggerC.cpp
+++ b/lib/LoggerC.cpp
@@ -71,10 +71,10 @@ void defaultLogHandler(const SoapySDRLogLevel logLevel, const char *message)
     case SOAPY_SDR_CRITICAL: fprintf(stderr, ANSI_COLOR_BOLD ANSI_COLOR_RED "[CRITICAL] %s" ANSI_COLOR_RESET "\n", message); break;
     case SOAPY_SDR_ERROR:    fprintf(stderr, ANSI_COLOR_BOLD ANSI_COLOR_RED "[ERROR] %s" ANSI_COLOR_RESET "\n", message); break;
     case SOAPY_SDR_WARNING:  fprintf(stderr, ANSI_COLOR_BOLD ANSI_COLOR_YELLOW "[WARNING] %s" ANSI_COLOR_RESET "\n", message); break;
-    case SOAPY_SDR_NOTICE:   fprintf(stdout, ANSI_COLOR_GREEN "[NOTICE] %s" ANSI_COLOR_RESET "\n", message); break;
-    case SOAPY_SDR_INFO:     fprintf(stdout, "[INFO] %s\n", message); break;
-    case SOAPY_SDR_DEBUG:    fprintf(stdout, "[DEBUG] %s\n", message); break;
-    case SOAPY_SDR_TRACE:    fprintf(stdout, "[TRACE] %s\n", message); break;
+    case SOAPY_SDR_NOTICE:   fprintf(stderr, ANSI_COLOR_GREEN "[NOTICE] %s" ANSI_COLOR_RESET "\n", message); break;
+    case SOAPY_SDR_INFO:     fprintf(stderr, "[INFO] %s\n", message); break;
+    case SOAPY_SDR_DEBUG:    fprintf(stderr, "[DEBUG] %s\n", message); break;
+    case SOAPY_SDR_TRACE:    fprintf(stderr, "[TRACE] %s\n", message); break;
     case SOAPY_SDR_SSI:      fputs(message, stderr); fflush(stderr); break;
     }
 }
diff --git a/lib/Modules.in.cpp b/lib/Modules.in.cpp
index a1f9701..12a0a8a 100644
--- a/lib/Modules.in.cpp
+++ b/lib/Modules.in.cpp
@@ -3,6 +3,7 @@
 
 #include <SoapySDR/Modules.hpp>
 #include <SoapySDR/Logger.hpp>
+#include <SoapySDR/Version.hpp>
 #include <vector>
 #include <string>
 #include <cstdlib> //getenv
@@ -117,16 +118,16 @@ std::vector<std::string> SoapySDR::listModules(void)
 {
     //the default search path
     std::vector<std::string> searchPaths;
-    searchPaths.push_back(SoapySDR::getRootPath() + "/lib at LIB_SUFFIX@/SoapySDR/modules");
+    searchPaths.push_back(SoapySDR::getRootPath() + "/lib at LIB_SUFFIX@/SoapySDR/modules" + SoapySDR::getABIVersion());
 
     //support /usr/local module installs when the install prefix is /usr
     if (SoapySDR::getRootPath() == "/usr")
     {
-        searchPaths.push_back("/usr/local/lib at LIB_SUFFIX@/SoapySDR/modules");
+        searchPaths.push_back("/usr/local/lib at LIB_SUFFIX@/SoapySDR/modules" + SoapySDR::getABIVersion());
         //when using a multi-arch directory, support single-arch path as well
         static const std::string libsuffix("@LIB_SUFFIX@");
         if (not libsuffix.empty() and libsuffix.at(0) == '/')
-            searchPaths.push_back("/usr/local/lib/SoapySDR/modules");
+            searchPaths.push_back("/usr/local/lib/SoapySDR/modules" + SoapySDR::getABIVersion());
     }
 
     //separator for search paths
diff --git a/lib/Version.in.cpp b/lib/Version.in.cpp
index a4faa19..db700f1 100644
--- a/lib/Version.in.cpp
+++ b/lib/Version.in.cpp
@@ -1,14 +1,24 @@
-// Copyright (c) 2014-2014 Josh Blum
+// Copyright (c) 2014-2016 Josh Blum
 // SPDX-License-Identifier: BSL-1.0
 
 #include <SoapySDR/Version.hpp>
+#include <sstream>
 
 std::string SoapySDR::getAPIVersion(void)
 {
-    return "@SOAPY_SDR_VERSION@";
+    std::stringstream ss;
+    ss << int((SOAPY_SDR_API_VERSION >> 24) & 0xf) << "."
+       << int((SOAPY_SDR_API_VERSION >> 16) & 0xf) << "."
+       << int((SOAPY_SDR_API_VERSION >> 0) & 0xff);
+    return ss.str();
 }
 
 std::string SoapySDR::getABIVersion(void)
 {
     return SOAPY_SDR_ABI_VERSION;
 }
+
+std::string SoapySDR::getLibVersion(void)
+{
+    return "@SOAPY_SDR_VERSION@";
+}
diff --git a/lib/VersionC.cpp b/lib/VersionC.cpp
index 2c1a8c4..7f0c011 100644
--- a/lib/VersionC.cpp
+++ b/lib/VersionC.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2014 Josh Blum
+// Copyright (c) 2014-2016 Josh Blum
 // SPDX-License-Identifier: BSL-1.0
 
 #include <SoapySDR/Version.hpp>
@@ -17,4 +17,10 @@ const char *SoapySDR_getABIVersion(void)
     return abi.c_str();
 }
 
+const char *SoapySDR_getLibVersion(void)
+{
+    static const std::string lib = SoapySDR::getLibVersion();
+    return lib.c_str();
+}
+
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/soapysdr.git



More information about the pkg-hamradio-commits mailing list