summaryrefslogtreecommitdiff
path: root/harmony/libgit2/build-both-static-dynamic.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-27 14:34:02 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-27 14:34:02 -0600
commit7553795ec2d735c01dbdde129a65b7f45d5aa999 (patch)
treeb3970009a8246b0c17a105fe6b10c8077fc2b763 /harmony/libgit2/build-both-static-dynamic.patch
parente2b01859c88d221992403d1293d42da33002be4d (diff)
downloadpackages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.gz
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.bz2
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.xz
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.zip
Add harmony/ repo for packages still being discussed
See https://wiki.adelielinux.org/wiki/Project:Harmony
Diffstat (limited to 'harmony/libgit2/build-both-static-dynamic.patch')
-rw-r--r--harmony/libgit2/build-both-static-dynamic.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/harmony/libgit2/build-both-static-dynamic.patch b/harmony/libgit2/build-both-static-dynamic.patch
new file mode 100644
index 000000000..eeb179a1e
--- /dev/null
+++ b/harmony/libgit2/build-both-static-dynamic.patch
@@ -0,0 +1,53 @@
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Mon, 11 Apr 2017 3:23:00 +0200
+Subject: [PATCH] Build both static and dynamic library
+
+This is very hack-ish, it makes option BUILD_SHARED_LIBS unusable.
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -28,7 +28,6 @@
+ # Build options
+ #
+ OPTION( SONAME "Set the (SO)VERSION of the target" ON )
+-OPTION( BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON )
+ OPTION( THREADSAFE "Build libgit2 as threadsafe" ON )
+ OPTION( BUILD_CLAR "Build Tests using the Clar suite" ON )
+ OPTION( BUILD_EXAMPLES "Build library usage example apps" OFF )
+@@ -44,6 +43,8 @@
+ OPTION( CURL "Use curl for HTTP if available" ON)
+ OPTION( DEBUG_POOL "Enable debug pool allocator" OFF )
+
++SET( BUILD_SHARED_LIBS ON )
++
+ IF(DEBUG_POOL)
+ ADD_DEFINITIONS(-DGIT_DEBUG_POOL)
+ ENDIF()
+@@ -602,7 +603,8 @@
+ ENDIF()
+
+ # Compile and link libgit2
+-ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1} ${WIN_RC})
++ADD_LIBRARY(objlib OBJECT ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1} ${WIN_RC})
++ADD_LIBRARY(git2 SHARED $<TARGET_OBJECTS:objlib>)
+ TARGET_LINK_LIBRARIES(git2 ${SECURITY_DIRS})
+ TARGET_LINK_LIBRARIES(git2 ${COREFOUNDATION_DIRS})
+ TARGET_LINK_LIBRARIES(git2 ${SSL_LIBRARIES})
+@@ -611,6 +613,9 @@
+ TARGET_LINK_LIBRARIES(git2 ${ICONV_LIBRARIES})
+ TARGET_OS_LIBRARIES(git2)
+
++ADD_LIBRARY(git2_static STATIC $<TARGET_OBJECTS:objlib>)
++SET_TARGET_PROPERTIES(git2_static PROPERTIES OUTPUT_NAME git2 CLEAN_DIRECT_OUTPUT 1)
++
+ # Workaround for Cmake bug #0011240 (see http://public.kitware.com/Bug/view.php?id=11240)
+ # Win64+MSVC+static libs = linker error
+ IF(MSVC AND GIT_ARCH_64 AND NOT BUILD_SHARED_LIBS)
+@@ -639,7 +644,7 @@
+ ENDIF ()
+
+ # Install
+-INSTALL(TARGETS git2
++INSTALL(TARGETS git2 git2_static
+ RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}