commit:     cb7f344f4826efe6c411abee955ea6b6a4695037
Author:     Eli Burch <eli.burch <AT> burchbytes <DOT> com>
AuthorDate: Mon Jun 17 00:42:13 2024 +0000
Commit:     Eli Burch <redawl <AT> burchbytes <DOT> com>
CommitDate: Mon Jun 17 00:44:21 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=cb7f344f

net-wireless/airspyhf: Add static-libs use flag

Closes: https://bugs.gentoo.org/934412
Signed-off-by: Eli Burch <eli.burch <AT> burchbytes.com>

 net-wireless/airspyhf/airspyhf-1.6.8.ebuild |  4 ++-
 net-wireless/airspyhf/files/static.patch    | 43 +++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/net-wireless/airspyhf/airspyhf-1.6.8.ebuild 
b/net-wireless/airspyhf/airspyhf-1.6.8.ebuild
index 1ccb88f4b..df9f0b082 100644
--- a/net-wireless/airspyhf/airspyhf-1.6.8.ebuild
+++ b/net-wireless/airspyhf/airspyhf-1.6.8.ebuild
@@ -13,7 +13,7 @@ LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64"
 
-IUSE="udev"
+IUSE="udev static-libs"
 
 DEPEND="dev-libs/libusb"
 
@@ -26,6 +26,8 @@ BDEPEND="virtual/pkgconfig"
 src_prepare(){
        sed -i "s@DESTINATION \"/etc/udev/rules.d\"@DESTINATION 
\"$(get_udevdir)/rules.d\"@" "tools/CMakeLists.txt" || die
 
+       use static-libs || eapply "${FILESDIR}/static.patch" || die
+
        cmake_src_prepare
 }
 

diff --git a/net-wireless/airspyhf/files/static.patch 
b/net-wireless/airspyhf/files/static.patch
new file mode 100644
index 000000000..393e529fc
--- /dev/null
+++ b/net-wireless/airspyhf/files/static.patch
@@ -0,0 +1,43 @@
+diff --git a/libairspyhf/src/CMakeLists.txt b/libairspyhf/src/CMakeLists.txt
+index 9d8d483..38d1b24 100644
+--- a/libairspyhf/src/CMakeLists.txt
++++ b/libairspyhf/src/CMakeLists.txt
+@@ -46,16 +46,7 @@ add_library(airspyhf SHARED ${c_sources} 
${AIRSPYHF_DLL_SRCS})
+ set_target_properties(airspyhf PROPERTIES VERSION 
${AIRSPYHF_VER_MAJOR}.${AIRSPYHF_VER_MINOR}.${AIRSPYHF_VER_REVISION})
+ set_target_properties(airspyhf PROPERTIES SOVERSION 0)
+ 
+-# Static library
+-add_library(airspyhf-static STATIC ${c_sources})
+-if(MSVC)
+-      set_target_properties(airspyhf-static PROPERTIES OUTPUT_NAME 
"airspyhf_static")
+-else()
+-      set_target_properties(airspyhf-static PROPERTIES OUTPUT_NAME "airspyhf")
+-endif()
+-
+ set_target_properties(airspyhf PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+-set_target_properties(airspyhf-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+ 
+ # Dependencies
+ target_link_libraries(airspyhf ${LIBUSB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+@@ -71,10 +62,6 @@ if( ${UNIX} )
+            LIBRARY DESTINATION lib${LIB_SUFFIX}
+            COMPONENT sharedlibs
+            )
+-   install(TARGETS airspyhf-static
+-           ARCHIVE DESTINATION lib${LIB_SUFFIX}
+-           COMPONENT staticlibs
+-           )
+    install(FILES ${c_headers}
+            DESTINATION include/${PROJECT_NAME}
+            COMPONENT headers
+@@ -86,10 +73,6 @@ if( ${WIN32} )
+            DESTINATION bin
+            COMPONENT sharedlibs
+            )
+-   install(TARGETS airspyhf-static
+-           DESTINATION bin
+-           COMPONENT staticlibs
+-           )
+    install(FILES ${c_headers}
+            DESTINATION include/${PROJECT_NAME}
+            COMPONENT headers

Reply via email to