Skip to content

Commit

Permalink
merge code
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Jun 22, 2024
2 parents 53df6c1 + 5afd12c commit eaeef68
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux-aarch64.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build-php-cli-linux-aarch64
name: build-linux-aarch64

on: [ push, pull_request ]

Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
echo `expr $LIB_NUM - $CACHE_NUM`
if test $(ls -A /usr/local/swoole-cli/ | wc -l) -eq 0 ; then
TAG=all-dependencies-alpine-3.17-php8-v1.0.0-aarch64-20231113T121401Z
TAG=all-dependencies-alpine-3.18-php8-v1.0.0-aarch64-20240618T091126Z
IMAGE="docker.io/jingjingxyk/build-swoole-cli:${TAG}"
container_id=$(docker create $IMAGE) # returns container ID
docker cp $container_id:/usr/local/swoole-cli/ /usr/local/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-mips64le.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build-php-cli-linux-mips64le
name: build-linux-mips64le

on: [ push, pull_request ]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-riscv64.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build-php-cli-linux-riscv64
name: build-linux-riscv64

on: [ push, pull_request ]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
mkdir -p pool/ext
mkdir -p bin/runtime
if [ ! -f bin/runtime/php ] ; then
bash sapi/quickstart/setup-php-runtime.sh --mirror china
bash sapi/quickstart/setup-php-runtime.sh
fi
bash sapi/download-box/download-box-get-archive-from-server.sh
ls -A pool/lib/
Expand Down
4 changes: 1 addition & 3 deletions build-release-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if [ "$OS" = 'linux' ] ; then
if [ ! "$BASH_VERSION" ] ; then
echo "Please use bash to run this script ($0) " 1>&2
echo "fix : " 1>&2
echo "apk add bash OR sh sapi/quickstart/linux/alpine-init-mini.sh " 1>&2
echo "apk add bash OR sh sapi/quickstart/linux/alpine-init-minimal.sh " 1>&2
exit 1
# reconfigure #
# dpkg-reconfigure dash
Expand Down Expand Up @@ -247,8 +247,6 @@ fi

# 定制构建选项
OPTIONS="${OPTIONS} +apcu +ds +xlswriter +ssh2 +uuid "
OPTIONS="${OPTIONS} "
OPTIONS="${OPTIONS} --with-libavif=1"
OPTIONS="${OPTIONS} --with-global-prefix=${LIBRARY_INSTALL_PREFIX}"
# OPTIONS="${OPTIONS} @macos"

Expand Down
7 changes: 7 additions & 0 deletions sapi/quickstart/clean-folder-for-extra-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,11 @@ test -d nginx && rm -rf nginx
test -d postgis && rm -rf postgis


cd ${__PROJECT__}/.github/workflows
test -f ceph.yml && rm -rf ceph.yml
test -f kubernetes.yml && rm -rf kubernetes.yml
test -f ovn.yml && rm -rf ovn.yml
test -f ovn.yml && rm -rf ovn.yml


