Package: ddnet / 11.8-1

use-system-libmd.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b92102d33..0f17a4a45 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -300,6 +300,8 @@ else()
   set(WEBSOCKETS_INCLUDE_DIRS)
 endif()
 
+pkg_check_modules(MD libmd)
+
 
 if(TARGET_OS AND TARGET_OS STREQUAL "mac")
   find_program(DMG dmg)
@@ -491,12 +493,8 @@ endif()
 set_glob(DEP_JSON_SRC GLOB src/engine/external/json-parser json.c json.h)
 add_library(json EXCLUDE_FROM_ALL OBJECT ${DEP_JSON_SRC})
 
-set_glob(DEP_MD5_SRC GLOB src/engine/external/md5 md5.c md5.h)
-add_library(md5 EXCLUDE_FROM_ALL OBJECT ${DEP_MD5_SRC})
-
-list(APPEND TARGETS_DEP json md5)
+list(APPEND TARGETS_DEP json)
 set(DEP_JSON $<TARGET_OBJECTS:json>)
-set(DEP_MD5 $<TARGET_OBJECTS:md5>)
 
 ########################################################################
 # COPY DATA AND DLLS
@@ -724,7 +722,7 @@ set(GAME_GENERATED_SHARED
   src/game/generated/protocol.h
 )
 
-set(DEPS ${DEP_JSON} ${DEP_MD5} ${ZLIB_DEP})
+set(DEPS ${DEP_JSON} ${ZLIB_DEP})
 
 # Libraries
 set(LIBS
@@ -732,6 +730,7 @@ set(LIBS
   ${WEBSOCKETS_LIBRARIES}
   ${ZLIB_LIBRARIES}
   ${PLATFORM_LIBS}
+  ${MD_LIBRARIES}
   # Add pthreads (on non-Windows) at the end, so that other libraries can depend
   # on it.
   ${CMAKE_THREAD_LIBS_INIT}
diff --git a/src/engine/external/md5/md5.h b/src/engine/external/md5/md5.h
index 698c995d8..f59351975 100644
--- a/src/engine/external/md5/md5.h
+++ b/src/engine/external/md5/md5.h
@@ -47,7 +47,10 @@
   1999-05-03 lpd Original version.
  */
 
-#ifndef md5_INCLUDED
+#define LIBMD_MD5_ALADDIN
+#include <md5.h>
+
+#ifdef md5_INCLUDED
 #  define md5_INCLUDED
 
 /*