summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-06-14 19:43:42 +0100
committerSam James <sam@gentoo.org>2022-06-14 19:44:02 +0100
commite92180dd9914751b757db65136aa6ea97d1e8ee7 (patch)
tree25f83d6125dca6bbb57c9e967d4faf3f238de626 /net-libs/libad9361-iio
parentnet-libs/gnutls: Stabilize 3.7.6 sparc, #843353 (diff)
downloadgentoo-e92180dd9914751b757db65136aa6ea97d1e8ee7.tar.gz
gentoo-e92180dd9914751b757db65136aa6ea97d1e8ee7.tar.bz2
gentoo-e92180dd9914751b757db65136aa6ea97d1e8ee7.zip
net-libs/libad9361-iio: EAPI 8; fix lld build; GNUInstallDirs
... and fix libdir in installed .pc file. Closes: https://bugs.gentoo.org/831322 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-libs/libad9361-iio')
-rw-r--r--net-libs/libad9361-iio/files/libad9361-iio-0.2-cmake-gnuinstalldirs.patch50
-rw-r--r--net-libs/libad9361-iio/files/libad9361-iio-0.2-fix-lld-tests.patch49
-rw-r--r--net-libs/libad9361-iio/files/libad9361-iio-0.2-libdir-pkgconfig.patch14
-rw-r--r--net-libs/libad9361-iio/libad9361-iio-0.2-r1.ebuild28
-rw-r--r--net-libs/libad9361-iio/libad9361-iio-9999.ebuild22
5 files changed, 152 insertions, 11 deletions
diff --git a/net-libs/libad9361-iio/files/libad9361-iio-0.2-cmake-gnuinstalldirs.patch b/net-libs/libad9361-iio/files/libad9361-iio-0.2-cmake-gnuinstalldirs.patch
new file mode 100644
index 000000000000..5a69010eb184
--- /dev/null
+++ b/net-libs/libad9361-iio/files/libad9361-iio-0.2-cmake-gnuinstalldirs.patch
@@ -0,0 +1,50 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -13,6 +13,8 @@
+ cmake_minimum_required(VERSION 2.8.7)
+ project(ad9361 C)
+
++include(GNUInstallDirs)
++
+ set(LIBAD9361_VERSION_MAJOR 0)
+ set(LIBAD9361_VERSION_MINOR 2)
+ set(VERSION ${LIBAD9361_VERSION_MAJOR}.${LIBAD9361_VERSION_MINOR})
+@@ -59,10 +61,6 @@ endif()
+
+ add_definitions(-D_POSIX_C_SOURCE=199309L -DLIBAD9361_EXPORTS=1)
+
+-set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib"
+- CACHE PATH "Installation directory for libraries")
+-mark_as_advanced(INSTALL_LIB_DIR)
+-
+ find_library(LIBIIO_LIBRARIES iio)
+ find_path(LIBIIO_INCLUDEDIR iio.h)
+
+@@ -98,21 +96,17 @@ configure_file(libad9361-iio.iss.cmakein ${CMAKE_CURRENT_BINARY_DIR}/libad9361-i
+
+ set(LIBAD9361_PC ${CMAKE_CURRENT_BINARY_DIR}/libad9361.pc)
+ configure_file(libad9361.pc.cmakein ${LIBAD9361_PC} @ONLY)
+-install(FILES ${LIBAD9361_PC} DESTINATION ${INSTALL_LIB_DIR}/pkgconfig)
++install(FILES ${LIBAD9361_PC} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+
+ if(NOT SKIP_INSTALL_ALL)
+ install(TARGETS ad9361
+- ARCHIVE DESTINATION lib
+- LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
+- RUNTIME DESTINATION bin
+- FRAMEWORK DESTINATION lib
+- PUBLIC_HEADER DESTINATION include)
++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
++ FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}"
++ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+ endif()
+
+-set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/${PROJECT_NAME}${LIBAD9361_VERSION_MAJOR}-doc)")
+-include(GNUInstallDirs)
+-set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}${LIBAD9361_VERSION_MAJOR}-doc")
+-
+ find_package(Doxygen)
+ if(DOXYGEN_FOUND)
+ option(WITH_DOC "Generate documentation with Doxygen" ON)
diff --git a/net-libs/libad9361-iio/files/libad9361-iio-0.2-fix-lld-tests.patch b/net-libs/libad9361-iio/files/libad9361-iio-0.2-fix-lld-tests.patch
new file mode 100644
index 000000000000..00ef9e0a6869
--- /dev/null
+++ b/net-libs/libad9361-iio/files/libad9361-iio-0.2-fix-lld-tests.patch
@@ -0,0 +1,49 @@
+https://bugs.gentoo.org/831322
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -1,17 +1,29 @@
+ add_executable(FilterDesignerTest filter_designer_test.c)
+-target_link_libraries(FilterDesignerTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361)
++if(WIN32)
++ target_link_libraries(FilterDesignerTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361)
++else()
++ target_link_libraries(FilterDesignerTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361 m)
++endif()
+ add_test(NAME FilterDesignerTest
+ COMMAND FilterDesignerTest
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+ add_executable(GenerateRatesTest gen_rates_test.c)
+-target_link_libraries(GenerateRatesTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361)
++if(WIN32)
++ target_link_libraries(GenerateRatesTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361)
++else()
++ target_link_libraries(GenerateRatesTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361 m)
++endif()
+ add_test(NAME GenerateRatesTest
+ COMMAND GenerateRatesTest
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+ add_executable(FilterDesignerHardwareTest filter_designer_hw.c)
+-target_link_libraries(FilterDesignerHardwareTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361)
++if(WIN32)
++ target_link_libraries(FilterDesignerHardwareTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361)
++else()
++ target_link_libraries(FilterDesignerHardwareTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361 m)
++endif()
+ add_test(NAME FilterDesignerHardwareTest
+ COMMAND FilterDesignerHardwareTest
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+@@ -27,7 +39,11 @@ add_test(NAME FMComms5SyncTest
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+ add_executable(AutoRateTest auto_rate_test_hw.c)
+-target_link_libraries(AutoRateTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361)
++if(WIN32)
++ target_link_libraries(AutoRateTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361)
++else()
++ target_link_libraries(AutoRateTest LINK_PRIVATE ${LIBIIO_LIBRARIES} ad9361 m)
++endif()
+ add_test(NAME AutoRateTest
+ COMMAND AutoRateTest
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/net-libs/libad9361-iio/files/libad9361-iio-0.2-libdir-pkgconfig.patch b/net-libs/libad9361-iio/files/libad9361-iio-0.2-libdir-pkgconfig.patch
new file mode 100644
index 000000000000..a23205e44da9
--- /dev/null
+++ b/net-libs/libad9361-iio/files/libad9361-iio-0.2-libdir-pkgconfig.patch
@@ -0,0 +1,14 @@
+--- a/libad9361.pc.cmakein
++++ b/libad9361.pc.cmakein
+@@ -1,8 +1,8 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=@CMAKE_INSTALL_PREFIX@
+-libdir=@CMAKE_INSTALL_PREFIX@/lib
+-sharedlibdir=@CMAKE_INSTALL_PREFIX@/lib
+-includedir=@CMAKE_INSTALL_PREFIX@/include
++libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
++sharedlibdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
++includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
+
+ Name: libad9361
+ Description: Device specific library for AD936X transceivers
diff --git a/net-libs/libad9361-iio/libad9361-iio-0.2-r1.ebuild b/net-libs/libad9361-iio/libad9361-iio-0.2-r1.ebuild
new file mode 100644
index 000000000000..596e74764626
--- /dev/null
+++ b/net-libs/libad9361-iio/libad9361-iio-0.2-r1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="IIO AD9361 library for filter design and handling, multi-chip sync, etc"
+HOMEPAGE="https://github.com/analogdevicesinc/libad9361-iio"
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/analogdevicesinc/libad9361-iio"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/analogdevicesinc/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~riscv ~x86"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0/${PV}"
+
+RDEPEND="net-libs/libiio:="
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.2-fix-lld-tests.patch
+ "${FILESDIR}"/${PN}-0.2-libdir-pkgconfig.patch
+ "${FILESDIR}"/${PN}-0.2-cmake-gnuinstalldirs.patch
+)
diff --git a/net-libs/libad9361-iio/libad9361-iio-9999.ebuild b/net-libs/libad9361-iio/libad9361-iio-9999.ebuild
index 630cb27fb6e9..596e74764626 100644
--- a/net-libs/libad9361-iio/libad9361-iio-9999.ebuild
+++ b/net-libs/libad9361-iio/libad9361-iio-9999.ebuild
@@ -1,17 +1,18 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
+
inherit cmake
-DESCRIPTION="IIO AD9361 library for filter design and handling, multi-chip sync, etc."
+DESCRIPTION="IIO AD9361 library for filter design and handling, multi-chip sync, etc"
HOMEPAGE="https://github.com/analogdevicesinc/libad9361-iio"
-if [ "${PV}" = "9999" ]; then
+if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://github.com/analogdevicesinc/libad9361-iio"
inherit git-r3
else
SRC_URI="https://github.com/analogdevicesinc/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
- KEYWORDS="~amd64 ~x86"
+ KEYWORDS="~amd64 ~riscv ~x86"
fi
LICENSE="LGPL-2.1"
@@ -20,9 +21,8 @@ SLOT="0/${PV}"
RDEPEND="net-libs/libiio:="
DEPEND="${RDEPEND}"
-src_prepare() {
- sed -i -e "s:"${CMAKE_INSTALL_PREFIX}/lib":"${CMAKE_INSTALL_PREFIX}/$(get_libdir)":g" \
- -e "s:\${PROJECT_NAME}\${LIBAD9361_VERSION_MAJOR}-doc:${P}:" CMakeLists.txt || die
- cmake_src_prepare
- eapply_user
-}
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.2-fix-lld-tests.patch
+ "${FILESDIR}"/${PN}-0.2-libdir-pkgconfig.patch
+ "${FILESDIR}"/${PN}-0.2-cmake-gnuinstalldirs.patch
+)