cd ${__PROJECT__}
2 changes: 1 addition & 1 deletion sapi/quickstart/linux/install-docker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -exu
set -ex
__DIR__=$(
cd "$(dirname "$0")"
pwd
Expand Down
8 changes: 5 additions & 3 deletions sapi/src/builder/extension/aaa_example.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
$workdir = $p->getWorkDir();
$builddir = $p->getBuildDir();
$ffmpeg_prefix = FFMPEG_PREFIX;
$system_arch=$p->getSystemArch();

$cmd = <<<EOF
mkdir -p {$workdir}/bin/ffmpeg/
Expand All @@ -133,20 +134,21 @@
cd {$workdir}/bin/
{$workdir}/bin/ffmpeg/bin/ffmpeg -h
APP_VERSION=\$({$workdir}/bin/ffmpeg/bin/ffmpeg -version | head -n 1 | awk '{ print $3 }')
cd {$workdir}/bin/
EOF;
if ($p->getOsType() == 'macos') {
$cmd .= <<<EOF
xattr -cr {$workdir}/bin/ffmpeg/bin/ffmpeg
otool -L {$workdir}/bin/ffmpeg/bin/ffmpeg
tar -cJvf {$workdir}/ffmpeg-vlatest-static-macos-x64.tar.xz ffmpeg
tar -cJvf {$workdir}/ffmpeg-\${APP_VERSION}-macos-{$system_arch}.tar.xz ffmpeg
EOF;
} else {
$cmd .= <<<EOF
file {$workdir}/bin/ffmpeg/bin/ffmpeg
readelf -h {$workdir}/bin/ffmpeg/bin/ffmpeg
tar -cJvf {$workdir}/ffmpeg-vlatest-static-linux-x64.tar.xz ffmpeg
tar -cJvf {$workdir}/ffmpeg-\${APP_VERSION}-linux-{$system_arch}.tar.xz ffmpeg
EOF;
}
return $cmd;
Expand Down
9 changes: 5 additions & 4 deletions sapi/src/builder/extension/aria2.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,28 @@

$workdir = $p->getWorkDir();
$builddir = $p->getBuildDir();

$system_arch=$p->getSystemArch();
$cmd = <<<EOF
mkdir -p {$workdir}/bin/
cd {$builddir}/aria2/src
cp -f aria2c {$workdir}/bin/
strip {$workdir}/bin/aria2c
cd {$workdir}/bin/
ARIA2_VERSION=\$({$workdir}/bin/aria2c -v | head -n 1 | awk '{print $3}')
APP_VERSION=\$({$workdir}/bin/aria2c -v | head -n 1 | awk '{print $3}')
EOF;
if ($p->getOsType() == 'macos') {
$cmd .= <<<EOF
xattr -cr {$workdir}/bin/aria2c
otool -L {$workdir}/bin/aria2c
tar -cJvf {$workdir}/aria2c-\${ARIA2_VERSION}-macos-x64.tar.xz aria2c
tar -cJvf {$workdir}/aria2c-\${APP_VERSION}-macos-{$system_arch}.tar.xz aria2c
EOF;
} else {
$cmd .= <<<EOF
file {$workdir}/bin/aria2c
readelf -h {$workdir}/bin/aria2c
tar -cJvf {$workdir}/aria2c-\${ARIA2_VERSION}-linux-x64.tar.xz aria2c
tar -cJvf {$workdir}/aria2c-\${APP_VERSION}-linux-{$system_arch}.tar.xz aria2c

EOF;
}
Expand Down
19 changes: 19 additions & 0 deletions sapi/src/builder/extension/iperf3.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,32 @@
$workdir = $p->getWorkDir();
$builddir = $p->getBuildDir();
$installdir = $p->getGlobalPrefix();
$system_arch=$p->getSystemArch();

$cmd = <<<EOF
mkdir -p {$workdir}/bin/
cd {$installdir}/iperf3/bin/
cp -f iperf3 {$workdir}/bin/iperf3
APP_VERSION=\$({$workdir}/bin/iperf3 -v | head -n 1 | awk '{ print $2 }')
EOF;
if ($p->getOsType() == 'macos') {
$cmd .= <<<EOF
xattr -cr {$workdir}/bin/iperf3
otool -L {$workdir}/bin/iperf3
tar -cJvf {$workdir}/iperf3-\${APP_VERSION}-macos-{$system_arch}.tar.xz aria2c
EOF;
} else {
$cmd .= <<<EOF
file {$workdir}/bin/iperf3
readelf -h {$workdir}/bin/iperf3
tar -cJvf {$workdir}/iperf3-\${APP_VERSION}-linux-{$system_arch}.tar.xz aria2c

EOF;
}
return $cmd;

return $cmd;
});
};
2 changes: 1 addition & 1 deletion sapi/src/builder/library/6tunnel.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@

