mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2025-11-03 15:23:29 +00:00
Update build scripts
This commit is contained in:
72
.travis.yml
72
.travis.yml
@@ -38,7 +38,7 @@ jobs:
|
||||
- name: "Linux x86_64 Build"
|
||||
services: docker
|
||||
script:
|
||||
- docker run -v $TRAVIS_BUILD_DIR:/root/workdir alpine:latest /bin/sh -c "apk add bash git && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh"
|
||||
- docker run -v $TRAVIS_BUILD_DIR:/root/workdir multiarch/alpine:amd64-edge /bin/sh -c "apk add bash git && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh"
|
||||
deploy:
|
||||
provider: releases
|
||||
token: "$GITHUB_OAUTH_TOKEN"
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
services: docker
|
||||
arch: arm64
|
||||
script:
|
||||
- docker run -v $TRAVIS_BUILD_DIR:/root/workdir alpine:latest /bin/sh -c "apk add bash git && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh"
|
||||
- docker run -v $TRAVIS_BUILD_DIR:/root/workdir multiarch/alpine:aarch64-edge /bin/sh -c "apk add bash git && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh"
|
||||
before_deploy:
|
||||
- mv subconverter_linux64.tar.gz subconverter_aarch64.tar.gz
|
||||
deploy:
|
||||
@@ -75,5 +75,73 @@ jobs:
|
||||
file: "subconverter_aarch64.tar.gz"
|
||||
skip_cleanup: true
|
||||
draft: true
|
||||
on:
|
||||
tags: true
|
||||
- name: "Windows x86 Build"
|
||||
os: windows
|
||||
script:
|
||||
- export shell="$mingw32"
|
||||
- bash scripts/build.windows.sh
|
||||
before_deploy:
|
||||
- mv subconverter_win64.zip subconverter_win32.zip
|
||||
deploy:
|
||||
provider: releases
|
||||
token: "$GITHUB_OAUTH_TOKEN"
|
||||
file: "subconverter_win32.zip"
|
||||
skip_cleanup: true
|
||||
draft: true
|
||||
on:
|
||||
tags: true
|
||||
- name: "Windows x86_64 Build"
|
||||
os: windows
|
||||
script:
|
||||
- export shell="$mingw64"
|
||||
- bash scripts/build.windows.sh
|
||||
deploy:
|
||||
provider: releases
|
||||
token: "$GITHUB_OAUTH_TOKEN"
|
||||
file: "subconverter_win64.zip"
|
||||
skip_cleanup: true
|
||||
draft: true
|
||||
on:
|
||||
tags: true
|
||||
|
||||
before_install:
|
||||
- |-
|
||||
case $TRAVIS_OS_NAME in
|
||||
windows)
|
||||
[[ ! -f C:/tools/msys64/msys2_shell.cmd ]] && rm -rf C:/tools/msys64
|
||||
choco uninstall -y mingw
|
||||
choco upgrade --no-progress -y msys2
|
||||
export msys2='cmd //C RefreshEnv.cmd '
|
||||
export msys2+='& set MSYS=winsymlinks:nativestrict '
|
||||
export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
|
||||
export mingw64="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --"
|
||||
export mingw32="$msys2 -mingw32 -full-path -here -c "\"\$@"\" --"
|
||||
export msys2+=" -msys2 -c "\"\$@"\" --"
|
||||
$msys2 pacman --sync --noconfirm --needed mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain zip
|
||||
$msys2 pacman --sync --noconfirm --needed mingw-w64-i686-cmake mingw-w64-x86_64-cmake
|
||||
$msys2 pacman --sync --noconfirm --needed mingw-w64-i686-pcre2 mingw-w64-x86_64-pcre2 pcre2-devel
|
||||
$msys2 pacman --sync --noconfirm --needed mingw-w64-i686-libevent mingw-w64-x86_64-libevent libevent-devel
|
||||
$msys2 pacman --sync --noconfirm --needed mingw-w64-i686-yaml-cpp mingw-w64-x86_64-yaml-cpp
|
||||
$msys2 pacman --sync --noconfirm --needed mingw-w64-i686-rapidjson mingw-w64-x86_64-rapidjson
|
||||
$msys2 pacman --sync --noconfirm --needed mingw-w64-i686-zlib mingw-w64-x86_64-zlib zlib-devel
|
||||
$msys2 pacman --sync --noconfirm --needed mingw-w64-i686-openssl mingw-w64-x86_64-openssl openssl-devel
|
||||
taskkill //IM gpg-agent.exe //F
|
||||
export PATH=/C/tools/msys64/mingw64/bin:/C/tools/msys64/mingw32/bin:$PATH
|
||||
export MAKE=mingw32-make
|
||||
;;
|
||||
esac
|
||||
|
||||
before_cache:
|
||||
- |-
|
||||
case $TRAVIS_OS_NAME in
|
||||
windows)
|
||||
$msys2 pacman --sync --clean --noconfirm
|
||||
;;
|
||||
esac
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/AppData/Local/Temp/chocolatey
|
||||
- /C/tools/msys64
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/bin/bash
|
||||
mkdir obj
|
||||
set -xe
|
||||
|
||||
apk add gcc g++ build-base linux-headers cmake make autoconf automake libtool
|
||||
@@ -13,10 +12,13 @@ cd ..
|
||||
|
||||
cmake .
|
||||
make -j2
|
||||
rm subconverter
|
||||
g++ -o base/subconverter CMakeFiles/subconverter.dir/src/*.o -static -lpcre2-8 -levent -lyaml-cpp -lcurl -lnghttp2 -lssl -lcrypto -lz -lbz2 -ldl -lpthread -O3 -s
|
||||
|
||||
cd base
|
||||
chmod +rx subconverter
|
||||
chmod +r *
|
||||
cd ..
|
||||
mv base subconverter
|
||||
|
||||
tar czf ../subconverter_linux64.tar.gz *
|
||||
tar czf subconverter_linux64.tar.gz subconverter/
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#!/bin/bash
|
||||
mkdir obj
|
||||
set -xe
|
||||
|
||||
brew reinstall yaml-cpp rapidjson libevent zlib pcre2 bzip2 pkgconfig
|
||||
|
||||
git clone https://github.com/curl/curl
|
||||
cd curl
|
||||
./buildconf > /dev/null
|
||||
./configure --with-ssl=/usr/local/opt/openssl@1.1 --without-mbedtls --disable-ldap --disable-ldaps --disable-rtsp --without-libidn2 > /dev/null
|
||||
#./buildconf > /dev/null
|
||||
#./configure --with-ssl=/usr/local/opt/openssl@1.1 --without-mbedtls --disable-ldap --disable-ldaps --disable-rtsp --without-libidn2 > /dev/null
|
||||
cmake -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 .
|
||||
make -j8 > /dev/null
|
||||
cd ..
|
||||
|
||||
@@ -23,12 +23,14 @@ cp /usr/local/opt/bzip2/lib/libbz2.a .
|
||||
export CMAKE_CXX_FLAGS="-I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/curl/include"
|
||||
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 .
|
||||
make -j8
|
||||
rm subconverter
|
||||
c++ -Xlinker -unexported_symbol -Xlinker "*" -o base/subconverter CMakeFiles/subconverter.dir/src/*.o libpcre2-8.a libevent.a libcurl.a libz.a libssl.a libcrypto.a libyaml-cpp.a libbz2.a -ldl -lpthread -O3
|
||||
|
||||
cd base
|
||||
chmod +rx subconverter
|
||||
chmod +r *
|
||||
tar czf ../subconverter_darwin64.tar.gz *
|
||||
cd ..
|
||||
mv base subconverter
|
||||
tar czf subconverter_darwin64.tar.gz subconverter
|
||||
|
||||
set +xe
|
||||
|
||||
18
scripts/build.windows.sh
Normal file
18
scripts/build.windows.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -xe
|
||||
|
||||
git clone https://github.com/curl/curl
|
||||
cd curl
|
||||
$shell cmake -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -G "Unix Makefiles" .
|
||||
$shell make -j4
|
||||
cd ..
|
||||
|
||||
$shell cmake .
|
||||
$shell make -j2
|
||||
rm subconverter.exe
|
||||
$shell g++ -o base/subconverter CMakeFiles/subconverter.dir/src/*.obj curl/lib/libcurl.a -static -lpcre2-8 -levent -lyaml-cpp -lssl -lcrypto -lwsock32 -lws2_32 -lz
|
||||
|
||||
mv base subconverter
|
||||
zip -q -r subconverter_win64.zip subconverter/
|
||||
|
||||
set +xe
|
||||
Reference in New Issue
Block a user