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

@@ -0,0 +1,65 @@ 

+ --- /dev/null	2021-08-16 07:57:53.740000000 -0400

+ +++ utf8proc-2.6.1/utf8procConfig.cmake.in	2021-08-25 14:34:29.435497707 -0400

+ @@ -0,0 +1,2 @@

+ +# Targets

+ +include(${CMAKE_CURRENT_LIST_DIR}/utf8procTargets.cmake)

+ --- utf8proc-2.6.1/CMakeLists.txt.orig	2020-12-15 16:36:45.000000000 -0500

+ +++ utf8proc-2.6.1/CMakeLists.txt	2021-08-25 14:35:40.847322932 -0400

+ @@ -22,7 +22,8 @@

+  )

+  

+  # expose header path, for when this is part of a larger cmake project

+ -target_include_directories(utf8proc PUBLIC .)

+ +target_include_directories(utf8proc

+ +    PUBLIC $<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)

+  

+  if (BUILD_SHARED_LIBS)

+    # Building shared library

+ @@ -49,16 +50,40 @@

+    SOVERSION ${SO_MAJOR}

+  )

+  

+ +include(CMakePackageConfigHelpers)

+ +

+ +configure_file(utf8procConfig.cmake.in

+ +  ${CMAKE_CURRENT_BINARY_DIR}/utf8procConfig.cmake @ONLY)

+ +write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/utf8procConfigVersion.cmake

+ +  VERSION 2.6.1

+ +  COMPATIBILITY AnyNewerVersion)

+ +

+ +add_custom_target(run ALL

+ +  COMMAND touch libutf8proc.pc)

+ +

+  if (UTF8PROC_INSTALL)

+ -  install(TARGETS utf8proc

+ +  install(FILES "${PROJECT_SOURCE_DIR}/utf8proc.h" DESTINATION include)

+ +

+ +  install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libutf8proc.pc"

+ +    DESTINATION lib64/pkgconfig

+ +  )

+ +

+ +  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/utf8procConfig.cmake

+ +    ${CMAKE_CURRENT_BINARY_DIR}/utf8procConfigVersion.cmake

+ +    DESTINATION lib64/cmake/utf8proc

+ +  )         

+ +

+ +  install(TARGETS utf8proc EXPORT utf8procTargets

+      RUNTIME DESTINATION bin

+ -    LIBRARY DESTINATION lib

+ -    ARCHIVE DESTINATION lib)

+ +    LIBRARY DESTINATION ${LIB_INSTALL_DIR}

+ +    ARCHIVE DESTINATION ${LIB_INSTALL_DIR}

+ +  )

+ +

+ +  install(EXPORT utf8procTargets

+ +    DESTINATION "${LIB_INSTALL_DIR}/cmake/utf8proc"

+ +    NAMESPACE utf8proc::

+ +  )

+  

+ -  install(

+ -    FILES

+ -      "${PROJECT_SOURCE_DIR}/utf8proc.h"

+ -    DESTINATION include)

+  endif()

+  

+  if(UTF8PROC_ENABLE_TESTING)

file modified
+12 -9
@@ -1,11 +1,12 @@ 

  Summary: Library for processing UTF-8 encoded Unicode strings

  Name:    utf8proc

  Version: 2.6.1

- Release: 3%{?dist}

+ Release: 2%{?dist}

  License: Unicode and MIT

  URL:     http://julialang.org/utf8proc/

  Source:  https://github.com/JuliaLang/utf8proc/archive/v%{version}.tar.gz#/%{name}-v%{version}.tar.gz

- BuildRequires: make

+ Patch1:  0001-CMakeLists.txt.patch

+ BuildRequires: cmake

  BuildRequires: gcc

  BuildRequires: perl

  
@@ -34,20 +35,24 @@ 

  

  %prep

  %setup -qn %{name}-%{version}

+ %patch1 -p1 -b .orig

  # Disable slow tests and tests which require network access

  sed -i '/-C bench/d;/\ttest.* data/d' Makefile

  touch data/NormalizationTest.txt data/GraphemeBreakTest.txt data/Lowercase.txt data/Uppercase.txt

  

  %build

- %set_build_flags

- make %{?_smp_mflags}

+ %cmake . \

