early-access version 2853
This commit is contained in:
88
externals/vcpkg/ports/rtlsdr/Compile-with-msvc.patch
vendored
Executable file
88
externals/vcpkg/ports/rtlsdr/Compile-with-msvc.patch
vendored
Executable file
@@ -0,0 +1,88 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 2def354..674ff2d 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -66,6 +66,12 @@ endif()
|
||||
########################################################################
|
||||
# Find build dependencies
|
||||
########################################################################
|
||||
+if(MSVC)
|
||||
+find_package(pthreads)
|
||||
+find_package(libusb)
|
||||
+include_directories(${PThreads4W_INCLUDE_DIR})
|
||||
+include_directories(${LIBUSB_INCLUDE_DIRS})
|
||||
+else()
|
||||
if(WIN32 AND NOT MINGW)
|
||||
set(THREADS_USE_PTHREADS_WIN32 true)
|
||||
endif()
|
||||
@@ -79,6 +85,7 @@ endif()
|
||||
if(NOT THREADS_FOUND)
|
||||
message(FATAL_ERROR "pthreads(-win32) required to compile rtl-sdr")
|
||||
endif()
|
||||
+endif()
|
||||
|
||||
########################################################################
|
||||
# Create uninstall target
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 33faee7..fda4612 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -20,7 +20,11 @@
|
||||
########################################################################
|
||||
add_library(rtlsdr SHARED librtlsdr.c
|
||||
tuner_e4k.c tuner_fc0012.c tuner_fc0013.c tuner_fc2580.c tuner_r82xx.c)
|
||||
+if(MSVC)
|
||||
+target_link_libraries(rtlsdr ${LIBUSB_LIBRARIES})
|
||||
+else()
|
||||
target_link_libraries(rtlsdr PkgConfig::LIBUSB)
|
||||
+endif()
|
||||
target_include_directories(rtlsdr PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include> # <prefix>/include
|
||||
@@ -36,7 +40,11 @@ generate_export_header(rtlsdr)
|
||||
########################################################################
|
||||
add_library(rtlsdr_static STATIC librtlsdr.c
|
||||
tuner_e4k.c tuner_fc0012.c tuner_fc0013.c tuner_fc2580.c tuner_r82xx.c)
|
||||
+if(MSVC)
|
||||
+target_link_libraries(rtlsdr_static ${LIBUSB_LIBRARIES})
|
||||
+else()
|
||||
target_link_libraries(rtlsdr_static PkgConfig::LIBUSB)
|
||||
+endif()
|
||||
target_include_directories(rtlsdr_static PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include> # <prefix>/include
|
||||
@@ -58,8 +66,8 @@ IF(MSVC)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rtlsdr.rc.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc
|
||||
@ONLY)
|
||||
- target_sources(rtlsdr ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc)
|
||||
- target_sources(rtlsdr_static ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc)
|
||||
+ target_sources(rtlsdr PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc)
|
||||
+ target_sources(rtlsdr_static PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc)
|
||||
ENDIF(MSVC)
|
||||
|
||||
########################################################################
|
||||
@@ -77,6 +85,11 @@ add_library(libgetopt_static STATIC
|
||||
target_link_libraries(convenience_static
|
||||
rtlsdr
|
||||
)
|
||||
+if(MSVC)
|
||||
+target_link_libraries(convenience_static
|
||||
+ ${PThreads4W_LIBRARY}
|
||||
+)
|
||||
+endif()
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
diff --git a/src/rtl_tcp.c b/src/rtl_tcp.c
|
||||
index 562198f..b4bfa51 100644
|
||||
--- a/src/rtl_tcp.c
|
||||
+++ b/src/rtl_tcp.c
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#include <winsock2.h>
|
||||
+#include <ws2tcpip.h>
|
||||
#include "getopt/getopt.h"
|
||||
#endif
|
||||
|
17
externals/vcpkg/ports/rtlsdr/Findlibusb.cmake
vendored
Executable file
17
externals/vcpkg/ports/rtlsdr/Findlibusb.cmake
vendored
Executable file
@@ -0,0 +1,17 @@
|
||||
find_path(
|
||||
LIBUSB_INCLUDE_DIRS
|
||||
NAMES libusb.h
|
||||
PATH_SUFFIXES libusb-1.0
|
||||
)
|
||||
|
||||
find_library(
|
||||
LIBUSB_LIBRARIES
|
||||
NAMES libusb-1.0
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(
|
||||
LIBUSB
|
||||
REQUIRED_VARS LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIRS
|
||||
)
|
15
externals/vcpkg/ports/rtlsdr/fix-version.patch
vendored
Executable file
15
externals/vcpkg/ports/rtlsdr/fix-version.patch
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
diff --git a/cmake/modules/Version.cmake b/cmake/modules/Version.cmake
|
||||
index 2d4e76d..6acffe2 100644
|
||||
--- a/cmake/modules/Version.cmake
|
||||
+++ b/cmake/modules/Version.cmake
|
||||
@@ -39,7 +39,9 @@ if(GIT_FOUND)
|
||||
OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
-else()
|
||||
+endif()
|
||||
+
|
||||
+if ("${GIT_DESCRIBE}" STREQUAL "")
|
||||
set(GIT_DESCRIBE "v${MAJOR_VERSION}.${MINOR_VERSION}.x-xxx-xunknown")
|
||||
endif()
|
||||
|
45
externals/vcpkg/ports/rtlsdr/portfile.cmake
vendored
Executable file
45
externals/vcpkg/ports/rtlsdr/portfile.cmake
vendored
Executable file
@@ -0,0 +1,45 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO osmocom/rtl-sdr
|
||||
REF d794155ba65796a76cd0a436f9709f4601509320
|
||||
SHA512 21fe10f1dbecca651650f03d1008560930fac439d220c33b4a23acce98d78d8476ff200765eed8cfa6cddde761d45f7ba36c8b5bc3662aa85819172830ea4938
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
Compile-with-msvc.patch
|
||||
fix-version.patch
|
||||
)
|
||||
|
||||
file(
|
||||
COPY ${CMAKE_CURRENT_LIST_DIR}/Findlibusb.cmake
|
||||
DESTINATION ${SOURCE_PATH}/cmake/Modules
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/rtlsdr)
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(
|
||||
INSTALL ${SOURCE_PATH}/COPYING
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/share/rtlsdr
|
||||
RENAME copyright
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
else()
|
||||
file(GLOB DEBUG_TOOLS "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe")
|
||||
file(GLOB RELEASE_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe")
|
||||
file(
|
||||
INSTALL ${RELEASE_TOOLS}
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}
|
||||
)
|
||||
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
||||
file(REMOVE ${DEBUG_TOOLS} ${RELEASE_TOOLS})
|
||||
endif()
|
15
externals/vcpkg/ports/rtlsdr/vcpkg.json
vendored
Executable file
15
externals/vcpkg/ports/rtlsdr/vcpkg.json
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "rtlsdr",
|
||||
"version-date": "2020-04-16",
|
||||
"port-version": 3,
|
||||
"description": "rtl-sdr is a library that turns your Realtek RTL2832 based DVB dongle into a SDR receiver",
|
||||
"homepage": "https://osmocom.org/projects/rtl-sdr",
|
||||
"supports": "windows & (x86 | x64)",
|
||||
"dependencies": [
|
||||
"libusb",
|
||||
{
|
||||
"name": "pthreads",
|
||||
"platform": "windows"
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user