Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package antlr4 for openSUSE:Factory checked 
in at 2021-03-19 16:42:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/antlr4 (Old)
 and      /work/SRC/openSUSE:Factory/.antlr4.new.2401 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "antlr4"

Fri Mar 19 16:42:23 2021 rev:4 rq:871261 version:4.9.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/antlr4/antlr4.changes    2020-04-04 
12:25:26.551934454 +0200
+++ /work/SRC/openSUSE:Factory/.antlr4.new.2401/antlr4.changes  2021-03-19 
16:42:45.822082217 +0100
@@ -1,0 +2,8 @@
+Wed Feb 10 07:30:44 UTC 2021 - Jiri Slaby <[email protected]>
+
+- Upgrade to version 4.9.1
+- Added patch:
+  * utf8cpp-from-system.patch -- 4.9.1 tries to download utfcpp from
+    github, so avoid that.
+
+-------------------------------------------------------------------

Old:
----
  antlr4-4.8.tar.gz

New:
----
  antlr4-4.9.1.tar.gz
  utf8cpp-from-system.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ antlr4.spec ++++++
--- /var/tmp/diff_new_pack.njoFyD/_old  2021-03-19 16:42:46.450083064 +0100
+++ /var/tmp/diff_new_pack.njoFyD/_new  2021-03-19 16:42:46.450083064 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package antlr4
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,11 +16,11 @@
 #
 
 
-%define libver 4_8
+%define libver 4_9_1
 %define runtime_cpp_lib libantlr4-runtime
 %define runtime_cpp_libver %{runtime_cpp_lib}%{libver}
 Name:           antlr4
-Version:        4.8
+Version:        4.9.1
 Release:        0
 Summary:        Java parser generator
 # C# runtime is MIT-licensed, but currently it is not used in this package
@@ -29,12 +29,14 @@
 Source0:        
https://github.com/antlr/antlr4/archive/%{version}.tar.gz#/antlr4-%{version}.tar.gz
 Source100:      antlr4-install-path.patch.in
 Patch0:         unicodedata.patch
+Patch1:         utf8cpp-from-system.patch
 BuildRequires:  cmake >= 3.3.0
 BuildRequires:  fdupes
 BuildRequires:  gcc-c++
 BuildRequires:  libstdc++-devel
 BuildRequires:  maven-local
 BuildRequires:  pkgconfig
+BuildRequires:  utfcpp-devel
 BuildRequires:  mvn(com.ibm.icu:icu4j)
 BuildRequires:  mvn(org.abego.treelayout:org.abego.treelayout.core)
 BuildRequires:  mvn(org.antlr:ST4)
@@ -117,6 +119,7 @@
 %package -n %{runtime_cpp_lib}-devel
 Summary:        Development files for the ANTRL libraries
 Requires:       %{runtime_cpp_libver} = %{version}
+Requires:       utfcpp-devel
 
 %description -n %{runtime_cpp_lib}-devel
 ANTLR runtime libraries for C++.
@@ -126,6 +129,7 @@
 
 %prep
 %setup -q
+%patch1 -p1
 cat %{SOURCE100} | sed 's#@LIBVER@#%{libver}#g' | patch -p1 -u
 
 find -name \*.jar -delete

++++++ antlr4-4.8.tar.gz -> antlr4-4.9.1.tar.gz ++++++
++++ 130874 lines of diff (skipped)

++++++ antlr4-install-path.patch.in ++++++
--- /var/tmp/diff_new_pack.njoFyD/_old  2021-03-19 16:42:46.934083718 +0100
+++ /var/tmp/diff_new_pack.njoFyD/_new  2021-03-19 16:42:46.934083718 +0100
@@ -26,8 +26,8 @@
                                   COMPILE_FLAGS "${disabled_compile_warnings} 
