From 41d9de997c4803ff814ce04aa2323b61fbac1528 Mon Sep 17 00:00:00 2001 From: def Date: Thu, 20 Jul 2017 23:07:15 +0200 Subject: [PATCH] ddnet-libs submodule and some fixes --- .gitmodules | 3 +++ CMakeLists.txt | 4 ++-- README.md | 2 +- bam.lua | 7 +++++-- cmake/FindFreetype.cmake | 2 +- scripts/make_release.py | 5 ++++- 6 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..5e1392e40 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "ddnet-libs"] + path = ddnet-libs + url = https://github.com/ddnet/ddnet-libs diff --git a/CMakeLists.txt b/CMakeLists.txt index 42f4ed182..35d6d734a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,9 +35,9 @@ endif() function(set_extra_dirs VARIABLE NAME) if(TARGET_BITS AND TARGET_OS) - set("EXTRA_${VARIABLE}_LIBDIR" "other/${NAME}/${TARGET_OS}/lib${TARGET_BITS}" PARENT_SCOPE) + set("EXTRA_${VARIABLE}_LIBDIR" "ddnet-libs/${NAME}/${TARGET_OS}/lib${TARGET_BITS}" PARENT_SCOPE) endif() - set("EXTRA_${VARIABLE}_INCLUDEDIR" "other/${NAME}/include" PARENT_SCOPE) + set("EXTRA_${VARIABLE}_INCLUDEDIR" "ddnet-libs/${NAME}/include" PARENT_SCOPE) endfunction() # Check for PkgConfig once so all the other `find_package` calls can do it diff --git a/README.md b/README.md index 3b66e72a2..82e4a07df 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Building To compile DDNet yourself, you can follow the [instructions for compiling Teeworlds](https://www.teeworlds.com/?page=docs&wiki=compiling_everything). -DDNet requires additional libraries, that are bundled for the most common platforms (Windows, Mac, Linux, all x86 and x86_64). To get the bundled libraries you have to clone or download https://github.com/ddnet/ddnet-libs into this directory. +DDNet requires additional libraries, that are bundled for the most common platforms (Windows, Mac, Linux, all x86 and x86_64). The bundled libraries are now in the ddnet-libs submodule. Instead you can install these libraries on your system, remove the `config.lua` and `bam` should use the system-wide libraries by default. You can install all required dependencies and bam on Debian and Ubuntu like this: diff --git a/bam.lua b/bam.lua index 2393cefef..4b7636faa 100644 --- a/bam.lua +++ b/bam.lua @@ -142,16 +142,19 @@ server_sql_depends = {} if family == "windows" then if platform == "win32" then - table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/freetype/lib32/freetype-6.dll")) + table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/freetype/lib32/libfreetype-6.dll")) table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/sdl/lib32/SDL2.dll")) table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/curl/windows/lib32/libcurl-4.dll")) + table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/opus/windows/lib32/libwinpthread-1.dll")) + table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/opus/windows/lib32/libgcc_s_sjlj-1.dll")) table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/opus/windows/lib32/libogg-0.dll")) table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/opus/windows/lib32/libopus-0.dll")) table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/opus/windows/lib32/libopusfile-0.dll")) else - table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/freetype/lib64/freetype-6.dll")) + table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/freetype/lib64/libfreetype-6.dll")) table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/sdl/lib64/SDL2.dll")) table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/curl/windows/lib64/libcurl-4.dll")) + table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/opus/windows/lib64/libwinpthread-1.dll")) table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/opus/windows/lib64/libogg-0.dll")) table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/opus/windows/lib64/libopus-0.dll")) table.insert(client_depends, CopyToDirectory(".", "ddnet-libs/opus/windows/lib64/libopusfile-0.dll")) diff --git a/cmake/FindFreetype.cmake b/cmake/FindFreetype.cmake index c62215446..f779f13d4 100644 --- a/cmake/FindFreetype.cmake +++ b/cmake/FindFreetype.cmake @@ -24,7 +24,7 @@ set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDEDIR}) string(FIND "${FREETYPE_LIBRARY}" "${PROJECT_SOURCE_DIR}" LOCAL_PATH_POS) if(LOCAL_PATH_POS EQUAL 0 AND TARGET_OS STREQUAL "windows") - set(FREETYPE_COPY_FILES "${EXTRA_FREETYPE_LIBDIR}/freetype.dll") + set(FREETYPE_COPY_FILES "${EXTRA_FREETYPE_LIBDIR}/libfreetype-6.dll") else() set(FREETYPE_COPY_FILES) endif() diff --git a/scripts/make_release.py b/scripts/make_release.py index eb635dd7a..3ba487ff5 100644 --- a/scripts/make_release.py +++ b/scripts/make_release.py @@ -69,7 +69,10 @@ if include_data and not use_bundle: if platform[:3] == "win": shutil.copy("other/config_directory.bat", package_dir) shutil.copy("SDL2.dll", package_dir) - shutil.copy("freetype-6.dll", package_dir) + shutil.copy("libfreetype-6.dll", package_dir) + if platform == "win32": + shutil.copy("libgcc_s_sjlj-1.dll", package_dir) + shutil.copy("libwinpthread-1.dll", package_dir) shutil.copy("libogg-0.dll", package_dir) shutil.copy("libopus-0.dll", package_dir) shutil.copy("libopusfile-0.dll", package_dir)