From cae35d7a6ef34352d405ae10ae7658662b89c086 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 3 Oct 2021 14:35:03 +0800 Subject: [PATCH] Actions: Show commit and messages. Fix MIPS build fail. --- .github/workflows/release.yml | 7 ++++++- trunk/auto/depends.sh | 21 +++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f33823427..47ea846cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,13 +32,15 @@ jobs: # srs-server-xxx.tar.gz, because the package is named srs-server. # Generate variables like: # SRS_SOURCE_TAR=srs-server-4.0.145.tar.gz + # SRS_SOURCE_MD5=83e38700a80a26e30b2df054e69956e5 - name: Create source tar.gz run: | DEST_DIR=srs-server-$(echo ${SRS_TAG}| sed 's/^v//g') && mkdir -p $DEST_DIR && cp README.md $DEST_DIR && cp LICENSE $DEST_DIR && cp -R trunk $DEST_DIR/trunk && (cd $DEST_DIR/trunk/3rdparty && rm -rf *.zip openssl-*.gz srs-bench) && + tar zcf ${DEST_DIR}.tar.gz ${DEST_DIR} && du -sh ${DEST_DIR}* && rm -rf ${DEST_DIR} && echo "SRS_SOURCE_TAR=${DEST_DIR}.tar.gz" >> $GITHUB_ENV && - tar zcf ${DEST_DIR}.tar.gz ${DEST_DIR} && du -sh ${DEST_DIR}* && rm -rf ${DEST_DIR} + echo "SRS_SOURCE_MD5=$(md5sum ${DEST_DIR}.tar.gz| awk '{print $1}')" >> $GITHUB_ENV ################################################################ # Tests @@ -109,6 +111,9 @@ jobs: with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} + body: | + ${{ github.event.head_commit.message }} + ${{ env.SRS_SOURCE_MD5 }} ${{ env.SRS_SOURCE_TAR }} draft: false prerelease: true # Upload release files diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 80c9001e6..cdabc7038 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -680,7 +680,7 @@ if [[ $SRS_FFMPEG_FIT == YES ]]; then fi # For cross-build. if [[ $SRS_CROSS_BUILD == YES ]]; then - FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-cross-compile --target-os=linux" + FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-cross-compile --target-os=linux --disable-pthreads" FFMPEG_OPTIONS="$FFMPEG_OPTIONS --arch=$SRS_CROSS_BUILD_ARCH"; if [[ $SRS_CROSS_BUILD_CPU != "" ]]; then FFMPEG_OPTIONS="$FFMPEG_OPTIONS --cpu=$SRS_CROSS_BUILD_CPU"; fi FFMPEG_OPTIONS="$FFMPEG_OPTIONS --cross-prefix=$SRS_CROSS_BUILD_PREFIX" @@ -715,7 +715,24 @@ if [[ $SRS_FFMPEG_FIT == YES ]]; then if [[ $SRS_CROSS_BUILD == YES ]]; then sed -i -e 's/#define getenv(x) NULL/\/\*#define getenv(x) NULL\*\//g' config.h && sed -i -e 's/#define HAVE_GMTIME_R 0/#define HAVE_GMTIME_R 1/g' config.h && - sed -i -e 's/#define HAVE_LOCALTIME_R 0/#define HAVE_LOCALTIME_R 1/g' config.h + sed -i -e 's/#define HAVE_LOCALTIME_R 0/#define HAVE_LOCALTIME_R 1/g' config.h && + # For MIPS, which fail with: + # ./libavutil/libm.h:54:32: error: static declaration of 'cbrt' follows non-static declaration + # /root/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include/math.h:163:13: note: previous declaration of 'cbrt' was here + if [[ $SRS_CROSS_BUILD_ARCH == "mipsel" ]]; then + sed -i -e 's/#define HAVE_CBRT 0/#define HAVE_CBRT 1/g' config.h && + sed -i -e 's/#define HAVE_CBRTF 0/#define HAVE_CBRTF 1/g' config.h && + sed -i -e 's/#define HAVE_COPYSIGN 0/#define HAVE_COPYSIGN 1/g' config.h && + sed -i -e 's/#define HAVE_ERF 0/#define HAVE_ERF 1/g' config.h && + sed -i -e 's/#define HAVE_HYPOT 0/#define HAVE_HYPOT 1/g' config.h && + sed -i -e 's/#define HAVE_RINT 0/#define HAVE_RINT 1/g' config.h && + sed -i -e 's/#define HAVE_LRINT 0/#define HAVE_LRINT 1/g' config.h && + sed -i -e 's/#define HAVE_LRINTF 0/#define HAVE_LRINTF 1/g' config.h && + sed -i -e 's/#define HAVE_ROUND 0/#define HAVE_ROUND 1/g' config.h && + sed -i -e 's/#define HAVE_ROUNDF 0/#define HAVE_ROUNDF 1/g' config.h && + sed -i -e 's/#define HAVE_TRUNC 0/#define HAVE_TRUNC 1/g' config.h && + sed -i -e 's/#define HAVE_TRUNCF 0/#define HAVE_TRUNCF 1/g' config.h + fi fi && make ${SRS_JOBS} && make install && cd .. && rm -rf ffmpeg && ln -sf ffmpeg-4-fit/_release ffmpeg