${extra_static_compile_flags}")
  
  install(TARGETS antlr4_shared
--        DESTINATION lib 
-+        DESTINATION ${LIB_INSTALL_DIR} 
+-        DESTINATION lib
++        DESTINATION ${LIB_INSTALL_DIR}
          EXPORT antlr4-targets)
  install(TARGETS antlr4_static
 -        DESTINATION lib

++++++ utf8cpp-from-system.patch ++++++
From: Jiri Slaby <[email protected]>
Date: Wed, 10 Feb 2021 08:44:32 +0100
Subject: Cpp/runtime: use utf8cpp from system if possible
Patch-mainline: submitted, https://github.com/antlr/antlr4/pull/3073
References: utf8cpp

Try to find system's utf8cpp first, instead of downloading it from
github. utf8cpp 3 defines a cmake package, so we can use find_package.
Older utf8cpps don't, so we try also find_path. If all that fails, we
still fall back to github download.

This is needed as distributions cannot download stuff from their build
systems. And people want to use libraries/headers from the distribution
anyway.

I had to reorder the file a bit, so that the libraries are defined
through the utf8cpp detection
---
 runtime/Cpp/runtime/CMakeLists.txt | 79 ++++++++++++++++++++----------
 1 file changed, 52 insertions(+), 27 deletions(-)

diff --git a/runtime/Cpp/runtime/CMakeLists.txt 
b/runtime/Cpp/runtime/CMakeLists.txt
index a8503bb61e10..89515a0b44fd 100644
--- a/runtime/Cpp/runtime/CMakeLists.txt
+++ b/runtime/Cpp/runtime/CMakeLists.txt
@@ -1,19 +1,3 @@
-
-include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
-
-set(THIRDPARTY_DIR ${CMAKE_BINARY_DIR}/runtime/thirdparty)
-set(UTFCPP_DIR ${THIRDPARTY_DIR}/utfcpp)
-ExternalProject_Add(
-  utfcpp
-  GIT_REPOSITORY        "git://github.com/nemtrif/utfcpp"
-  GIT_TAG               "v3.1.1"
-  SOURCE_DIR            ${UTFCPP_DIR}
-  UPDATE_DISCONNECTED   1
-  CMAKE_ARGS            -DCMAKE_INSTALL_PREFIX=${UTFCPP_DIR}/install 
-Dgtest_force_shared_crt=ON
-  TEST_AFTER_INSTALL    1
-  STEP_TARGETS          build)
-
-
 include_directories(
   ${PROJECT_SOURCE_DIR}/runtime/src
   ${PROJECT_SOURCE_DIR}/runtime/src/atn
@@ -23,8 +7,6 @@ include_directories(
   ${PROJECT_SOURCE_DIR}/runtime/src/tree
   ${PROJECT_SOURCE_DIR}/runtime/src/tree/pattern
   ${PROJECT_SOURCE_DIR}/runtime/src/tree/xpath
-  ${UTFCPP_DIR}/install/include/utf8cpp
-  ${UTFCPP_DIR}/install/include/utf8cpp/utf8
 )
 
 
@@ -50,8 +32,49 @@ add_custom_target(make_lib_output_dir ALL
     COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_OUTPUT_DIR}
     )
 
-add_dependencies(antlr4_shared make_lib_output_dir utfcpp)
-add_dependencies(antlr4_static make_lib_output_dir utfcpp)
+add_dependencies(antlr4_shared make_lib_output_dir)
+add_dependencies(antlr4_static make_lib_output_dir)
+
+find_package(utf8cpp QUIET)
+
+set(INSTALL_utf8cpp FALSE)
+
+if (utf8cpp_FOUND)
+  target_link_libraries(antlr4_shared utf8cpp)
+  target_link_libraries(antlr4_static utf8cpp)
+else()
+
+  # older utf8cpp doesn't define the package above
+  find_path(utf8cpp_HEADER utf8.h
+    PATH_SUFFIXES utf8cpp
+    )
+
+  if (utf8cpp_HEADER)
+    include_directories(${utf8cpp_HEADER})
+  else()
+    include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
+    set(THIRDPARTY_DIR ${CMAKE_BINARY_DIR}/runtime/thirdparty)
+    set(UTFCPP_DIR ${THIRDPARTY_DIR}/utfcpp)
+    ExternalProject_Add(
+      utf8cpp
+      GIT_REPOSITORY        "git://github.com/nemtrif/utfcpp"
+      GIT_TAG               "v3.1.1"
+      SOURCE_DIR            ${UTFCPP_DIR}
+      UPDATE_DISCONNECTED   1
+      CMAKE_ARGS            -DCMAKE_INSTALL_PREFIX=${UTFCPP_DIR}/install 
-Dgtest_force_shared_crt=ON
+      TEST_AFTER_INSTALL    1
+      STEP_TARGETS          build)
+
+    include_directories(
+      ${UTFCPP_DIR}/install/include/utf8cpp
+      ${UTFCPP_DIR}/install/include/utf8cpp/utf8
+      )
+
+    add_dependencies(antlr4_shared utf8cpp)
+    add_dependencies(antlr4_static utf8cpp)
+    set(INSTALL_utf8cpp TRUE)
+  endif()
+endif()
 
 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
   target_link_libraries(antlr4_shared ${UUID_LIBRARIES})
@@ -131,13 +154,15 @@ install(DIRECTORY "${PROJECT_SOURCE_DIR}/runtime/src/"
         FILES_MATCHING PATTERN "*.h"
         )
 
-install(FILES "${UTFCPP_DIR}/source/utf8.h"
-        DESTINATION "include/antlr4-runtime")
-install(DIRECTORY "${UTFCPP_DIR}/source/utf8"
-        DESTINATION "include/antlr4-runtime"
-        COMPONENT dev
-        FILES_MATCHING PATTERN "*.h"
-        )
+if (INSTALL_utf8cpp)
+  install(FILES "${UTFCPP_DIR}/source/utf8.h"
+         DESTINATION "include/antlr4-runtime")
+  install(DIRECTORY "${UTFCPP_DIR}/source/utf8"
+         DESTINATION "include/antlr4-runtime"
+         COMPONENT dev
+         FILES_MATCHING PATTERN "*.h"
+         )
+endif()
 
 
 
-- 
2.30.0

Reply via email to