Compare commits

..

No commits in common. "rawhide" and "f37" have entirely different histories.

4 changed files with 55 additions and 10 deletions

1
.gitignore vendored
View file

@ -1,4 +1,3 @@
/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

View file

@ -1 +1 @@
SHA512 (uvw-3.4.0_libuv_v1.48.tar.gz) = dbf03c63b0693263b77b405e8f6bf4c207795be9bd024bbc06484e523b55257add1eab632067a956d03399d91ee389c46312603e7754b152c4caf51b40f6bec4
SHA512 (uvw-2.12.1_libuv_v1.44.tar.gz) = edf8aae809cf1428c01225070d2b3e401eecf60ba88913786833fc4ad057565215eb727ca040e4316ddbf1b41fe401bbd956cf17847df23cdf3ccdc97e44dfa6

View 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

View file

@ -1,5 +1,5 @@
%global forgeurl0 https://github.com/skypjack/uvw
%global libuv_ver 1.48
%global libuv_ver 1.44
%global tag0 v%{version}_libuv_v%{libuv_ver}
%global distprefix %{nil}
@ -7,7 +7,7 @@
%global debug_package %{nil}
Name: uvw
Version: 3.4.0
Version: 2.12.1
%forgemeta
Release: %autorelease
Summary: Header-only easy to use libuv C++ wrapper
@ -16,9 +16,12 @@ License: MIT
URL: https://github.com/skypjack/uvw
Source0: %forgesource
BuildRequires: gcc-c++
BuildRequires: cmake
# https://github.com/skypjack/uvw/pull/253
Patch1: uvw-2.10-test-libuv-dynamic.patch
BuildRequires: gcc-c++, cmake
BuildRequires: libuv-devel >= %{libuv_ver}
BuildRequires: libcxx-devel
BuildRequires: doxygen
BuildRequires: gtest-devel
BuildRequires: sed
@ -71,12 +74,9 @@ 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