# https://github.com/wojtekka/6tunnel.git
35 changes: 29 additions & 6 deletions sapi/src/builder/library/aria2.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,38 @@
return function (Preprocessor $p) {
$aria2_prefix = ARIA2_PREFIX;
$libiconv_prefix = ICONV_PREFIX;
$libintl_prefix = LIBINTL_PREFIX;
$libs = $p->isMacos() ? '-lc++' : ' -lstdc++ ';
$p->addLibrary(
(new Library('aria2'))
->withHomePage('https://aria2.github.io/')
->withLicense('https://github.com/aria2/aria2/blob/master/COPYING', Library::LICENSE_GPL)
->withUrl('https://github.com/aria2/aria2/releases/download/release-1.37.0/aria2-1.37.0.tar.gz')
->withManual('https://aria2.github.io/manual/en/html/README.html')
->withCleanBuildDirectory()
->withInstallCached(false)
->withBuildCached(false)
->withConfigure(
<<<EOF
./configure --help
set -x
PACKAGES='zlib openssl sqlite3 nettle libxml-2.0 libcares'
PACKAGES="\$PACKAGES libssh2 libuv"
CPPFLAGS="-I{$libiconv_prefix}/include"
LDFLAGS="-L{$libiconv_prefix}/lib"
LIBS="-liconv"
PACKAGES="\$PACKAGES gmp"
PACKAGES="\$PACKAGES expat"
PACKAGES="\$PACKAGES libssh2"
PACKAGES="\$PACKAGES nettle hogweed"
CPPFLAGS="-I{$libiconv_prefix}/include -I{$libintl_prefix}/include "
LDFLAGS="-L{$libiconv_prefix}/lib -L{$libintl_prefix}/lib"
LIBS="-liconv -lintl {$libs}"
CPPFLAGS="$(pkg-config --cflags-only-I --static \$PACKAGES) \$CPPFLAGS " \
LDFLAGS="$(pkg-config --libs-only-L --static \$PACKAGES) \$LDFLAGS " \
LIBS="$(pkg-config --libs-only-l --static \$PACKAGES) \$LIBS " \
EXPAT_CFLAGS="$(pkg-config --cflags --static expat) " \
EXPAT_LIBS="$(pkg-config --libs --static expat)" \
LIBNETTLE_CFLAGS="$(pkg-config --cflags --static nettle hogweed) " \
LIBNETTLE_LIBS="$(pkg-config --libs --static nettle hogweed)" \
GMP_CFLAGS="$(pkg-config --cflags --static gmp) " \
GMP_LIBS="$(pkg-config --libs --static gmp)" \
ARIA2_STATIC=yes \
./configure \
--with-ca-bundle="/etc/ssl/certs/ca-certificates.crt" \
Expand All @@ -36,7 +49,12 @@
--without-gnutls \
--with-openssl \
--with-libiconv-prefix={$libiconv_prefix} \
--with-libz
--with-libz \
--without-libssh2 \
--without-wintls \
--without-gnutls \
--without-libgcrypt
# --without-appletls \
# --with-tcmalloc
EOF
)
Expand All @@ -50,7 +68,12 @@
'nettle',
'libxml2',
'cares',
'libssh2'
'libssh2',
'gmp',
'libexpat',
'libintl',
'libssh2',
'nettle'
)
);
};
2 changes: 2 additions & 0 deletions sapi/src/builder/library/iperf3.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
)
->withFile('iperf3-latest.tar.gz')
->withPrefix($iperf3_prefix)
->withBuildCached(false)
->withInstallCached(false)
->withConfigure(
<<<EOF
./configure --help
Expand Down
2 changes: 2 additions & 0 deletions sapi/src/builder/library/wslay.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# websocket 库
# https://github.com/tatsuhiro-t/wslay.git

0 comments on commit eaeef68

Please sign in to comment.