mirror of
https://github.com/MetaCubeX/subconverter.git
synced 2025-11-04 18:19:42 +08:00
Update build scripts
This commit is contained in:
parent
f9eba5b179
commit
6f721aec6d
@ -64,9 +64,10 @@ LINK_DIRECTORIES(${LIBEVENT_LIBRARY_DIRS})
|
|||||||
INCLUDE_DIRECTORIES(${LIBEVENT_INCLUDE_DIR})
|
INCLUDE_DIRECTORIES(${LIBEVENT_INCLUDE_DIR})
|
||||||
TARGET_LINK_LIBRARIES(subconverter ${LIBEVENT_LIBRARIES})
|
TARGET_LINK_LIBRARIES(subconverter ${LIBEVENT_LIBRARIES})
|
||||||
|
|
||||||
PKG_CHECK_MODULES(CURL libcurl>=7.54.0 REQUIRED)
|
FIND_PACKAGE(CURL 7.54.0 REQUIRED IMPORTED_TARGET)
|
||||||
|
LINK_DIRECTORIES(${CURL_LIBRARY_DIRS})
|
||||||
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
|
||||||
TARGET_LINK_LIBRARIES(subconverter ${CURL_LIBRARIES})
|
TARGET_LINK_LIBRARIES(subconverter CURL::libcurl)
|
||||||
ADD_DEFINITIONS(-DCURL_STATICLIB)
|
ADD_DEFINITIONS(-DCURL_STATICLIB)
|
||||||
|
|
||||||
FIND_PACKAGE(Rapidjson REQUIRED)
|
FIND_PACKAGE(Rapidjson REQUIRED)
|
||||||
@ -75,7 +76,7 @@ INCLUDE_DIRECTORIES(${RAPIDJSON_INCLUDE_DIRS})
|
|||||||
PKG_CHECK_MODULES(YAML_CPP yaml-cpp>=0.6.3 REQUIRED)
|
PKG_CHECK_MODULES(YAML_CPP yaml-cpp>=0.6.3 REQUIRED)
|
||||||
LINK_DIRECTORIES(${YAML_CPP_LIBRARY_DIRS})
|
LINK_DIRECTORIES(${YAML_CPP_LIBRARY_DIRS})
|
||||||
INCLUDE_DIRECTORIES(${YAML_CPP_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${YAML_CPP_INCLUDE_DIRS})
|
||||||
TARGET_LINK_LIBRARIES(subconverter ${YAML_CPP_LIBRARY})
|
TARGET_LINK_LIBRARIES(subconverter ${YAML_CPP_LIBRARIES})
|
||||||
|
|
||||||
#IF(USING_STD_REGEX STREQUAL "ON")
|
#IF(USING_STD_REGEX STREQUAL "ON")
|
||||||
# ADD_DEFINITIONS(-DUSE_STD_REGEX)
|
# ADD_DEFINITIONS(-DUSE_STD_REGEX)
|
||||||
|
|||||||
@ -3,13 +3,14 @@ MAINTAINER Tindy X <tindy.it@gmail.com>
|
|||||||
|
|
||||||
# build minimized
|
# build minimized
|
||||||
RUN apk add git g++ build-base linux-headers cmake && \
|
RUN apk add git g++ build-base linux-headers cmake && \
|
||||||
apk add libressl-dev curl-dev rapidjson-dev libevent-dev pcre2-dev yaml-cpp-dev python2 && \
|
apk add curl-dev rapidjson-dev libevent-dev pcre2-dev yaml-cpp-dev python2 && \
|
||||||
git clone https://github.com/svaarala/duktape --depth=1 && \
|
git clone https://github.com/svaarala/duktape --depth=1 && \
|
||||||
cd duktape && \
|
cd duktape && \
|
||||||
python2 -m ensurepip && \
|
python2 -m ensurepip && \
|
||||||
pip2 install PyYAML && \
|
pip2 install PyYAML && \
|
||||||
|
mkdir dist && \
|
||||||
python2 util/dist.py && \
|
python2 util/dist.py && \
|
||||||
cd dist/src && \
|
cd dist/source/src && \
|
||||||
cc -c -O3 -o duktape.o duktape.c && \
|
cc -c -O3 -o duktape.o duktape.c && \
|
||||||
cc -c -O3 -o duk_module_node.o -I. ../extras/module-node/duk_module_node.c && \
|
cc -c -O3 -o duk_module_node.o -I. ../extras/module-node/duk_module_node.c && \
|
||||||
ar cr libduktape.a duktape.o && \
|
ar cr libduktape.a duktape.o && \
|
||||||
@ -17,7 +18,7 @@ RUN apk add git g++ build-base linux-headers cmake && \
|
|||||||
install -m0644 *.a /usr/lib && \
|
install -m0644 *.a /usr/lib && \
|
||||||
install -m0644 duk*.h /usr/include && \
|
install -m0644 duk*.h /usr/include && \
|
||||||
install -m0644 ../extras/module-node/duk_module_node.h /usr/include && \
|
install -m0644 ../extras/module-node/duk_module_node.h /usr/include && \
|
||||||
cd ../../.. && \
|
cd ../../../.. && \
|
||||||
rm -rf duktape /usr/lib/python2.7 && \
|
rm -rf duktape /usr/lib/python2.7 && \
|
||||||
git clone https://github.com/tindy2013/subconverter --depth=1 && \
|
git clone https://github.com/tindy2013/subconverter --depth=1 && \
|
||||||
cd subconverter && \
|
cd subconverter && \
|
||||||
@ -28,7 +29,7 @@ RUN apk add git g++ build-base linux-headers cmake && \
|
|||||||
cd .. && \
|
cd .. && \
|
||||||
rm -rf subconverter && \
|
rm -rf subconverter && \
|
||||||
apk add pcre2 libcurl yaml-cpp libevent && \
|
apk add pcre2 libcurl yaml-cpp libevent && \
|
||||||
apk del git gcc g++ build-base linux-headers cmake libressl-dev curl-dev rapidjson-dev libevent-dev pcre2-dev yaml-cpp-dev python2
|
apk del git gcc g++ build-base linux-headers cmake curl-dev rapidjson-dev libevent-dev pcre2-dev yaml-cpp-dev python2
|
||||||
|
|
||||||
# set entry
|
# set entry
|
||||||
WORKDIR /base
|
WORKDIR /base
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
apk add gcc g++ build-base linux-headers cmake make autoconf automake libtool python2
|
apk add gcc g++ build-base linux-headers cmake make autoconf automake libtool python2
|
||||||
apk add mbedtls-dev mbedtls-static nghttp2-dev nghttp2-static zlib-dev rapidjson-dev libevent-dev libevent-static zlib-static pcre2-dev
|
apk add mbedtls-static zlib-dev rapidjson-dev libevent-dev libevent-static zlib-static pcre2-dev
|
||||||
|
|
||||||
git clone https://github.com/curl/curl --depth=1
|
git clone https://github.com/curl/curl --depth=1
|
||||||
cd curl
|
cd curl
|
||||||
cmake -DCMAKE_USE_MBEDTLS=ON -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_USE_LIBSSH2=OFF -DUSE_NGHTTP2=ON . > /dev/null
|
cmake -DCMAKE_USE_MBEDTLS=ON -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_USE_LIBSSH2=OFF . > /dev/null
|
||||||
make install -j2 > /dev/null
|
make install -j2 > /dev/null
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
@ -32,6 +32,7 @@ install -m0644 ./duk*.h /usr/include
|
|||||||
install -m0644 ../extras/module-node/duk_module_node.h /usr/include
|
install -m0644 ../extras/module-node/duk_module_node.h /usr/include
|
||||||
cd ../../../..
|
cd ../../../..
|
||||||
|
|
||||||
|
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig
|
||||||
cmake .
|
cmake .
|
||||||
make -j2
|
make -j2
|
||||||
rm subconverter
|
rm subconverter
|
||||||
|
|||||||
@ -34,7 +34,7 @@ cd ../../../..
|
|||||||
|
|
||||||
cp curl/lib/libcurl.a .
|
cp curl/lib/libcurl.a .
|
||||||
cp yaml-cpp/libyaml-cpp.a .
|
cp yaml-cpp/libyaml-cpp.a .
|
||||||
cp duktape/dist/src/*.a .
|
cp duktape/dist/source/src/*.a .
|
||||||
cp /usr/local/lib/libevent.a .
|
cp /usr/local/lib/libevent.a .
|
||||||
cp /usr/local/opt/zlib/lib/libz.a .
|
cp /usr/local/opt/zlib/lib/libz.a .
|
||||||
cp /usr/local/lib/libpcre2-8.a .
|
cp /usr/local/lib/libpcre2-8.a .
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user