-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.14.19: pkgconfig integration contains no version #442
Comments
From initial investigation it appears that 470041b broke this. https://github.com/pupnp/pupnp/blob/fb90d0ca1954bd2abf33b004e55eeb50c07cbb62/cmake/autoheader.cmake uses the files in question to derive the version via rather complex regexes. This seems rather complicated. Can an easier/ less brittle way be found to set the version? |
Unfortunately there is no easier way as libtool calculates the so-version in some "interessting" way. But from a quick look (with my mobile), the overall version should be matched correct (1.14.19 in CMakeCache), only the versions for the libs itself rely on the old format. Can you check if it works if you remove the spaces after the comma on line 24? |
I am not sure I made the change you requested correctly: diff --git a/cmake/autoheader.cmake b/cmake/autoheader.cmake
index df61622..883ff48 100644
--- a/cmake/autoheader.cmake
+++ b/cmake/autoheader.cmake
@@ -21,7 +21,7 @@ if (NOT PUPNP_VERSION_STRING)
if (line MATCHES "AC_INIT.* ([0-9]*\\.[0-9]*\\.[0-9]*).*")
message (STATUS "Setting package-version to ${CMAKE_MATCH_1}")
set (PUPNP_VERSION_STRING ${CMAKE_MATCH_1} CACHE STRING "Version of the whole package" FORCE)
- elseif (line MATCHES "[. \t]*AC_DEFINE_UNQUOTED *\\(([^,]*), *([^,]*), *([^\\)]*)")
+ elseif (line MATCHES "[. \t]*AC_DEFINE_UNQUOTED *\\(([^,]*),*([^,]*),*([^\\)]*)")
set (SAVED_MATCH ${CMAKE_MATCH_1})
if ("${CMAKE_MATCH_1}" IN_LIST WRITTEN_VARS) The result is the different in that with the change applied the build fails with:
|
Did I misunderstand you and the change you meant was: diff --git a/cmake/autoheader.cmake b/cmake/autoheader.cmake
index df616225..e79e963f 100644
--- a/cmake/autoheader.cmake
+++ b/cmake/autoheader.cmake
diff --git a/cmake/autoheader.cmake b/cmake/autoheader.cmake
index df616225..ce655a6e 100644
--- a/cmake/autoheader.cmake
+++ b/cmake/autoheader.cmake
@@ -18,7 +18,7 @@ if (NOT PUPNP_VERSION_STRING)
string (REGEX REPLACE ";" "" line ${line})
string (REGEX REPLACE "[ \t\r\n] *" " " line ${line})
- if (line MATCHES "AC_INIT.* ([0-9]*\\.[0-9]*\\.[0-9]*).*")
+ if (line MATCHES "AC_INIT.*([0-9]+\\.[0-9]+\\.[0-9]+).*")
message (STATUS "Setting package-version to ${CMAKE_MATCH_1}")
set (PUPNP_VERSION_STRING ${CMAKE_MATCH_1} CACHE STRING "Version of the whole package" FORCE)
elseif (line MATCHES "[. \t]*AC_DEFINE_UNQUOTED *\\(([^,]*), *([^,]*), *([^\\)]*)") |
Maybe we should put some comments on autoheader.cmake, it is hard to understand what those regex are doing. Best regards. |
@loqs I meant the first change. It seems there should be some quotes as the version STRING is interpreted as number. At least in autoconfig.h, as the mentioned redefinition is correct. So I guess the first regex change with the right quoting in the autoconfig.h.cm (rough guess as I didn't find any call regarding this), should fix this. Or the redefinition will just have another content. I'm back home on monday to investigate this if it's not found till then. @mrjimenez: Sure comments would help, I hoped to never touch this again, I remember a week where I tried to replicate the behaviour of libtool based on your description. Basically it iterates over the parts of the version in LT_SUBST (?) and does the math. If I am the one to fix that, I'll find the thread from these days and put in some explanations. |
@Vollstrecker the second change I mentioned fixes it for me. |
I created this pull request #443, tell me what you think. |
I feel your pain 😆 , regexes per si are hell, quoted regexes are a torture... |
However, I did notice lots of warings like this on the cmake build:
Is this normal? Is there a fix? |
Hi! 👋
I package this project for Arch Linux.
With 1.14.19 we noticed that the pkgconfig file no longer carries version information (see https://gitlab.archlinux.org/archlinux/packaging/packages/libupnp/-/issues/1 for an upstream bug report).
We are always building from auto-generated source tarballs and therefore from our end nothing has changed since 1.14.18 (which still contains version information in the file).
cmake emits the following:
The text was updated successfully, but these errors were encountered: