diff --git a/docker/DockerfileDeps b/docker/DockerfileDeps index f6724bba226f23d102d6cdd6a9007a1194dd1643..3b80f417bf7a95f3cd2b04a228cb9b6ac0465a04 100644 --- a/docker/DockerfileDeps +++ b/docker/DockerfileDeps @@ -3,38 +3,35 @@ MAINTAINER Adrien Béraud <adrien.beraud@savoirfairelinux.com> RUN apt-get update && apt-get install -y \ build-essential cmake git wget libncurses5-dev libreadline-dev nettle-dev \ libgnutls28-dev libuv1-dev cython3 python3-dev libcppunit-dev libjsoncpp-dev \ - libasio-dev libssl-dev python3-setuptools \ && apt-get clean +RUN echo "*** Installing libssl, libasio & libhttp-parser ***" \ + && apt-get update && apt-get install -y libasio-dev libssl-dev libhttp-parser-dev \ + && apt-get clean + +RUN echo "*** Installing libfmt ***" \ + && wget https://github.com/fmtlib/fmt/archive/5.3.0.tar.gz \ + && tar -xzf 5.3.0.tar.gz && cd fmt-5.3.0/ && ls -l \ + && cmake -j8 -DCMAKE_INSTALL_PREFIX=/usr . \ + && make install + #patch for https://github.com/Stiffstream/restinio-conan-example/issues/2 -RUN apt-get update && apt-get install -y \ - python3-pip libasio-dev -RUN pip3 install --upgrade cmake -#install conan & add restinio remotes -RUN pip3 install conan && \ - conan remote add stiffstream https://api.bintray.com/conan/stiffstream/public && \ - conan remote add public-conan https://api.bintray.com/conan/bincrafters/public-conan -#setup restinio docker project -RUN mkdir restinio-conan -COPY conan/restinio/conanfile.txt restinio-conan/conanfile.txt -COPY conan/restinio/conanfile.py restinio-conan/conanfile.py -#build restinio from source -RUN echo "*** Installing RESTinio & dependencies ***" \ - && cd restinio-conan \ - && conan source . \ - && conan install -o restinio:boost_libs=none --build=missing . \ - && conan package . -pf /usr/local \ - && cd ../ && rm -rf restinio* -#installing dependencies -RUN echo "*** Installing asio & fmt dependencies ***" \ - && cp -r ~/.conan/data/asio/*/bincrafters/stable/package/*/include/* /usr/local/include/ \ - && cp -r ~/.conan/data/fmt/*/bincrafters/stable/package/*/lib/* /usr/local/lib/ \ - && cp -r ~/.conan/data/fmt/*/bincrafters/stable/package/*/include/* /usr/local/include/ -#build http_parser fork -RUN echo "*** Building http_parser dependency for custom HTTP methods ***" \ - && git clone https://github.com/eao197/http-parser.git \ - && cd http-parser && make -j8 && make install PREFIX=/usr \ - && cd ../ && rm -rf restinio-conan/ +RUN apt-get update && apt-get install -y python3-pip \ + && pip3 install --upgrade cmake + +RUN echo "*** Downloading RESTinio ***" \ + && mkdir restinio && cd restinio \ + && wget https://github.com/Stiffstream/restinio/archive/v.0.5.1.tar.gz \ + && ls -l && tar -xzf v.0.5.1.tar.gz \ + && cd restinio-v.0.5.1/dev \ + && sed -i.bak '/find_package(Boost*/d' CMakeLists.txt \ + && sed -i.bak '/find_package(PCRE)/d' CMakeLists.txt \ + && sed -i.bak '/find_package(PCRE2)/d' CMakeLists.txt \ + && sed -i.bak '/add_subdirectory(so_5)/d' CMakeLists.txt \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr -DRESTINIO_TEST=OFF -DRESTINIO_SAMPLE=OFF \ + -DRESTINIO_INSTALL_SAMPLES=OFF -DRESTINIO_BENCH=OFF -DRESTINIO_INSTALL_BENCHES=OFF \ + -DRESTINIO_FIND_DEPS=ON -DRESTINIO_USE_BOOST_ASIO=none . \ + && cd ../../ && rm -rf restinio* #build msgpack from source RUN wget https://github.com/msgpack/msgpack-c/releases/download/cpp-2.1.5/msgpack-2.1.5.tar.gz \ diff --git a/docker/DockerfileDepsLlvm b/docker/DockerfileDepsLlvm index 0064b774f22d7a8e0796f35e11edf3d34c3f20cc..3a43ea8b7936c6914b1acb4ca4ca6768e97edaeb 100644 --- a/docker/DockerfileDepsLlvm +++ b/docker/DockerfileDepsLlvm @@ -7,35 +7,33 @@ RUN apt-get update \ ENV CC cc ENV CXX c++ +RUN echo "*** Installing libssl, libasio & libhttp-parser ***" \ + && apt-get update && apt-get install -y libasio-dev libssl-dev libhttp-parser-dev \ + && apt-get clean + +RUN echo "*** Installing libfmt ***" \ + && wget https://github.com/fmtlib/fmt/archive/5.3.0.tar.gz \ + && tar -xzf 5.3.0.tar.gz && cd fmt-5.3.0/ && ls -l \ + && cmake -j8 -DCMAKE_INSTALL_PREFIX=/usr . \ + && make install + #patch for https://github.com/Stiffstream/restinio-conan-example/issues/2 -RUN apt-get update && apt-get install -y \ - python3-pip libasio-dev -RUN pip3 install --upgrade cmake -#install conan & add restinio remotes -RUN pip3 install conan && \ - conan remote add stiffstream https://api.bintray.com/conan/stiffstream/public && \ - conan remote add public-conan https://api.bintray.com/conan/bincrafters/public-conan -#setup restinio docker project -RUN mkdir restinio-conan -COPY conan/restinio/conanfile.txt restinio-conan/conanfile.txt -COPY conan/restinio/conanfile.py restinio-conan/conanfile.py -#build restinio from source -RUN echo "*** Installing RESTinio & dependencies ***" \ - && cd restinio-conan \ - && conan source . \ - && conan install -o restinio:boost_libs=none --build=missing . \ - && conan package . -pf /usr/local \ - && cd ../ && rm -rf restinio* -#installing dependencies -RUN echo "*** Installing asio & fmt dependencies ***" \ - && cp -r ~/.conan/data/asio/*/bincrafters/stable/package/*/include/* /usr/local/include/ \ - && cp -r ~/.conan/data/fmt/*/bincrafters/stable/package/*/lib/* /usr/local/lib/ \ - && cp -r ~/.conan/data/fmt/*/bincrafters/stable/package/*/include/* /usr/local/include/ -#build http_parser fork -RUN echo "*** Building http_parser dependency for custom HTTP methods ***" \ - && git clone https://github.com/eao197/http-parser.git \ - && cd http-parser && make -j8 && make install PREFIX=/usr \ - && cd ../ && rm -rf restinio-conan/ +RUN apt-get update && apt-get install -y python3-pip \ + && pip3 install --upgrade cmake + +RUN echo "*** Downloading RESTinio ***" \ + && mkdir restinio && cd restinio \ + && wget https://github.com/Stiffstream/restinio/archive/v.0.5.1.tar.gz \ + && ls -l && tar -xzf v.0.5.1.tar.gz \ + && cd restinio-v.0.5.1/dev \ + && sed -i.bak '/find_package(Boost*/d' CMakeLists.txt \ + && sed -i.bak '/find_package(PCRE)/d' CMakeLists.txt \ + && sed -i.bak '/find_package(PCRE2)/d' CMakeLists.txt \ + && sed -i.bak '/add_subdirectory(so_5)/d' CMakeLists.txt \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr -DRESTINIO_TEST=OFF -DRESTINIO_SAMPLE=OFF \ + -DRESTINIO_INSTALL_SAMPLES=OFF -DRESTINIO_BENCH=OFF -DRESTINIO_INSTALL_BENCHES=OFF \ + -DRESTINIO_FIND_DEPS=ON -DRESTINIO_USE_BOOST_ASIO=none . \ + && cd ../../ && rm -rf restinio* #build msgpack from source RUN wget https://github.com/msgpack/msgpack-c/releases/download/cpp-2.1.5/msgpack-2.1.5.tar.gz \ diff --git a/docker/conan/restinio/conanfile.py b/docker/conan/restinio/conanfile.py deleted file mode 100644 index a434c5ac7d265bf24f9df2c8ded33358924427aa..0000000000000000000000000000000000000000 --- a/docker/conan/restinio/conanfile.py +++ /dev/null @@ -1,59 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class SobjectizerConan(ConanFile): - name = "restinio" - version = "0.5.1" - - license = "BSD-3-Clause" - url = "https://github.com/Stiffstream/restinio-conan" - - description = ( - "RESTinio is a header-only C++14 library that gives you " - "an embedded HTTP/Websocket server." - ) - - settings = "os", "compiler", "build_type", "arch" - options = {'boost_libs': ['none', 'static', 'shared']} - default_options = {'boost_libs': 'none'} - generators = "cmake" - source_subfolder = "restinio" - build_policy = "missing" - - def requirements(self): - self.requires.add("http-parser/2.8.1@bincrafters/stable") - self.requires.add("fmt/5.3.0@bincrafters/stable") - - if self.options.boost_libs == "none": - self.requires.add("asio/1.12.2@bincrafters/stable") - else: - self.requires.add("boost/1.69.0@conan/stable") - if self.options.boost_libs == "shared": - self.options["boost"].shared = True - else: - self.options["boost"].shared = False - - def source(self): - source_url = "https://bitbucket.org/sobjectizerteam/restinio/downloads" - tools.get("{0}/restinio-{1}.zip".format(source_url, self.version)) - extracted_dir = "restinio-" + self.version - os.rename(extracted_dir, self.source_subfolder) - - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions['RESTINIO_INSTALL'] = True - cmake.definitions['RESTINIO_FIND_DEPS'] = False - cmake.definitions['RESTINIO_USE_BOOST_ASIO'] = self.options.boost_libs - cmake.configure(source_folder = self.source_subfolder + "/dev/restinio") - return cmake - - def package(self): - cmake = self._configure_cmake() - self.output.info(cmake.definitions) - cmake.install() - - def package_info(self): - self.info.header_only() - if self.options.boost_libs != "none": - self.cpp_info.defines.append("RESTINIO_USE_BOOST_ASIO") diff --git a/docker/conan/restinio/conanfile.txt b/docker/conan/restinio/conanfile.txt deleted file mode 100644 index 472fd614635649ab6541e2c9aa28ba1474921424..0000000000000000000000000000000000000000 --- a/docker/conan/restinio/conanfile.txt +++ /dev/null @@ -1,11 +0,0 @@ -[requires] -restinio/0.5.1@stiffstream/stable - -[generators] -cmake - -[options] - -[imports] -bin, *.dll -> ./bin # Copies all dll files from packages bin folder to my "bin" folder -lib, *.dylib* -> ./bin # Copies all dylib files from packages lib folder to my "bin" folder