#2 build with cmake to produce cmake style pkginfo that can be consumed
Merged 2 years ago by denisarnaud. Opened 2 years ago by kkeithle.
rpms/ kkeithle/re2 rawhide  into  rawhide

@@ -0,0 +1,25 @@ 

+ --- re2-2019-08-01/CMakeLists.txt.orig	2019-07-31 05:21:22.000000000 -0400

+ +++ re2-2019-08-01/CMakeLists.txt	2021-08-25 18:40:27.059505174 -0400

+ @@ -86,6 +86,12 @@

+  add_library(re2 ${RE2_SOURCES})

+  add_library(re2::re2 ALIAS re2)

+  

+ +set_target_properties(re2 PROPERTIES

+ +  POSITION_INDEPENDENT_CODE ON

+ +  VERSION 0a.0.0

+ +  SOVERSION 0a

+ +)

+ +

+  if(RE2_BUILD_TESTING)

+    set(TESTING_SOURCES

+        re2/testing/backtrack.cc

+ @@ -148,5 +154,7 @@

+      )

+  

+  install(FILES ${RE2_HEADERS} DESTINATION include/re2)

+ -install(TARGETS re2 EXPORT re2Config ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include)

+ -install(EXPORT re2Config DESTINATION lib/cmake/re2 NAMESPACE re2::)

+ +

+ +include(CMakePackageConfigHelpers)

+ +install(TARGETS re2 EXPORT re2Config ARCHIVE DESTINATION ${LIB_INSTALL_DIR} LIBRARY DESTINATION ${LIB_INSTALL_DIR} RUNTIME DESTINATION bin INCLUDES DESTINATION include)

+ +install(EXPORT re2Config DESTINATION ${LIB_INSTALL_DIR}/cmake/re2 NAMESPACE re2::)

file modified
+16 -16
@@ -4,7 +4,7 @@ 

  Name:           re2

  Version:        %{shortver}

  Epoch:          1

- Release:        9%{?dist}

+ Release:        8%{?dist}

  Summary:        C++ fast alternative to backtracking RE engines

  License:        BSD

  URL:            http://github.com/google/%{name}/
@@ -17,8 +17,9 @@ 

  # stable ABI, or at least get them to bump soname appropriately so we

  # won't have to handle it ourselves downsream via this patch indefinitely.

  Patch1: re2-soname.patch

+ Patch2: re2-CMakeLists.txt.patch

  

- BuildRequires: make

+ BuildRequires: cmake

  BuildRequires:  gcc-c++

  %description

  RE2 is a C++ library providing a fast, safe, thread-friendly alternative to
@@ -44,8 +45,8 @@ 

  

  %prep

  %setup -q -n %{name}-%{longver}

- 

- %patch1 -p1 -b .soname

+ %patch1 -p1 -b .orig

+ %patch2 -p1 -b .orig

  

  %build

  # The -pthread flag issue has been submitted upstream:
@@ -54,22 +55,23 @@ 

  %{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro}

  CXXFLAGS="${CXXFLAGS:-%optflags} -pthread"

  LDFLAGS="${LDFLAGS:-%__global_ldflags} -pthread"

+ %cmake . \

+     -DOVERRIDE_INSTALL_PREFIX=/usr \

+     -DCMAKE_COLOR_MAKEFILE:BOOL=OFF \

+     -DINSTALL_LIBDIR:PATH=%{_libdir} \

+     "-GUnix Makefiles"

  

- %make_build \

-   CXXFLAGS="$CXXFLAGS"\

-   LDFLAGS="$LDFLAGS" \

-   includedir=%{_includedir}\

-   libdir=%{_libdir}

+ %cmake_build

  

  %install

- %make_install \

-   INSTALL="install -p"\

-   includedir=%{_includedir}\

-   libdir=%{_libdir}

+ %cmake_install 

  

  # Suppress the static library

  rm -fv %{buildroot}%{_libdir}/libre2.a

  

+ mkdir -p %{buildroot}%{_libdir}/pkgconfig/

+ install -m 0644 re2.pc %{buildroot}%{_libdir}/pkgconfig/

+ 

  %check

  %make_build shared-test

  
@@ -84,11 +86,9 @@ 

  %{_includedir}/re2/

  %{_libdir}/libre2.so

  %{_libdir}/pkgconfig/re2.pc

+ %{_libdir}/cmake/re2/*.cmake

  

  %changelog

- * Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:20190801-9

- - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

- 

  * Tue Mar 30 2021 Jonathan Wakely <jwakely@redhat.com> - 1:20190801-8

  - Rebuilt for removed libstdc++ symbol (#1937698)

  

by dependent packages

I'm in the preliminary phase of adding apache ORC and apache arrow.
Both build with cmake only, and both need cmake style pkg info in
/usr/lib/cmake/re2/

Pull-Request has been merged by denisarnaud

2 years ago

Excellent, thanks for the contribution!

Metadata