Add sqlite3 support for depends and dockerfile

This commit is contained in:
Doyle 2020-02-06 16:54:34 +11:00
parent 075c97b27f
commit 6db16af82c
5 changed files with 44 additions and 8 deletions

View File

@ -1023,8 +1023,13 @@ if(NOT SODIUM_LIBRARIES)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SODIUM REQUIRED libsodium)
endif()
include_directories(${ZMQ_INCLUDE_DIRS} ${SODIUM_INCLUDE_DIRS})
link_directories(${ZMQ_LIBRARY_DIRS} ${SODIUM_LIBRARY_DIRS})
if (NOT SQLITE3_LIBRARIES)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SQLITE3 REQUIRED sqlite3)
endif()
include_directories(${ZMQ_INCLUDE_DIRS} ${SODIUM_INCLUDE_DIRS} ${SQLITE3_INCLUDE_DIRS})
link_directories(${ZMQ_LIBRARY_DIRS} ${SODIUM_LIBRARY_DIRS} ${SQLITE3_LIBRARY_DIRS})
add_subdirectory(contrib)
add_subdirectory(src)

View File

@ -165,6 +165,18 @@ RUN set -ex \
&& make install \
&& ldconfig
# Sqlite3
ARG SQLITE_VERSION=3310100
ARG SQLITE_HASH=62284efebc05a76f909c580ffa5c008a7d22a1287285d68b7825a2b6b51949ae
RUN set -ex \
&& curl -s -O https://sqlite.org/2020/sqlite-autoconf-${SQLITE_VERSION}.tar.gz \
&& echo "${SQLITE_HASH} sqlite-autoconf-${SQLITE_VERSION}.tar.gz" | sha256sum -c \
&& tar -xzf sqlite-autoconf-${SQLITE_VERSION}.tar.gz \
&& cd sqlite-autoconf-${SQLITE_VERSION} \
&& ./configure --disable-shared \
&& make \
&& make install
WORKDIR /src
COPY . .

View File

@ -1,4 +1,4 @@
packages:=boost openssl zeromq libiconv
packages:=boost openssl zeromq libiconv sqlite3
native_packages :=

View File

@ -0,0 +1,24 @@
package=sqlite3
$(package)_version=3310100
$(package)_download_path=https://www.sqlite.org/2020/
$(package)_file_name=sqlite-autoconf-$($(package)_version).tar.gz
$(package)_sha256_hash=62284efebc05a76f909c580ffa5c008a7d22a1287285d68b7825a2b6b51949ae
define $(package)_set_vars
$(package)_cflags=-Wformat -Wformat-security -fstack-protector -fstack-protector-strong
$(package)_cxxflags=-std=C++11 -Wformat -Wformat-security -fstack-protector -fstack-protector-strong
$(package)_config_opts=--prefix=$(host_prefix) --disable-shared
$(package)_ldflags=-pie
endef
define $(package)_config_cmds
$($(package)_autoconf) $($(package)_config_opts)
endef
define $(package)_build_cmds
$(MAKE)
endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef

View File

@ -40,7 +40,6 @@ find_package(PkgConfig REQUIRED)
if(NOT STATIC)
pkg_check_modules(MINIUPNPC miniupnpc>=2.1)
pkg_check_modules(UNBOUND libunbound)
pkg_check_modules(SQLITE3 sqlite3)
endif()
if(MINIUPNPC_FOUND)
@ -91,10 +90,6 @@ else()
endif()
endif()
if (NOT SQLITE3_FOUND)
die("Could not find SQLite3 library. Please make sure you have installed libsqlite3-dev or the equivalent")
endif()
add_subdirectory(db_drivers)
add_subdirectory(easylogging++)
add_subdirectory(randomx EXCLUDE_FROM_ALL)