You are not logged in.

#1 2023-04-02 16:57:13

rtw0
Member
Registered: 2023-04-02
Posts: 27

GPGME - CMake Error at cmake/modules/FindGpgme.cmake

Hi everyone,
I've seen on arch linux documentation that it is possible to create a container using the zypper tool. But zypper seems impossible to install. I've tried pacman to install it, aurutils, pakku, paru, trizen, yay, you name it! So, I turned to compiling zypper with "makepkg -si PKGBUILD" after cloning the git repo. And I've been trying that process over and over again. Each time I get this message when building zypper but other builds also:

CMake Error at cmake/modules/FindGpgme.cmake:398 (message):
  Did not find GPGME
Call Stack (most recent call first):
  CMakeLists.txt:248 (FIND_PACKAGE)

I even tried to tweak build files in search for typos or wrong path settings, but to no avail.

Could anyone show me a link or tip to some info on the web? That too has been impossible.

Check out this link for running openSuse in a container using zypper:
https://man.archlinux.org/man/systemd-nspawn.1.en

Cheers,
rtw0

Offline

#2 2023-04-03 10:06:38

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,167

Re: GPGME - CMake Error at cmake/modules/FindGpgme.cmake

The AUR zypper page   shows 1.14.52 as version but upstream lists 1.14.60 as latest version.

I suggest you flag the package out of date to alert the maintainer to the new version .

Incase you don't like wating until the maintainer has updated it, edit pkgver in the PKGBUILD to build 1.14.60 and try to build again .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2023-04-03 16:58:22

loqs
Member
Registered: 2014-03-06
Posts: 17,714

Re: GPGME - CMake Error at cmake/modules/FindGpgme.cmake

https://github.com/gpg/gpgme/commit/02a … 26273ced8c
https://github.com/openSUSE/libzypp/blo … cmake#L186 which is missing on Arch so detection fails

Temporary fix to get the package to build,  switch to using PKG_CHECK_MODULES.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 568a2fa..3bcb9cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -253,13 +253,7 @@ ELSE()
   ENDIF()
 ENDIF( LIBSOLV_SRCDIR AND LIBSOLV_BUILDDIR )
 
-FIND_PACKAGE(Gpgme REQUIRED)
-IF ( NOT GPGME_PTHREAD_FOUND )
-  MESSAGE( FATAL_ERROR " gpgme not found" )
-ELSE()
-  INCLUDE_DIRECTORIES( ${GPGME_INCLUDES} )
-  LINK_DIRECTORIES(${GPGME_LIBRARY_DIR})
-ENDIF()
+PKG_CHECK_MODULES (GPGME gpgme REQUIRED)
 
 FIND_PACKAGE(OpenSSL REQUIRED)
 
diff --git a/zypp/CMakeLists.txt b/zypp/CMakeLists.txt
index 26d9d99..1e927f7 100644
--- a/zypp/CMakeLists.txt
+++ b/zypp/CMakeLists.txt
@@ -911,7 +911,7 @@ macro( ADDZYPPLIB LIBNAME )
   TARGET_LINK_LIBRARIES(${LIBNAME} ${LibSolv_LIBRARIES} )
   #TARGET_LINK_LIBRARIES(${LIBNAME} ${SIGNALS_LIBRARY})
   TARGET_LINK_LIBRARIES(${LIBNAME} ${Boost_THREAD_LIBRARY})
-  TARGET_LINK_LIBRARIES(${LIBNAME} ${GPGME_PTHREAD_LIBRARIES})
+  TARGET_LINK_LIBRARIES(${LIBNAME} ${GPGME_LIBRARIES})
   target_link_libraries(${LIBNAME} ${YAML_CPP_LIBRARIES})
   target_link_libraries(${LIBNAME} ${PROTOBUF_LITE_LIBRARIES})
   TARGET_LINK_LIBRARIES(${LIBNAME} pthread )

You will also need at least libzyp 17.30.3 to build with gcc 12 https://github.com/openSUSE/libzypp/com … 46d416cf6c

Last edited by loqs (2023-04-03 16:58:40)

Offline

#4 2023-04-04 15:08:40

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: GPGME - CMake Error at cmake/modules/FindGpgme.cmake

Thanks loqs,

Switching to PKG_CHECK_MODULES works fine, no bug reported as far as GPGME is concerned.

Yet, other problems are emerging each time I run makepkg, and with every bug or typo that I fix, the building process stops with a new error. I probably have to learn to handle the tools that make building from source easier.

Cheers,
rtw0

Offline