+     -DOVERRIDE_INSTALL_PREFIX=/usr \

+     -DCMAKE_COLOR_MAKEFILE:BOOL=OFF \

+     "-GUnix Makefiles"

+ %cmake_build

  

  %check

  make %{?_smp_mflags} check

  

  %install

- make install DESTDIR=%{buildroot} prefix=%{_prefix} includedir=%{_includedir} libdir=%{_libdir}

- rm %{buildroot}%{_libdir}/libutf8proc.a

+ %cmake_install

+ # rm %{buildroot}%{_libdir}/libutf8proc.a

  

  %ldconfig_scriptlets

  
@@ -59,11 +64,9 @@ 

  %{_includedir}/utf8proc.h

  %{_libdir}/libutf8proc.so

  %{_libdir}/pkgconfig/libutf8proc.pc

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

  

  %changelog

- * Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-3

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

- 

  * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-2

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

  

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/utf8proc/

Thanks. Could you file a PR upstream first? I'm not familiar enough with CMake to assess this code, much less to maintain it in the future. Also, how are you supposed to build these Apache projects if they don't work with the sources provided by upstream?

There were a lot of CMake-related changes in utf8proc v2.7.0.

@kkeithle would you please clarify if more changes are needed on top of 2.7.0?

does 2.7.0 create and install /usr/lib64/cmake/utf8proc/utf8proc.cmake?

Yes, it ships /usr/lib64/pkgconfig/libutf8proc.pc .

Compare https://koji.fedoraproject.org/koji/rpminfo?rpmID=29110770 to your build in https://cbs.centos.org/koji/rpminfo?rpmID=325076

Are there any other changes you need?

@kkeithle pointed out that the .pc file is different than the .cmake files. In particular, with this PR, we get:

rpmls utf8proc-devel-2.6.1-2.fc36.x86_64.rpm 
-rw-r--r--  /usr/include/utf8proc.h
-rw-r--r--  /usr/lib64/cmake/utf8proc/utf8procConfig.cmake
-rw-r--r--  /usr/lib64/cmake/utf8proc/utf8procConfigVersion.cmake
-rw-r--r--  /usr/lib64/cmake/utf8proc/utf8procTargets-noconfig.cmake
-rw-r--r--  /usr/lib64/cmake/utf8proc/utf8procTargets.cmake
lrwxrwxrwx  /usr/lib64/libutf8proc.so
-rw-r--r--  /usr/lib64/pkgconfig/libutf8proc.pc

If this is not in libutf8proc upstream, how do Apache ORC and Apache Arrow use it?

@kkeithle pointed out that the .pc file is different than the .cmake files. In particular, with this PR, we get:

rpmls utf8proc-devel-2.6.1-2.fc36.x86_64.rpm -rw-r--r-- /usr/include/utf8proc.h -rw-r--r-- /usr/lib64/cmake/utf8proc/utf8procConfig.cmake -rw-r--r-- /usr/lib64/cmake/utf8proc/utf8procConfigVersion.cmake -rw-r--r-- /usr/lib64/cmake/utf8proc/utf8procTargets-noconfig.cmake -rw-r--r-- /usr/lib64/cmake/utf8proc/utf8procTargets.cmake lrwxrwxrwx /usr/lib64/libutf8proc.so -rw-r--r-- /usr/lib64/pkgconfig/libutf8proc.pc

If this is not in libutf8proc upstream, how do Apache ORC and Apache Arrow use it?

They don't, because they don't exist in Fedora rawhide yet. Or any version of Fedora.

But as part of getting ORC and Arrow to build on my local machine I made local changes to utf8proc, which were the basis of my PR.

As an aside, I don't think it's valid to refer to centos RPMs that were built with older versions of cmake as proof of anything, per se, including proof that /usr/lib64/cmake/utf8proc.cmake is or isn't needed. Or that /usr/lib64/pkgconfig/libutf8proc.pc is sufficient in its place.

Back to the subject at hand: when I was working on getting arrow to build on rawhide (f35 or f36) 5+ months the utf8proc-devel available had a /usr/lib64/pkgconfig/libutf8proc.pc; and my experience at that time was that it was not sufficient. AFAICR I needed the utf8proc.cmake file.

Pull-Request has been closed by kkeithle

2 years ago
Metadata