PATCH: security/gpgme: allow cmake to find .so files

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PATCH: security/gpgme: allow cmake to find .so files

Caspar Schutijser
Hi ports@,

Below is a patch that makes it possible to use the gpgme libraries
with cmake when not using the ports infrastructure. I build-tested
x11/kde4/pim (which uses cmake and depends on -main) and mail/trojita
(which uses cmake and depends on -qt) to make sure I didn't break
anything.

Thanks,
Caspar Schutijser


Index: Makefile
===================================================================
RCS file: /cvs/ports/security/gpgme/Makefile,v
retrieving revision 1.47
diff -u -p -r1.47 Makefile
--- Makefile 19 Feb 2019 16:04:43 -0000 1.47
+++ Makefile 24 Feb 2019 14:15:07 -0000
@@ -4,6 +4,8 @@ COMMENT-main = GnuPG Made Easy
 COMMENT-qt = Qt bindings for GPGme
 
 VERSION = 1.12.0
+REVISION-main = 0
+REVISION-qt = 0
 DISTNAME = gpgme-${VERSION}
 PKGNAME-main = gpgme-${VERSION}
 PKGNAME-qt = gpgme-qt-${VERSION}
@@ -67,6 +69,10 @@ CONFIGURE_ARGS += --enable-languages=''
 
 # needed for the regression tests
 USE_GMAKE = Yes
+
+pre-configure:
+ ${SUBST_CMD} ${WRKSRC}/lang/cpp/src/GpgmeppConfig.cmake.in.in
+ ${SUBST_CMD} ${WRKSRC}/lang/qt/src/QGpgmeConfig.cmake.in.in
 
 # The tests target gpg2. Running with gpg version 1 will give:
 # `./t-support.h:160: GPGME: Invalid crypto engine'
Index: patches/patch-lang_cpp_src_GpgmeppConfig_cmake_in_in
===================================================================
RCS file: patches/patch-lang_cpp_src_GpgmeppConfig_cmake_in_in
diff -N patches/patch-lang_cpp_src_GpgmeppConfig_cmake_in_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lang_cpp_src_GpgmeppConfig_cmake_in_in 24 Feb 2019 14:15:07 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: lang/cpp/src/GpgmeppConfig.cmake.in.in
+--- lang/cpp/src/GpgmeppConfig.cmake.in.in.orig
++++ lang/cpp/src/GpgmeppConfig.cmake.in.in
+@@ -63,8 +63,8 @@ add_library(Gpgmepp SHARED IMPORTED)
+
+ set_target_properties(Gpgmepp PROPERTIES
+   INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/gpgme++;@resolved_includedir@"
+-  INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme@libsuffix@;@LIBASSUAN_LIBS@"
+-  IMPORTED_LOCATION "@resolved_libdir@/libgpgmepp@libsuffix@"
++  INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme@libsuffix@.${LIBgpgme_VERSION};@LIBASSUAN_LIBS@"
++  IMPORTED_LOCATION "@resolved_libdir@/libgpgmepp@libsuffix@.${LIBgpgmepp_VERSION}"
+ )
+
+ if(CMAKE_VERSION VERSION_LESS 2.8.12)
Index: patches/patch-lang_qt_src_QGpgmeConfig_cmake_in_in
===================================================================
RCS file: patches/patch-lang_qt_src_QGpgmeConfig_cmake_in_in
diff -N patches/patch-lang_qt_src_QGpgmeConfig_cmake_in_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lang_qt_src_QGpgmeConfig_cmake_in_in 24 Feb 2019 14:15:07 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: lang/qt/src/QGpgmeConfig.cmake.in.in
+--- lang/qt/src/QGpgmeConfig.cmake.in.in.orig
++++ lang/qt/src/QGpgmeConfig.cmake.in.in
+@@ -64,7 +64,7 @@ add_library(QGpgme SHARED IMPORTED)
+ set_target_properties(QGpgme PROPERTIES
+   INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/qgpgme;@resolved_includedir@"
+   INTERFACE_LINK_LIBRARIES "Gpgmepp;Qt5::Core"
+-  IMPORTED_LOCATION "@resolved_libdir@/libqgpgme@libsuffix@"
++  IMPORTED_LOCATION "@resolved_libdir@/libqgpgme@libsuffix@.${LIBqgpgme_VERSION}"
+ )
+
+ if(CMAKE_VERSION VERSION_LESS 2.8.12)

Reply | Threaded
Open this post in threaded view
|

Re: PATCH: security/gpgme: allow cmake to find .so files

Caspar Schutijser
Hi,

