public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/wireshark] f43: Adding patch
@ 2026-09-22 19:30 Michal Ruprich
0 siblings, 0 replies; only message in thread
From: Michal Ruprich @ 2026-09-22 19:30 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/wireshark
Branch : f43
Commit : aa822250ea9ebe0b4199522aba92b3c931488a0b
Author : Michal Ruprich <mruprich@redhat.com>
Date : 2026-03-08T20:26:33+01:00
Stats : +463/-0 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/wireshark/c/aa822250ea9ebe0b4199522aba92b3c931488a0b?branch=f43
Log:
Adding patch
---
diff --git a/wireshark-0010-find-lua-5.5.patch b/wireshark-0010-find-lua-5.5.patch
new file mode 100644
index 0000000..c1238a1
--- /dev/null
+++ b/wireshark-0010-find-lua-5.5.patch
@@ -0,0 +1,463 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4542efa..56c5c25 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1545,8 +1545,7 @@ if(FETCH_lua)
+ # Download and build lua
+ include(${CMAKE_SOURCE_DIR}/cmake/external/lua54/Lua54.cmake)
+ else()
+- set(LUA_FIND_VERSIONS "5.4;5.3" CACHE STRING "Lua versions valid for the build (as a list)")
+- ws_find_package(Lua ENABLE_LUA HAVE_LUA)
++ ws_find_package(Lua ENABLE_LUA HAVE_LUA "5.3")
+ endif()
+
+ ws_find_package(NL ENABLE_NETLINK HAVE_LIBNL)
+diff --git a/cmake/modules/FindLua.cmake b/cmake/modules/FindLua.cmake
+index 7bacfdd..87171f5 100644
+--- a/cmake/modules/FindLua.cmake
++++ b/cmake/modules/FindLua.cmake
+@@ -1,50 +1,149 @@
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+-# file Copyright.txt or https://cmake.org/licensing for details.
++# file LICENSE.rst or https://cmake.org/licensing for details.
+
+ #[=======================================================================[.rst:
+ FindLua
+ -------
+
+-Locate Lua library.
++Finds the Lua library:
++
++.. code-block:: cmake
++
++ find_package(Lua [<version>] [...])
++
++Lua is a embeddable scripting language.
+
+ .. versionadded:: 3.18
+ Support for Lua 5.4.
+
+-This module defines:
++.. versionadded:: 4.3
++ Support for Lua 5.5.
++
++When working with Lua, its library headers are intended to be included in
++project source code as:
++
++.. code-block:: c
++
++ #include <lua.h>
++
++and not:
++
++.. code-block:: c
++
++ #include <lua/lua.h>
++
++This is because, the location of Lua headers may differ across platforms and may
++exist in locations other than ``lua/``.
++
++Result Variables
++^^^^^^^^^^^^^^^^
++
++This module defines the following variables:
++
++``Lua_FOUND``
++ .. versionadded:: 3.3
++
++ Boolean indicating whether (the requested version of) Lua was found.
++
++``Lua_VERSION``
++ .. versionadded:: 4.2
++
++ The version of Lua found.
++
++``Lua_VERSION_MAJOR``
++ .. versionadded:: 4.2
++
++ The major version of Lua found.
++
++``Lua_VERSION_MINOR``
++ .. versionadded:: 4.2
++
++ The minor version of Lua found.
++
++``Lua_VERSION_PATCH``
++ .. versionadded:: 4.2
++
++ The patch version of Lua found.
+
+-``LUA_FOUND``
+- if false, do not try to link to Lua
+ ``LUA_LIBRARIES``
+- both lua and lualib
++ Libraries needed to link against to use Lua. This list includes both ``lua``
++ and ``lualib`` libraries.
++
++Cache Variables
++^^^^^^^^^^^^^^^
++
++The following cache variables may also be set:
++
+ ``LUA_INCLUDE_DIR``
+- where to find lua.h
++ The directory containing the Lua header files, such as ``lua.h``,
++ ``lualib.h``, and ``lauxlib.h``, needed to use Lua.
++
++Deprecated Variables
++^^^^^^^^^^^^^^^^^^^^
++
++The following variables are provided for backward compatibility:
++
++``LUA_FOUND``
++ .. deprecated:: 4.2
++ Use ``Lua_FOUND``, which has the same value.
++
++ Boolean indicating whether (the requested version of) Lua was found.
++
+ ``LUA_VERSION_STRING``
+- the version of Lua found
++ .. deprecated:: 4.2
++ Superseded by the ``Lua_VERSION``.
++
++ The version of Lua found.
++
+ ``LUA_VERSION_MAJOR``
+- the major version of Lua
++ .. deprecated:: 4.2
++ Superseded by the ``Lua_VERSION_MAJOR``.
++
++ The major version of Lua found.
++
+ ``LUA_VERSION_MINOR``
+- the minor version of Lua
++ .. deprecated:: 4.2
++ Superseded by the ``Lua_VERSION_MINOR``.
++
++ The minor version of Lua found.
++
+ ``LUA_VERSION_PATCH``
+- the patch version of Lua
++ .. deprecated:: 4.2
++ Superseded by the ``Lua_VERSION_PATCH``.
+
+-Note that the expected include convention is
++ The patch version of Lua found.
+
+-::
++Examples
++^^^^^^^^
+
+- #include "lua.h"
++Finding the Lua library and creating an interface :ref:`imported target
++<Imported Targets>` that encapsulates its usage requirements for linking to a
++project target:
+
+-and not
++.. code-block:: cmake
+
+-::
++ find_package(Lua)
+
+- #include <lua/lua.h>
++ if(Lua_FOUND AND NOT TARGET Lua::Lua)
++ add_library(Lua::Lua INTERFACE IMPORTED)
++ set_target_properties(
++ Lua::Lua
++ PROPERTIES
++ INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}"
++ INTERFACE_LINK_LIBRARIES "${LUA_LIBRARIES}"
++ )
++ endif()
+
+-This is because, the lua location is not standardized and may exist in
+-locations other than lua/
++ target_link_libraries(project_target PRIVATE Lua::Lua)
+ #]=======================================================================]
+
+ cmake_policy(PUSH) # Policies apply to functions at definition-time
+-cmake_policy(SET CMP0012 NEW) # For while(TRUE)
++if(POLICY CMP0140)
++ cmake_policy(SET CMP0140 NEW)
++endif()
++if(POLICY CMP0159)
++ cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
++endif()
+
+ INCLUDE(FindWSWinLibs)
+ FindWSWinLibs("lua-5*" "LUA_HINTS")
+@@ -55,12 +154,39 @@ unset(_lua_append_versions)
+
+ # this is a function only to have all the variables inside go away automatically
+ function(_lua_get_versions)
+- set(LUA_VERSIONS5 ${LUA_FIND_VERSIONS})
+- list(FILTER LUA_VERSIONS5 INCLUDE REGEX "5\.[43]")
+- set(_lua_append_versions ${LUA_VERSIONS5})
+- message(STATUS "Considering the following Lua versions: ${_lua_append_versions}")
++ set(LUA_VERSIONS5 5.5 5.4 5.3 5.2 5.1 5.0)
++
++ if (Lua_FIND_VERSION_EXACT)
++ if (Lua_FIND_VERSION_COUNT GREATER 1)
++ set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
++ endif ()
++ elseif (Lua_FIND_VERSION)
++ # once there is a different major version supported this should become a loop
++ if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
++ if (Lua_FIND_VERSION_COUNT EQUAL 1)
++ set(_lua_append_versions ${LUA_VERSIONS5})
++ else ()
++ foreach (subver IN LISTS LUA_VERSIONS5)
++ if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
++ list(APPEND _lua_append_versions ${subver})
++ endif ()
++ endforeach ()
++ # New version -> Search for it (heuristic only! Defines in include might have changed)
++ if (NOT _lua_append_versions)
++ set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
++ endif()
++ endif ()
++ endif ()
++ else ()
++ # once there is a different major version supported this should become a loop
++ set(_lua_append_versions ${LUA_VERSIONS5})
++ endif ()
++
++ if (LUA_Debug)
++ message(STATUS "Considering following Lua versions: ${_lua_append_versions}")
++ endif()
+
+- set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
++ set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
+ endfunction()
+
+ function(_lua_set_version_vars)
+@@ -82,10 +208,10 @@ function(_lua_set_version_vars)
+ endforeach ()
+
+ set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
+-endfunction(_lua_set_version_vars)
++endfunction()
+
+ function(_lua_get_header_version)
+- unset(LUA_VERSION_STRING PARENT_SCOPE)
++ unset(Lua_VERSION PARENT_SCOPE)
+ set(_hdr_file "${LUA_INCLUDE_DIR}/lua.h")
+
+ if (NOT EXISTS "${_hdr_file}")
+@@ -98,30 +224,42 @@ function(_lua_get_header_version)
+ file(STRINGS "${_hdr_file}" lua_version_strings
+ REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
+
+- string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
+- if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
+- string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
+- string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
+- set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
++ string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR(_N)?[ \t]+\"?([0-9])\"?[ \t]*;.*" "\\2" Lua_VERSION_MAJOR ";${lua_version_strings};")
++
++ if (Lua_VERSION_MAJOR MATCHES "^[0-9]+$")
++ string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR(_N)?[ \t]+\"?([0-9])\"?[ \t]*;.*" "\\2" Lua_VERSION_MINOR ";${lua_version_strings};")
++ string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE(_N)?[ \t]+\"?([0-9])\"?[ \t]*;.*" "\\2" Lua_VERSION_PATCH ";${lua_version_strings};")
++ set(Lua_VERSION "${Lua_VERSION_MAJOR}.${Lua_VERSION_MINOR}.${Lua_VERSION_PATCH}")
+ else ()
+- string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
+- if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
+- string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
++ string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" Lua_VERSION ";${lua_version_strings};")
++ if (NOT Lua_VERSION MATCHES "^[0-9.]+$")
++ string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" Lua_VERSION ";${lua_version_strings};")
+ endif ()
+- string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
+- string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
+- string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
++ string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" Lua_VERSION_MAJOR "${Lua_VERSION}")
++ string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" Lua_VERSION_MINOR "${Lua_VERSION}")
++ string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" Lua_VERSION_PATCH "${Lua_VERSION}")
+ endif ()
+ foreach (ver IN LISTS _lua_append_versions)
+- if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
+- set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
+- set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
+- set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
+- set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
+- return()
++ if (ver STREQUAL "${Lua_VERSION_MAJOR}.${Lua_VERSION_MINOR}")
++ set(LUA_VERSION_STRING "${Lua_VERSION}")
++ set(LUA_VERSION_MAJOR "${Lua_VERSION_MAJOR}")
++ set(LUA_VERSION_MINOR "${Lua_VERSION_MINOR}")
++ set(LUA_VERSION_PATCH "${Lua_VERSION_PATCH}")
++
++ return(
++ PROPAGATE
++ Lua_VERSION
++ Lua_VERSION_MAJOR
++ Lua_VERSION_MINOR
++ Lua_VERSION_PATCH
++ LUA_VERSION_STRING
++ LUA_VERSION_MAJOR
++ LUA_VERSION_MINOR
++ LUA_VERSION_PATCH
++ )
+ endif ()
+ endforeach ()
+-endfunction(_lua_get_header_version)
++endfunction()
+
+ function(_lua_find_header)
+ _lua_set_version_vars()
+@@ -147,9 +285,9 @@ function(_lua_find_header)
+ endif()
+ _lua_get_header_version()
+ # Found accepted version -> Ok
+- if (LUA_VERSION_STRING)
++ if (Lua_VERSION)
+ if (LUA_Debug)
+- message(STATUS "Found suitable version ${LUA_VERSION_STRING} in ${LUA_INCLUDE_DIR}/lua.h")
++ message(STATUS "Found suitable version ${Lua_VERSION} in ${LUA_INCLUDE_DIR}/lua.h")
+ endif()
+ return()
+ endif()
+@@ -169,12 +307,12 @@ _lua_find_header()
+ _lua_get_header_version()
+ unset(_lua_append_versions)
+
+-if (LUA_VERSION_STRING)
++if (Lua_VERSION)
+ set(_lua_library_names
+- lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}
+- lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
+- lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
+- lua.${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
++ lua${Lua_VERSION_MAJOR}${Lua_VERSION_MINOR}
++ lua${Lua_VERSION_MAJOR}.${Lua_VERSION_MINOR}
++ lua-${Lua_VERSION_MAJOR}.${Lua_VERSION_MINOR}
++ lua.${Lua_VERSION_MAJOR}.${Lua_VERSION_MINOR}
+ )
+ endif ()
+
+@@ -189,7 +327,7 @@ find_library(LUA_LIBRARY
+ unset(_lua_library_names)
+
+ if (LUA_LIBRARY)
+- # include the math library for Unix
++ # include the math library for Unixes other than macOS
+ if (UNIX AND NOT APPLE AND NOT BEOS)
+ find_library(LUA_MATH_LIBRARY m)
+ mark_as_advanced(LUA_MATH_LIBRARY)
+@@ -208,11 +346,9 @@ if (LUA_LIBRARY)
+ endif ()
+
+ include(FindPackageHandleStandardArgs)
+-# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
+-# all listed variables are TRUE
+-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
++find_package_handle_standard_args(Lua
+ REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
+- VERSION_VAR LUA_VERSION_STRING)
++ VERSION_VAR Lua_VERSION)
+
+ mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY)
+
+@@ -220,8 +356,6 @@ cmake_policy(POP)
+
+ IF(Lua_FOUND)
+ SET( LUA_INCLUDE_DIRS ${LUA_INCLUDE_DIR} )
+-
+- unset(HAVE_LUA_INTEGER_SIZE CACHE)
+ cmake_push_check_state()
+ include(CheckTypeSize)
+ set(CMAKE_REQUIRED_INCLUDES ${LUA_INCLUDE_DIR})
+@@ -244,6 +378,55 @@ IF(Lua_FOUND)
+ # it here.
+ set(HAVE_LUA_UNICODE True)
+ endif()
++
++ #
++ # Lua 5.4.5 broke the Lua API by adding a second argument to
++ # lua_resetthread().
++ #
++ # Fedora, and possibly other Linux distributions, compounded
++ # that error by backporting a fix from 5.4.5 that iincluded
++ # that API-breaking change, but didn't change LUA_VERSION_RELEASE_NUM,
++ # so that checking for LUA_VERSION_RELEASE_NUM == 50404 isn't
++ # sufficient to detect the broken version of the API.
++ #
++ # See the thread starting at
++ #
++ # https://lists.wireshark.org/archives/wireshark-dev/202511/msg00031.html
++ #
++ # So we do it the hard way, by checking whether a program that
++ # calls the one-argument version compiles.
++ #
++ # CMake doesn't appear to support "check whether this C source
++ # compiles, but don't bother testing whether it links", which
++ # is what we want here - all we care about is whether the
++ # two-argument call to lua_resetthread() compiles or fails to
++ # compile, not whether the routine is available in the library.
++ # This test will fail if the link fails; we are testing with
++ # a two-argument call, so that means that, if the link fails
++ # for any reason (wrong required libraries, wrong required flags,
++ # etc.), we'll treat Lua as having a one-argument lua_resetthread().
++ #
++ include(CheckCSourceCompiles)
++ cmake_push_check_state()
++ set(CMAKE_REQUIRED_INCLUDES ${LUA_INCLUDE_DIR})
++ set(CMAKE_EXTRA_INCLUDE_FILES "luaconf.h")
++ set(CMAKE_REQUIRED_LIBRARIES ${LUA_LIBRARIES})
++ check_c_source_compiles(
++ "
++//
++// Undo any definition of _FORTIFY_SOURCE, so that we don't get a
++// complaint that we're compiling without optimization.
++//
++#undef _FORTIFY_SOURCE
++#include <lua.h>
++
++int
++main(void)
++{
++ return lua_resetthread(NULL, NULL);
++}
++" HAVE_TWO_ARGUMENT_LUA_RESETTHREAD)
++ cmake_pop_check_state()
+ ELSE(Lua_FOUND)
+ SET( LUA_LIBRARIES )
+ SET( LUA_INCLUDE_DIRS )
+From ec16791d8d68f9045400a0610a5a10b1ea544dfd Mon Sep 17 00:00:00 2001
+From: Jaap Keuter <jaap.keuter@xs4all.nl>
+Date: Thu, 5 Mar 2026 22:52:23 +0100
+Subject: [PATCH] Lua: Adjust for Lua 5.5 lua_newstate parameter extension
+
+In Lua 5.5 the lua_newstate function gained a new parameter.
+Create a conditional compilation to handle the difference.
+
+Fixes #21060
+
+AI-Assisted: no
+---
+ epan/wslua/init_wslua.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c
+index cd47e6737fe..b1fe8a3f980 100644
+--- a/epan/wslua/init_wslua.c
++++ b/epan/wslua/init_wslua.c
+@@ -1714,7 +1714,15 @@ void wslua_init(register_cb cb, void *client_data, const char* app_env_var_prefi
+ }
+
+ if (!L) {
++#if LUA_VERSION_NUM > 504
++ // This function now requires a hash seed for the JS hash function
++ // (by Justin Sobel) as used for Lua's string hashing function.
++ // However the seed is mangled with the string length before use,
++ // so it doesn't really matter what it is.
++ L = lua_newstate(wslua_allocf, NULL, 1315423911);
++#else
+ L = lua_newstate(wslua_allocf, NULL);
++#endif
+ }
+
+ WSLUA_INIT(L);
+--
+GitLab
+
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-22 19:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 19:30 [rpms/wireshark] f43: Adding patch Michal Ruprich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox