bdkoepke / libpurple-snapchat

SnapChat libpurple plugin.
GNU General Public License v3.0
6 stars 0 forks source link

Pidgin use? #1

Open HaoZeke opened 9 years ago

HaoZeke commented 9 years ago

Is there any implementation of this to be used with pidgin? cmake . make produces a snapchat file. make install has no target...

bdkoepke commented 9 years ago

Unfortunately not yet. The libpurple API ended up being much more obtuse than I expected.

rodneyrod commented 9 years ago

I can't get this to compile at all actually.

bdkoepke commented 9 years ago

KELBDKOEPB002:libpurple-snapchat bkoepke$ cmake CMakeLists.txt && make -- Configuring done -- Generating done -- Build files have been written to: /Users/bkoepke/src/libpurple-snapchat [100%] Built target snapchat KELBDKOEPB002:libpurple-snapchat bkoepke$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.4.0 Thread model: posix KELBDKOEPB002:libpurple-snapchat bkoepke$

Works for me on FreeBSD/Linux as well. Not sure about windows.

rodneyrod commented 9 years ago

I keep getting the following, trying to compile on Ubuntu 15.04

Linking C executable snapchat CMakeFiles/snapchat.dir/snapchat_sha256.c.o: In function snapchat_sha256': snapchat_sha256.c:(.text+0x22): undefined reference toSHA256_Init' snapchat_sha256.c:(.text+0x44): undefined reference to SHA256_Update' snapchat_sha256.c:(.text+0x65): undefined reference toSHA256_Final' CMakeFiles/snapchat.dir/snapchat_util.c.o: In function int_to_str': snapchat_util.c:(.text+0xa3): undefined reference toceil' collect2: error: ld returned 1 exit status

NeoBelerophon commented 9 years ago

Following patch should fix the build issue:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7a2242..239f037 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,17 +1,17 @@
 cmake_minimum_required(VERSION 2.8)

-set(MATH_LINK_FLAGS
-    "-lm")
-set(SSL_LINK_FLAGS
-    "-lssl -lcrypto")
-set(CMAKE_EXE_LINKER_FLAGS
-    "${CMAKE_EXE_LINKER_FLAGS} ${SSL_LINK_FLAGS} ${MATH_LINK_FLAGS}")
+FIND_PACKAGE(OpenSSL REQUIRED)
+
+include_directories(OPENSSL_INCLUDE_DIR)
+link_directories( ${OPENSSL_LIBRARIES})
+
+add_definitions()

 set(snapchat_SRCS
     snapchat.c
     snapchat_sha256.c
     snapchat_util.c)

-add_executable(snapchat ${snapchat_SRCS})
+add_executable(snapchat ${snapchat_SRCS}) 

-target_link_libraries(snapchat)
+target_link_libraries(snapchat m crypto)
bdkoepke commented 9 years ago

Added your cmake patch.