On Sun, Feb 24, 2019 at 09:42:50PM +0100, Caspar Schutijser wrote:
> [...]

Here is a new attempt to explain why I am sending this patch.

The patch below allows the libraries provided by this port to be found
with cmake. This does not appear to be necessary for the ports tree
(the ports that use gpgme can be built, after all), however I do need
this in order to build a piece of software outside the ports tree
that uses gpgme.

Ports that have similar patches:
databases/xapian-core
devel/gwenhywfar
graphics/prison
productivity/aqbanking
x11/polkit-qt
x11/polkit-qt5

I successfully build-tested mail/trojita and x11/kde4/pim; these ports
depends on gpgme *and* use cmake.

Thanks,
Caspar Schutijser


Index: Makefile
===================================================================
RCS file: /cvs/ports/security/gpgme/Makefile,v
retrieving revision 1.56
diff -u -p -r1.56 Makefile
--- Makefile 15 Aug 2019 18:20:21 -0000 1.56
+++ Makefile 18 Jan 2020 12:23:54 -0000
@@ -7,7 +7,7 @@ VERSION = 1.13.1
 DISTNAME = gpgme-${VERSION}
 PKGNAME-main = gpgme-${VERSION}
 PKGNAME-qt = gpgme-qt-${VERSION}
-REVISION = 0
+REVISION = 1
 
 CATEGORIES = security devel
 
@@ -68,6 +68,10 @@ CONFIGURE_ARGS += --enable-languages=''
 
 # needed for the regression tests
 USE_GMAKE = Yes
+
+pre-configure:
+ ${SUBST_CMD} ${WRKSRC}/lang/cpp/src/GpgmeppConfig.cmake.in.in
+ ${SUBST_CMD} ${WRKSRC}/lang/qt/src/QGpgmeConfig.cmake.in.in
 
 # The tests target gpg2. Running with gpg version 1 will give:
 # `./t-support.h:160: GPGME: Invalid crypto engine'
Index: patches/patch-lang_cpp_src_GpgmeppConfig_cmake_in_in
===================================================================
RCS file: patches/patch-lang_cpp_src_GpgmeppConfig_cmake_in_in
diff -N patches/patch-lang_cpp_src_GpgmeppConfig_cmake_in_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lang_cpp_src_GpgmeppConfig_cmake_in_in 18 Jan 2020 12:23:54 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: lang/cpp/src/GpgmeppConfig.cmake.in.in
+--- lang/cpp/src/GpgmeppConfig.cmake.in.in.orig
++++ lang/cpp/src/GpgmeppConfig.cmake.in.in
+@@ -63,8 +63,8 @@ add_library(Gpgmepp SHARED IMPORTED)
+
+ set_target_properties(Gpgmepp PROPERTIES
+   INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/gpgme++;@resolved_includedir@"
+-  INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme@libsuffix@;@LIBASSUAN_LIBS@"
+-  IMPORTED_LOCATION "@resolved_libdir@/libgpgmepp@libsuffix@"
++  INTERFACE_LINK_LIBRARIES "pthread;@resolved_libdir@/libgpgme@libsuffix@.${LIBgpgme_VERSION};@LIBASSUAN_LIBS@"
++  IMPORTED_LOCATION "@resolved_libdir@/libgpgmepp@libsuffix@.${LIBgpgmepp_VERSION}"
+ )
+
+ if(CMAKE_VERSION VERSION_LESS 2.8.12)
Index: patches/patch-lang_qt_src_QGpgmeConfig_cmake_in_in
===================================================================
RCS file: patches/patch-lang_qt_src_QGpgmeConfig_cmake_in_in
diff -N patches/patch-lang_qt_src_QGpgmeConfig_cmake_in_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lang_qt_src_QGpgmeConfig_cmake_in_in 18 Jan 2020 12:23:54 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: lang/qt/src/QGpgmeConfig.cmake.in.in
+--- lang/qt/src/QGpgmeConfig.cmake.in.in.orig
++++ lang/qt/src/QGpgmeConfig.cmake.in.in
+@@ -64,7 +64,7 @@ add_library(QGpgme SHARED IMPORTED)
+ set_target_properties(QGpgme PROPERTIES
+   INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/qgpgme;@resolved_includedir@"
+   INTERFACE_LINK_LIBRARIES "Gpgmepp;Qt5::Core"
+-  IMPORTED_LOCATION "@resolved_libdir@/libqgpgme@libsuffix@"
++  IMPORTED_LOCATION "@resolved_libdir@/libqgpgme@libsuffix@.${LIBqgpgme_VERSION}"
+ )
+
+ if(CMAKE_VERSION VERSION_LESS 2.8.12)