git rid of the self-made seasocks package, because meanwhile, an official package is available
This commit is contained in:
parent
25b1a9f7ad
commit
0943d357cb
|
@ -1,10 +0,0 @@
|
||||||
from conan.packager import ConanMultiPackager
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
builder = ConanMultiPackager()
|
|
||||||
libstd = ['libstdc++11', 'libstdc++']
|
|
||||||
types = ['Debug','Release']
|
|
||||||
configs = [[i,k] for i in libstd for k in types]
|
|
||||||
for triple in configs:
|
|
||||||
builder.add(settings={"build_type":triple[1], "compiler.libcxx":triple[0]}, options={}, env_vars={}, build_requires={})
|
|
||||||
builder.run()
|
|
|
@ -1,77 +0,0 @@
|
||||||
from conans import CMake, ConanFile, tools
|
|
||||||
from conans.errors import ConanException, ConanInvalidConfiguration
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import shutil
|
|
||||||
import textwrap
|
|
||||||
|
|
||||||
|
|
||||||
class SeasocksConan(ConanFile):
|
|
||||||
name = "Seasocks"
|
|
||||||
version = "1.4.4"
|
|
||||||
topics = ("seasocks", "embeddable", "webserver", "websockets")
|
|
||||||
homepage = "https://github.com/mattgodbolt/seasocks"
|
|
||||||
url = "https://github.com/mattgodbolt/seasocks"
|
|
||||||
description = "Simple, small, C++ embeddable webserver with WebSockets support"
|
|
||||||
license = "BSD-2-Clause"
|
|
||||||
settings = "os", "arch", "compiler", "build_type"
|
|
||||||
options = {
|
|
||||||
"shared": [True, False],
|
|
||||||
"fPIC": [True, False],
|
|
||||||
"with_zlib": [True, False],
|
|
||||||
}
|
|
||||||
default_options = {
|
|
||||||
"shared": True,
|
|
||||||
"fPIC": True,
|
|
||||||
"with_zlib": True,
|
|
||||||
}
|
|
||||||
no_copy_source = True
|
|
||||||
generators = "cmake", "cmake_find_package"
|
|
||||||
|
|
||||||
exports_sources = "src/main/c/*"
|
|
||||||
|
|
||||||
def configure(self):
|
|
||||||
if self.options.shared:
|
|
||||||
del self.options.fPIC
|
|
||||||
|
|
||||||
def requirements(self):
|
|
||||||
if self.options.with_zlib:
|
|
||||||
self.requires("zlib/1.2.11")
|
|
||||||
|
|
||||||
def source(self):
|
|
||||||
self.run("git clone https://github.com/mattgodbolt/seasocks.git .")
|
|
||||||
self.run("git checkout tags/v1.4.4")
|
|
||||||
|
|
||||||
def build(self):
|
|
||||||
if self.source_folder == self.build_folder:
|
|
||||||
raise ConanException("Cannot build in same folder as sources")
|
|
||||||
tools.save(os.path.join(self.build_folder, "CMakeLists.txt"), textwrap.dedent("""\
|
|
||||||
cmake_minimum_required(VERSION 3.0)
|
|
||||||
project(cmake_wrapper)
|
|
||||||
|
|
||||||
include("{install_folder}/conanbuildinfo.cmake")
|
|
||||||
conan_basic_setup(TARGETS)
|
|
||||||
|
|
||||||
add_subdirectory("{source_folder}" seasocks)
|
|
||||||
""").format(
|
|
||||||
source_folder=self.source_folder.replace("\\", "/"),
|
|
||||||
install_folder=self.install_folder.replace("\\", "/")))
|
|
||||||
cmake = CMake(self)
|
|
||||||
cmake.definitions["DEFLATE_SUPPORT"] = self.options.with_zlib
|
|
||||||
cmake.configure(source_folder=self.build_folder)
|
|
||||||
cmake.build()
|
|
||||||
|
|
||||||
def package(self):
|
|
||||||
cmake = CMake(self)
|
|
||||||
cmake.install()
|
|
||||||
|
|
||||||
def package_info(self):
|
|
||||||
# Set the name of the generated `FindSeasocks.cmake` and `SeasocksConfig.cmake` cmake scripts
|
|
||||||
self.cpp_info.names["cmake_find_package"] = "Seasocks"
|
|
||||||
self.cpp_info.names["cmake_find_package_multi"] = "Seasocks"
|
|
||||||
self.cpp_info.components["libseasocks"].libs = ["seasocks"]
|
|
||||||
# Set the name of the generated seasocks target: `Seasocks::seasocks`
|
|
||||||
self.cpp_info.components["libseasocks"].names["cmake_find_package"] = "seasocks"
|
|
||||||
self.cpp_info.components["libseasocks"].names["cmake_find_package_multi"] = "seasocks"
|
|
||||||
if self.options.with_zlib:
|
|
||||||
self.cpp_info.components["libseasocks"].requires = ["zlib::zlib"]
|
|
|
@ -1,10 +0,0 @@
|
||||||
cmake_minimum_required(VERSION 3.3)
|
|
||||||
project(PackageTest CXX)
|
|
||||||
|
|
||||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
|
||||||
conan_basic_setup()
|
|
||||||
|
|
||||||
find_package(Threads)
|
|
||||||
|
|
||||||
add_executable(seasocks_test seasocks_test.cpp)
|
|
||||||
target_link_libraries(seasocks_test ${CONAN_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
|
|
@ -1,3 +0,0 @@
|
||||||
This directory contains a conan test package to ensure the packaging works.
|
|
||||||
|
|
||||||
It's not meant as an example of how best to use Seasocks.
|
|
|
@ -1,17 +0,0 @@
|
||||||
from conans import ConanFile, CMake, tools
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
class TestPackageConan(ConanFile):
|
|
||||||
settings = "os", "compiler", "build_type", "arch"
|
|
||||||
generators = "cmake"
|
|
||||||
|
|
||||||
def build(self):
|
|
||||||
cmake = CMake(self)
|
|
||||||
cmake.configure()
|
|
||||||
cmake.build()
|
|
||||||
|
|
||||||
def test(self):
|
|
||||||
if not tools.cross_building(self.settings):
|
|
||||||
bin_path = os.path.join("bin", "seasocks_test")
|
|
||||||
self.run(bin_path, run_environment=True)
|
|
|
@ -1,24 +0,0 @@
|
||||||
#include "seasocks/Server.h"
|
|
||||||
#include "seasocks/Connection.h"
|
|
||||||
#include "seasocks/PrintfLogger.h"
|
|
||||||
|
|
||||||
#include <thread>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
using namespace seasocks;
|
|
||||||
|
|
||||||
// This is a conan test program to ensure the packaging works.
|
|
||||||
// It's not meant as an example of how best to use Seasocks.
|
|
||||||
int main(int argc, const char* argv[]) {
|
|
||||||
auto logger = std::make_shared<PrintfLogger>();
|
|
||||||
Server server(logger);
|
|
||||||
server.startListening(0);
|
|
||||||
std::thread seasocksThread([&] {
|
|
||||||
server.loop();
|
|
||||||
});
|
|
||||||
|
|
||||||
sleep(1);
|
|
||||||
|
|
||||||
server.terminate();
|
|
||||||
seasocksThread.join();
|
|
||||||
}
|
|
Loading…
Reference in New Issue