Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30c914a2c6 |
4 changed files with 60 additions and 11 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,4 +1,2 @@
|
|||
/uvw-2.10.0_libuv_v1.42.tar.gz
|
||||
/uvw-2.11.0_libuv_v1.43.tar.gz
|
||||
/uvw-2.12.1_libuv_v1.44.tar.gz
|
||||
/uvw-3.*_libuv_v1.*.tar.gz
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (uvw-3.4.0_libuv_v1.48.tar.gz) = dbf03c63b0693263b77b405e8f6bf4c207795be9bd024bbc06484e523b55257add1eab632067a956d03399d91ee389c46312603e7754b152c4caf51b40f6bec4
|
||||
SHA512 (uvw-2.10.0_libuv_v1.42.tar.gz) = a34836bc5b017aeb6f798147a0bbbea287f736a20a9a9973d3cf4b232f66670825955db6abf149a34ee8dc7ee3865528d8c8de796b2ccaf28790e3aff9ad21ba
|
||||
|
|
|
|||
46
uvw-2.10-test-libuv-dynamic.patch
Normal file
46
uvw-2.10-test-libuv-dynamic.patch
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
From efefe50cbf7b0069174b8381805ad9cf51a719a5 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Sat, 21 Aug 2021 20:54:11 +0200
|
||||
Subject: [PATCH] Support dynamic linkage of tests
|
||||
|
||||
If libuv is not fetched, try to find and provide libuv parameters using
|
||||
pkg-config. Makes dynamic linking to shared libuv library from the
|
||||
system.
|
||||
---
|
||||
test/CMakeLists.txt | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
|
||||
index b482523..d071c04 100644
|
||||
--- a/test/CMakeLists.txt
|
||||
+++ b/test/CMakeLists.txt
|
||||
@@ -44,6 +44,18 @@ endif()
|
||||
function(ADD_UVW_TEST TEST_NAME TEST_SOURCE)
|
||||
add_executable(${TEST_NAME} ${TEST_SOURCE})
|
||||
|
||||
+ if (NOT FETCH_LIBUV)
|
||||
+ find_package(PkgConfig QUIET)
|
||||
+ if (PkgConfig_FOUND)
|
||||
+ pkg_check_modules(LIBUV REQUIRED libuv)
|
||||
+
|
||||
+ target_include_directories(
|
||||
+ ${TEST_NAME}
|
||||
+ PUBLIC ${LIBUV_INCLUDE_DIRS}
|
||||
+ )
|
||||
+ endif(PkgConfig_FOUND)
|
||||
+ endif(NOT FETCH_LIBUV)
|
||||
+
|
||||
target_link_libraries(
|
||||
${TEST_NAME}
|
||||
PRIVATE
|
||||
@@ -52,6 +64,7 @@ function(ADD_UVW_TEST TEST_NAME TEST_SOURCE)
|
||||
$<$<TARGET_EXISTS:uvw::uvw-static>:uvw::uvw-static>
|
||||
$<$<TARGET_EXISTS:uv::uv-shared>:uv::uv-shared>
|
||||
$<$<TARGET_EXISTS:uvw::uvw-shared>:uvw::uvw-shared>
|
||||
+ ${LIBUV_LDFLAGS} ${LIBUV_LIBRARIES}
|
||||
GTest::Main
|
||||
Threads::Threads
|
||||
${LIBRT}
|
||||
--
|
||||
2.31.1
|
||||
|
||||
21
uvw.spec
21
uvw.spec
|
|
@ -1,5 +1,5 @@
|
|||
%global forgeurl0 https://github.com/skypjack/uvw
|
||||
%global libuv_ver 1.48
|
||||
%global libuv_ver 1.42
|
||||
%global tag0 v%{version}_libuv_v%{libuv_ver}
|
||||
%global distprefix %{nil}
|
||||
|
||||
|
|
@ -7,18 +7,22 @@
|
|||
%global debug_package %{nil}
|
||||
|
||||
Name: uvw
|
||||
Version: 3.4.0
|
||||
Version: 2.10.0
|
||||
%forgemeta
|
||||
Release: %autorelease
|
||||
Summary: Header-only easy to use libuv C++ wrapper
|
||||
|
||||
License: MIT
|
||||
License: MIT and CC-BY
|
||||
URL: https://github.com/skypjack/uvw
|
||||
Source0: %forgesource
|
||||
|
||||
# https://github.com/skypjack/uvw/pull/253
|
||||
Patch1: uvw-2.10-test-libuv-dynamic.patch
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: cmake
|
||||
BuildRequires: libuv-devel >= %{libuv_ver}
|
||||
#BuildRequires: libcxx-devel
|
||||
BuildRequires: doxygen
|
||||
BuildRequires: gtest-devel
|
||||
BuildRequires: sed
|
||||
|
|
@ -71,18 +75,19 @@ echo 'Requires: libuv' >> libuvw-static.pc.in
|
|||
# This check is failing on some platforms
|
||||
sed -e 's|ASSERT_NE(cpuInfo\[0\].speed, decltype(cpuInfo\[0\].speed){0});|// &|' \
|
||||
-i test/uvw/util.cpp
|
||||
# does not pass now in mock for some reason
|
||||
sed -e 's/TEST(Loop, Walk)/TEST(Loop, DISABLED_Walk)/' \
|
||||
-i test/uvw/loop.cpp
|
||||
|
||||
%build
|
||||
%cmake -DFIND_LIBUV=ON -DFETCH_LIBUV=OFF -DBUILD_TESTING=ON -DBUILD_DOCS=ON -DFIND_GTEST_PACKAGE=ON
|
||||
%cmake -DFETCH_LIBUV=OFF -DBUILD_TESTING=ON -DBUILD_DOCS=ON -DFIND_GTEST_PACKAGE=ON
|
||||
%cmake_build
|
||||
|
||||
|
||||
%install
|
||||
%cmake_install
|
||||
|
||||
pushd %{buildroot}%{_libdir}/pkgconfig/
|
||||
ln -s libuvw-static.pc libuvw.pc
|
||||
popd
|
||||
|
||||
|
||||
%check
|
||||
%ctest
|
||||
|
|
@ -95,7 +100,7 @@ sed -e 's/TEST(Loop, Walk)/TEST(Loop, DISABLED_Walk)/' \
|
|||
%license LICENSE
|
||||
%doc README.md
|
||||
%{_includedir}/%{name}*
|
||||
%{_libdir}/cmake/%{name}/
|
||||
%{_libdir}/pkgconfig/libuvw*
|
||||
|
||||
%files doc
|
||||
%license LICENSE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue