Skip to content

Commit

Permalink
Fix build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tindy2013 committed Dec 10, 2023
1 parent 49d72f4 commit 104df33
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG SHA=""
WORKDIR /subconverter
COPY . /subconverter/
RUN set -xe && \
apk add --no-cache --virtual .build-tools git g++ build-base linux-headers cmake python3 curl unzip p7zip && \
apk add --no-cache --virtual .build-tools git g++ build-base linux-headers cmake python3 curl unzip p7zip bash && \
apk add --no-cache --virtual .build-deps curl-dev rapidjson-dev pcre2-dev yaml-cpp-dev lua5.4-dev luajit-dev && \
curl -fsSL https://xmake.io/shget.text | bash && \
# git clone https://github.com/ftk/quickjspp --depth=1 && \
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.alpine.release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ set -xe
## shellcheck disable=SC2046
#g++ -o base/subconverter $(find CMakeFiles/subconverter.dir/src/ -name "*.o") -static -lpcre2-8 -lyaml-cpp -L/usr/lib64 -lcurl -lmbedtls -lmbedcrypto -lmbedx509 -lz -l:quickjs/libquickjs.a -llibcron -O3 -s

apk add git g++ build-base linux-headers cmake python3 curl unzip p7zip perl
apk add lua5.4-dev luajit-dev zlib-dev curl-dev curl-static
apk add git g++ build-base linux-headers cmake python3 curl unzip p7zip perl pkgconfig
apk add lua5.4-dev luajit-dev zlib-dev curl-dev curl-static mbedtls-dev mbedtls-static
curl -fsSL https://xmake.io/shget.text | bash
source "$HOME/.xmake/profile"

Expand Down
11 changes: 9 additions & 2 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ option("static")
set_description("Build static binary.")
option_end()

add_requires("libcurl >=8.4.0", "pcre2", "yaml-cpp", "rapidjson", "toml11")
add_requires("pcre2", "yaml-cpp", "rapidjson", "toml11")
add_requires("libcurl >=8.4.0")
add_requires("xmake::libcurl >=8.4.0", {configs = {shared = not has_config("static"), mbedtls = is_plat("linux"), openssl = false}})
includes("xmake/libcron.lua")
includes("xmake/yaml-cpp-static.lua")
includes("xmake/quickjspp.lua")
Expand All @@ -26,7 +28,12 @@ target("subconverter")
add_files("src/**.cpp|lib/wrapper.cpp|server/webserver_libevent.cpp|script/script.cpp|generator/template/template_jinja2.cpp")
add_includedirs("src")
add_includedirs("include")
add_packages("libcurl", "pcre2", "rapidjson", "toml11", "libcron", "quickjspp")
add_packages("pcre2", "rapidjson", "toml11", "libcron", "quickjspp")
if is_plat("macosx") then
add_packages("libcurl")
else
add_packages("xmake::libcurl")
end
if has_config("static") then
add_packages("yaml-cpp-static")
else
Expand Down
1 change: 1 addition & 0 deletions xmake/libcron.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package("libcron")
set_urls("https://github.com/PerMalmberg/libcron.git")
on_install(function (package)
local configs = {}
io.replace("CMakeLists.txt", "add_subdirectory(test)", "", {plain = true})
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
Expand Down

0 comments on commit 104df33

Please sign in to comment.