Fix location of libraries
Some checks failed
dropshell-build / build (push) Failing after 5s

This commit is contained in:
j842 2025-06-10 11:25:11 +12:00
parent 222ed229ef
commit f9b8fb88f2
2 changed files with 31 additions and 25 deletions

View File

@ -56,7 +56,7 @@ WORKDIR /tmp
RUN curl -LO https://github.com/c-ares/c-ares/releases/download/v${CARES_VERSION}/c-ares-${CARES_VERSION}.tar.gz && \
tar zxvf c-ares-${CARES_VERSION}.tar.gz && \
cd c-ares-${CARES_VERSION} && \
./configure --enable-static --disable-shared --prefix=/usr/local/cares && \
./configure --enable-static --disable-shared --prefix=/usr/local && \
make -j$(nproc) && \
make install && \
cd / && rm -rf /tmp/c-ares-${CARES_VERSION} /tmp/c-ares-${CARES_VERSION}.tar.gz
@ -68,7 +68,7 @@ RUN curl -LO https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz &&
tar xzf openssl-${OPENSSL_VERSION}.tar.gz && \
cd openssl-${OPENSSL_VERSION} && \
./Configure no-shared no-dso no-tests no-async linux-x86_64 \
--prefix=/usr/local/openssl-musl \
--prefix=/usr/local \
-static -fPIC && \
make -j$(nproc) && \
make install_sw && \
@ -81,12 +81,12 @@ RUN curl -LO https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/${
tar xzf ${JSONCPP_VERSION}.tar.gz && \
cd jsoncpp-${JSONCPP_VERSION} && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/usr/local/jsoncpp && \
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/usr/local && \
make -j$(nproc) && \
make install && \
cd / && rm -rf /tmp/jsoncpp-${JSONCPP_VERSION} /tmp/${JSONCPP_VERSION}.tar.gz
RUN ls /usr/local/jsoncpp/include/json/version.h
RUN ls /usr/local/include/json/version.h
# Build libpq statically
ARG POSTGRES_VERSION=16.2
@ -94,7 +94,7 @@ WORKDIR /tmp
RUN curl -LO https://ftp.postgresql.org/pub/source/v${POSTGRES_VERSION}/postgresql-${POSTGRES_VERSION}.tar.gz && \
tar xzf postgresql-${POSTGRES_VERSION}.tar.gz && \
cd postgresql-${POSTGRES_VERSION} && \
./configure --prefix=/usr/local/pgsql --without-readline --without-zlib --without-icu --enable-static --disable-shared && \
./configure --prefix=/usr/local --without-readline --without-zlib --without-icu --enable-static --disable-shared && \
make -j$(nproc) -C src/port && \
make -j$(nproc) -C src/common && \
make -j$(nproc) -C src/interfaces/libpq && \
@ -104,14 +104,14 @@ RUN curl -LO https://ftp.postgresql.org/pub/source/v${POSTGRES_VERSION}/postgres
make -C src/include install && \
cd / && rm -rf /tmp/postgresql-${POSTGRES_VERSION} /tmp/postgresql-${POSTGRES_VERSION}.tar.gz
RUN ls /usr/local/pgsql/include/pg_config.h
RUN ls /usr/local/include/pg_config.h
ARG CURL_VERSION=8.7.1
WORKDIR /tmp
RUN curl -LO https://curl.se/download/curl-${CURL_VERSION}.tar.gz && \
tar xzf curl-${CURL_VERSION}.tar.gz && \
cd curl-${CURL_VERSION} && \
./configure --disable-shared --enable-static --with-ssl=/usr/local/openssl-musl --prefix=/usr/local/curl && \
./configure --disable-shared --enable-static --with-ssl=/usr/local --prefix=/usr/local && \
make -j$(nproc) && \
make install && \
cd / && rm -rf /tmp/curl-${CURL_VERSION} /tmp/curl-${CURL_VERSION}.tar.gz
@ -124,13 +124,13 @@ RUN curl -LO https://downloads.mariadb.com/Connectors/c/connector-c-${MARIADB_CO
cd mariadb-connector-c-${MARIADB_CONNECTOR_VERSION}-src && \
cmake . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local/mariadb-connector-c \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DWITH_SSL=OPENSSL \
-DWITH_STATIC=ON \
-DOPENSSL_ROOT_DIR=/usr/local/openssl-musl \
-DOPENSSL_ROOT_DIR=/usr/local \
-DOPENSSL_USE_STATIC_LIBS=TRUE \
-DCURL_INCLUDE_DIR=/usr/local/curl/include \
-DCURL_LIBRARY=/usr/local/curl/lib/libcurl.a \
-DCURL_INCLUDE_DIR=/usr/local/include \
-DCURL_LIBRARY=/usr/local/lib/libcurl.a \
-DWITH_SHARED=OFF \
-DWITH_MYSQL=ON && \
make -j$(nproc) && \
@ -143,7 +143,7 @@ WORKDIR /tmp
RUN wget https://www.sqlite.org/2024/sqlite-autoconf-3450000.tar.gz && \
tar xzf sqlite-autoconf-3450000.tar.gz && \
cd sqlite-autoconf-3450000 && \
./configure --enable-static --disable-shared --prefix=/usr/local/sqlite3 && \
./configure --enable-static --disable-shared --prefix=/usr/local && \
make && \
make install && \
cd .. && rm -rf sqlite-autoconf-3450000* && \
@ -199,19 +199,19 @@ RUN git clone --recurse-submodules https://github.com/drogonframework/drogon.git
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DUUID_LIBRARY=/usr/lib/libuuid.a \
-DOPENSSL_ROOT_DIR=/usr/local/openssl-musl \
-DOPENSSL_ROOT_DIR=/usr/local \
-DOPENSSL_USE_STATIC_LIBS=TRUE \
-DCARES_INCLUDE_DIR=/usr/local/cares/include \
-DCARES_LIBRARY=/usr/local/cares/lib/libcares.a \
-DJSONCPP_INCLUDE_DIRS=/usr/local/jsoncpp/include \
-DJSONCPP_LIBRARIES=/usr/local/jsoncpp/lib/libjsoncpp.a \
-DPostgreSQL_INCLUDE_DIR=/usr/local/pgsql/include \
-DPostgreSQL_LIBRARY="/usr/local/pgsql/lib/libpq.a;/usr/local/pgsql/lib/libpgcommon.a;/usr/local/pgsql/lib/libpgport.a" \
-DSQLite3_LIBRARY=/usr/local/sqlite3/lib/libsqlite3.a \
-DSQLite3_INCLUDE_DIR=/usr/local/sqlite3/include \
-DCARES_INCLUDE_DIR=/usr/local/include \
-DCARES_LIBRARY=/usr/local/lib/libcares.a \
-DJSONCPP_INCLUDE_DIRS=/usr/local/include \
-DJSONCPP_LIBRARIES=/usr/local/lib/libjsoncpp.a \
-DPostgreSQL_INCLUDE_DIR=/usr/local/include \
-DPostgreSQL_LIBRARY="/usr/local/lib/libpq.a;/usr/local/lib/libpgcommon.a;/usr/local/lib/libpgport.a" \
-DSQLite3_LIBRARY=/usr/local/lib/libsqlite3.a \
-DSQLite3_INCLUDE_DIR=/usr/local/include \
-DZLIB_LIBRARY=/usr/lib/libz.a \
-DZLIB_INCLUDE_DIR=/usr/include \
-DCMAKE_PREFIX_PATH="/usr/local/sqlite3;/usr/local/pgsql;/usr/local/jsoncpp;/usr/local/cares;/usr/local/openssl-musl" \
-DCMAKE_PREFIX_PATH="/usr/local" \
&&\
make -j$(nproc) && \
make install && \

View File

@ -9,17 +9,23 @@ set(CMAKE_EXE_LINKER_FLAGS "-static -static-libgcc -static-libstdc++")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
# Find packages
find_package(PkgConfig REQUIRED)
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)
find_package(SQLite3 REQUIRED)
find_package(Threads REQUIRED)
# Find SQLite3 using pkg-config as fallback
pkg_check_modules(SQLite3 REQUIRED sqlite3)
add_executable(test_libs test_libs.cpp)
target_link_libraries(test_libs
fmt::fmt
spdlog::spdlog
SQLite3::SQLite3
${SQLite3_STATIC_LIBRARIES}
Threads::Threads
rt
)
)
target_include_directories(test_libs PRIVATE ${SQLite3_INCLUDE_DIRS})
target_compile_options(test_libs PRIVATE ${SQLite3_CFLAGS_OTHER})