mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
contrib: fix build for windows
Change-Id: I1a1b3e3c7dc809689d8b534868759590befecfd4
This commit is contained in:
@ -338,7 +338,7 @@ if(MSVC)
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/restinio/dev;"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/fmt/include;"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/http_parser;"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/natpmp/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/natpmp/include;"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/msgpack-c/include;"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/opendht/include;"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/libarchive/libarchive;"
|
||||
@ -353,7 +353,8 @@ if(MSVC)
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/webrtc-audio-processing;"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/portaudio/include;"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjmedia/include;"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/libgit2/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/libgit2/include;"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/dhtnet/include;"
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -467,6 +468,7 @@ if(MSVC)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/webrtc-audio-processing/build/Release/webrtc-audio-processing.lib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/portaudio/build/Release/portaudio_static_x64.lib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/libgit2/build/Release/git2.lib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/dhtnet/build/Release/dhtnet.lib
|
||||
/ignore:4006"
|
||||
)
|
||||
|
||||
|
@ -13,7 +13,8 @@
|
||||
"yaml-cpp",
|
||||
"libarchive",
|
||||
"webrtc-audio-processing",
|
||||
"libgit2"
|
||||
"libgit2",
|
||||
"dhtnet"
|
||||
],
|
||||
"configuration": "ReleaseLib_win32",
|
||||
"use_cmake": true
|
||||
|
@ -377,15 +377,21 @@ def remove_archive_if_needed(pkg_build_path, dirty_path):
|
||||
getSHrunner().exec_batch('rmdir', ['/s', '/q', dirty_path])
|
||||
|
||||
|
||||
def extract_tar(pkg_build_path, name, path):
|
||||
def extract_tar(pkg_build_path, name, path, pkg_name):
|
||||
with tarfile.open(path, 'r', encoding="utf8", errors='ignore') as tarball:
|
||||
tar_common_prefix = os.path.commonprefix(tarball.getnames())
|
||||
dirty_path = contrib_build_dir + '\\' + tar_common_prefix
|
||||
prefix = tar_common_prefix
|
||||
if prefix == "":
|
||||
prefix = pkg_name
|
||||
dirty_path = contrib_build_dir + '\\' + prefix
|
||||
remove_archive_if_needed(pkg_build_path, dirty_path)
|
||||
log.debug('Decompressing ' + name + ' to ' + pkg_build_path)
|
||||
tarball.extractall(contrib_build_dir)
|
||||
os.rename(contrib_build_dir + '\\' + tar_common_prefix,
|
||||
pkg_build_path)
|
||||
if tar_common_prefix == "":
|
||||
tarball.extractall(dirty_path)
|
||||
else:
|
||||
tarball.extractall(contrib_build_dir)
|
||||
os.rename(contrib_build_dir + '\\' + tar_common_prefix,
|
||||
pkg_build_path)
|
||||
return True
|
||||
return False
|
||||
|
||||
@ -406,7 +412,7 @@ def extract_zip(pkg_build_path, name, path):
|
||||
def extract_archive(pkg_name, name, path):
|
||||
pkg_build_path = contrib_build_dir + '\\' + pkg_name
|
||||
if tarfile.is_tarfile(path):
|
||||
return extract_tar(pkg_build_path, name, path)
|
||||
return extract_tar(pkg_build_path, name, path, pkg_name)
|
||||
elif zipfile.is_zipfile(path):
|
||||
return extract_zip(pkg_build_path, name, path)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "asio",
|
||||
"version": "asio-1-12-2",
|
||||
"version": "asio-1-22-2",
|
||||
"url": "https://github.com/chriskohlhoff/asio/archive/__VERSION__.tar.gz",
|
||||
"deps": ["openssl"],
|
||||
"patches": [],
|
||||
|
@ -5,17 +5,16 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index d14bc98..e5ad5c6 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -14,6 +14,13 @@ set (libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
set (includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
|
||||
set (VERSION ${CMAKE_PROJECT_VERSION})
|
||||
|
||||
+OPTION(LIBJAMI_TESTABLE "Enable API for tests" ON)
|
||||
@@ -20,6 +20,12 @@ option(DHTNET_TESTABLE "Enable API for tests" ON)
|
||||
option(BUILD_TOOLS "Build tools" ON)
|
||||
|
||||
if (NOT MSVC)
|
||||
+ OPTION(LIBJAMI_TESTABLE "Enable API for tests" ON)
|
||||
+
|
||||
+IF(LIBJAMI_TESTABLE)
|
||||
+ ADD_DEFINITIONS(-DLIBJAMI_TESTABLE)
|
||||
+ENDIF(LIBJAMI_TESTABLE)
|
||||
+ IF(LIBJAMI_TESTABLE)
|
||||
+ ADD_DEFINITIONS(-DLIBJAMI_TESTABLE)
|
||||
+ ENDIF(LIBJAMI_TESTABLE)
|
||||
+
|
||||
+
|
||||
find_package (PkgConfig REQUIRED)
|
||||
|
||||
find_package(msgpack-cxx CONFIG)
|
||||
find_package (PkgConfig REQUIRED)
|
||||
|
||||
find_package(msgpack-cxx CONFIG)
|
||||
|
@ -1,11 +1,14 @@
|
||||
{
|
||||
"name": "dhtnet",
|
||||
"version": "64bb00fc77f1322c4e0f5c1c7bc54e2fee81f0a6",
|
||||
"version": "24cc01e3deacb1332745929840268af06ebe9068",
|
||||
"url": "https://review.jami.net/plugins/gitiles/dhtnet/+archive/__VERSION__.tar.gz",
|
||||
"deps": [
|
||||
"opendht",
|
||||
"pjproject",
|
||||
"asio"
|
||||
"msgpack",
|
||||
"asio",
|
||||
"upnp",
|
||||
"natpmp"
|
||||
],
|
||||
"use_cmake" : true,
|
||||
"defines": [
|
||||
@ -17,8 +20,13 @@
|
||||
"project_paths": [],
|
||||
"with_env" : "",
|
||||
"custom_scripts": {
|
||||
"pre_build": [],
|
||||
"pre_build": [
|
||||
"rmdir /S /Q \"%DAEMON_DIR%\\contrib\\msvc\\include\\dhtnet\""
|
||||
],
|
||||
"build": [],
|
||||
"post_build": []
|
||||
"post_build": [
|
||||
"mkdir \"%DAEMON_DIR%\\contrib\\msvc\\include\\dhtnet\"",
|
||||
"xcopy /S /Y \"include\" \"%DAEMON_DIR%\\contrib\\msvc\\include\\dhtnet\""
|
||||
]
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
# DHTNET
|
||||
DHTNET_VERSION := 64bb00fc77f1322c4e0f5c1c7bc54e2fee81f0a6
|
||||
DHTNET_VERSION := 24cc01e3deacb1332745929840268af06ebe9068
|
||||
DHTNET_URL := https://review.jami.net/plugins/gitiles/dhtnet/+archive/$(DHTNET_VERSION).tar.gz
|
||||
|
||||
PKGS += dhtnet
|
||||
|
@ -10,6 +10,7 @@
|
||||
"BUILD_SHARED_LIBS=OFF",
|
||||
"USE_SSH=OFF",
|
||||
"WINHTTP=OFF",
|
||||
"USE_WINHTTP=OFF",
|
||||
"BUILD_TESTS=OFF",
|
||||
"BUILD_CLI=OFF",
|
||||
"USE_SSH=OFF"
|
||||
|
@ -66,7 +66,7 @@ ArchiveAccountManager::initAuthentication(const std::string& accountId,
|
||||
return;
|
||||
}
|
||||
|
||||
dht::ThreadPool::computation().run([ctx = std::move(ctx), w = weak_from_this()] mutable {
|
||||
dht::ThreadPool::computation().run([ctx = std::move(ctx), w = weak_from_this()] {
|
||||
auto this_ = std::static_pointer_cast<ArchiveAccountManager>(w.lock());
|
||||
if (not this_) return;
|
||||
try {
|
||||
@ -668,7 +668,7 @@ generatePIN(size_t length = 16, size_t split = 8)
|
||||
void
|
||||
ArchiveAccountManager::addDevice(const std::string& password, AddDeviceCallback cb)
|
||||
{
|
||||
dht::ThreadPool::computation().run([password, cb = std::move(cb), w=weak_from_this()] mutable {
|
||||
dht::ThreadPool::computation().run([password, cb = std::move(cb), w=weak_from_this()] {
|
||||
auto this_ = std::static_pointer_cast<ArchiveAccountManager>(w.lock());
|
||||
if (not this_) return;
|
||||
|
||||
|
Reference in New Issue
Block a user