#5 2023-04-04 18:02:32

loqs
Member
Registered: 2014-03-06
Posts: 17,714

Re: GPGME - CMake Error at cmake/modules/FindGpgme.cmake

I did not encounter any additional errors building libzyp 17.30.3 in a clean chroot

$ git diff
diff --git a/PKGBUILD b/PKGBUILD
index dfbbd21..7c5051f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
 
 pkgbase=libzypp
 pkgname=(libzypp libzypp-doc)
-pkgver=17.30.0
+pkgver=17.30.3
 pkgrel=1
 pkgdesc="ZYpp Package Management library"
 arch=('x86_64')
@@ -29,8 +29,14 @@ makedepends=(
   'gnupg'
   'graphviz'
 )
-source=("${pkgname}-${pkgver}::https://github.com/openSUSE/${pkgname}/archive/${pkgver}.tar.gz")
-sha256sums=('3410a4cf7a40467c544ad221f3116aab6ba198b27a9c150116c93b5950f74815')
+source=("${pkgname}-${pkgver}::https://github.com/openSUSE/${pkgname}/archive/${pkgver}.tar.gz"
+         test.patch)
+sha256sums=('5aa6305c492df46c13164da6e5b44dedb2271666c8e85efc808abf48d2130bf1'
+            '02b729f5c1faf2791f34c1392d4fe170b1a9d6b4d2a8c1264075cf555438bb83')
+
+prepare() {
+  patch -Np1 -i ../test.patch -d ${pkgname}-${pkgver}
+}
 
 build() {
   cmake \

Offline

#6 2023-04-05 10:02:10

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: GPGME - CMake Error at cmake/modules/FindGpgme.cmake

I've created a clean chroot, so far so good. But there's still something not working, the build process complains that there is no test.patch in the directory. I'm going to read through the docs about patching packages, and then I'll try your diff again. If you're still willing to help, could your explain the following extract from your diff?

prepare() {
+  patch -Np1 -i ../test.patch -d ${pkgname}-${pkgver}

I understand that the function is required to do something with a file named test.patch located in the parent directory.

Cheers,
rtw0

Offline

#7 2023-04-05 10:53:43

loqs
Member
Registered: 2014-03-06
Posts: 17,714

Re: GPGME - CMake Error at cmake/modules/FindGpgme.cmake

Copy the contents of the code block in post #3 into a file named test.patch located in the same directory as the PKGBUILD.
For more on patching see https://wiki.archlinux.org/title/Patchi … ng_patches

Offline

#8 2023-04-05 15:27:27

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: GPGME - CMake Error at cmake/modules/FindGpgme.cmake

I've modified PKGBUILD and CMakeLists.txt manually as there are few changes and I need to understand better how to patch files before even trying.

I've used makepkg --nobuild in order to have access to some files before the building process. This is how I could change CMakeLists.txt manually.

I thought it would work as /zypp/base/Random.cc in the 17.30.3 version now includes the header file missing in the 17.30.0 version.

I wonder if the problem doesn't come from my environment. Why do I get those repeated errors, I don't have a clue. Here's one among many.

collect2: error: ld returned 1 exit status
make[2]: *** [tools/CMakeFiles/DiskUsageCounter.dir/build.make:118: tools/DiskUsageCounter] Error 1
make[1]: *** [CMakeFiles/Makefile2:1784: tools/CMakeFiles/DiskUsageCounter.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

I understand that I'm told to change lines according to Makefile instruction at line 166. So I change /DiskUsageCounter.dir/build.make to /DiskUsageCounter.dir/all. It works until I get another error with the same [Makefile:166: all] report but in another file, the target always being *.dir/build.make or *.dir/link.txt.

Any idea what is going wrong?

Offline

#9 2023-04-05 22:54:45

loqs
Member
Registered: 2014-03-06
Posts: 17,714

Re: GPGME - CMake Error at cmake/modules/FindGpgme.cmake

rtw0 wrote:

Any idea what is going wrong?

No.  The only changes I made are contained in the patch file in post #3 and the changes I made to apply it and update the pkgver to 17.30.3 shown in post #5.

Offline

#10 2023-04-06 07:06:20

rtw0
Member
Registered: 2023-04-02
Posts: 27

Re: GPGME - CMake Error at cmake/modules/FindGpgme.cmake

Thanks for all your help loqs, it has been really precious to me. I'll try my best on my own and will also, if needed, post another message with another subject title as the problem with cmake/modules/FindGpgme.cmake is now solved.

Offline

Board footer

Powered by FluxBB