[Pkg-privacy-commits] [irssi-plugin-otr] 32/267: Added indirect libgcrypt dependency.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:26:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository irssi-plugin-otr.

commit 732a857d10a2e808d0bfc1ef09f687ddd588461a
Author: Uli Meis <a.sporto+bee at gmail.com>
Date:   Wed Aug 20 21:24:22 2008 +0200

    Added indirect libgcrypt dependency.
    
    Caused trouble if libgcrypt was not in the same path as libotr.
---
 CMakeLists.txt                         | 18 ++++++++++--
 cmake-extensions/COPYING-CMAKE-SCRIPTS | 22 ++++++++++++++
 cmake-extensions/FindLibGcrypt.cmake   | 52 ++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 266c5da..0d93cac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,6 +94,10 @@ IF (LIBOTR_VERSION LESS "3.1.0")
   MESSAGE(FATAL_ERROR "Need libotr version >= 3.1.0 (fragmentation)")
 ENDIF (LIBOTR_VERSION LESS "3.1.0")
 
+# LIBGCRYPT. A dependency of libotr and therefore one of ours.
+
+FIND_PACKAGE(LibGcrypt REQUIRED)
+
 # irssi public headers
 
 FIND_PATH(IRSSI_INCLUDE_DIR NAMES irssi/src/core/module.h)
@@ -119,7 +123,7 @@ SET(IRSSIOTR_INCLUDE_DIRS
 
 include_directories(${IRSSIOTR_INCLUDE_DIRS})
 SET(CMAKE_REQUIRED_INCLUDES ${IRSSIOTR_INCLUDE_DIRS})
-SET(CMAKE_REQUIRED_DEFINITIONS -DHAVE_CONFIG_H)
+SET(CMAKE_REQUIRED_DEFINITIONS -DHAVE_CONFIG_H ${LIBGCRYPT_CFLAGS})
 
 # gregex.h 
 # available since 2.13 AFAIK
@@ -171,7 +175,7 @@ SET(CMAKE_C_FLAGS_DEBUG -g)
 
 MESSAGE(STATUS "This is a ${CMAKE_BUILD_TYPE} build")
 
-ADD_DEFINITIONS(-DHAVE_CONFIG_H -Wall)
+ADD_DEFINITIONS(-DHAVE_CONFIG_H -Wall ${LIBGCRYPT_CFLAGS})
 
 # docdir
 
@@ -199,9 +203,17 @@ TARGET_LINK_LIBRARIES(otr ${GLIB_LIBRARIES} ${LIBOTR_LIBRARIES})
 # Now that took some time to figure out...
 
 IF(APPLE)
-  SET_TARGET_PROPERTIES(otr PROPERTIES LINK_FLAGS "-single_module -undefined dynamic_lookup")
+  SET(APPLE_LDFLAGS "-single_module -undefined dynamic_lookup")
+  SET_TARGET_PROPERTIES(otr PROPERTIES SUFFIX ".so")
 ENDIF(APPLE)
 
+FOREACH(X ${LIBGCRYPT_LDFLAGS} ${GLIB_LDFLAGS} ${APPLE_LDFLAGS})
+  SET(MAIN_LDFLAGS "${MAIN_LDFLAGS} ${X}")
+ENDFOREACH(X ${LIBGCRYPT_LDFLAGS} ${GLIB_LDFLAGS} ${APPLE_LDFLAGS})
+
+SET_TARGET_PROPERTIES(otr PROPERTIES 
+  LINK_FLAGS "${MAIN_LDFLAGS}")
+
 # cscope
 
 FILE(GLOB CSANDHS *.c *.h)
diff --git a/cmake-extensions/COPYING-CMAKE-SCRIPTS b/cmake-extensions/COPYING-CMAKE-SCRIPTS
new file mode 100644
index 0000000..4b41776
--- /dev/null
+++ b/cmake-extensions/COPYING-CMAKE-SCRIPTS
@@ -0,0 +1,22 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products 
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/cmake-extensions/FindLibGcrypt.cmake b/cmake-extensions/FindLibGcrypt.cmake
new file mode 100644
index 0000000..9e5a245
--- /dev/null
+++ b/cmake-extensions/FindLibGcrypt.cmake
@@ -0,0 +1,52 @@
+# This is from KDE SVN, I just changed LIBGCRYPT_LIBRARIES to LIBGCRYPT_LDFLAGS
+# cause that's what it is at least on my system - Uli
+
+# - Try to find the Gcrypt library
+# Once run this will define
+#
+#  LIBGCRYPT_FOUND - set if the system has the gcrypt library
+#  LIBGCRYPT_CFLAGS - the required gcrypt compilation flags
+#  LIBGCRYPT_LDFLAGS - the linker libraries needed to use the gcrypt library
+#
+# Copyright (c) 2006 Brad Hards <bradh at kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# libgcrypt is moving to pkg-config, but earlier version don't have it
+
+#search in typical paths for libgcrypt-config
+FIND_PROGRAM(LIBGCRYPTCONFIG_EXECUTABLE NAMES libgcrypt-config)
+
+#reset variables
+set(LIBGCRYPT_LDFLAGS)
+set(LIBGCRYPT_CFLAGS)
+
+# if libgcrypt-config has been found
+IF(LIBGCRYPTCONFIG_EXECUTABLE)
+
+  EXEC_PROGRAM(${LIBGCRYPTCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE LIBGCRYPT_LDFLAGS)
+
+  EXEC_PROGRAM(${LIBGCRYPTCONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE LIBGCRYPT_CFLAGS)
+
+  IF(${LIBGCRYPT_CFLAGS} MATCHES "\n")
+    SET(LIBGCRYPT_CFLAGS " ")
+  ENDIF(${LIBGCRYPT_CFLAGS} MATCHES "\n")
+
+  IF(LIBGCRYPT_LDFLAGS AND LIBGCRYPT_CFLAGS)
+    SET(LIBGCRYPT_FOUND TRUE)
+  ENDIF(LIBGCRYPT_LDFLAGS AND LIBGCRYPT_CFLAGS)
+
+ENDIF(LIBGCRYPTCONFIG_EXECUTABLE)
+
+if (LIBGCRYPT_FOUND)
+   if (NOT LibGcrypt_FIND_QUIETLY)
+      message(STATUS "Found libgcrypt: ${LIBGCRYPT_LDFLAGS}")
+   endif (NOT LibGcrypt_FIND_QUIETLY)
+else (LIBGCRYPT_FOUND)
+   if (LibGcrypt_FIND_REQUIRED)
+      message(FATAL_ERROR "Could not find libgcrypt libraries")
+   endif (LibGcrypt_FIND_REQUIRED)
+endif (LIBGCRYPT_FOUND)
+
+MARK_AS_ADVANCED(LIBGCRYPT_CFLAGS LIBGCRYPT_LDFLAGS)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/irssi-plugin-otr.git



More information about the Pkg-privacy-commits mailing list