ci: Use hidden .env file to store environmental updates

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2022-01-10 01:20:45 +01:00
parent a2e7cca590
commit e13759d272
9 changed files with 88 additions and 48 deletions
+1
View File
@@ -2,3 +2,4 @@ export $1="$2"
if [[ "${CI}" == "true" ]]; then
echo "::set-output name=$1::$2"
fi
echo "export $1=\"$2\"" >> ${SCRIPTROOT}/.env
+3 -1
View File
@@ -3,5 +3,7 @@ for file in ${SCRIPTROOT}/scripts/*.sh; do
echo "================================================================================"
echo ">> ${file}"
echo "================================================================================"
. ${file}
. ${SCRIPTROOT}/.env
${file}
if [[ $? -ne 0 ]]; then exit 1; fi
done
+21 -21
View File
@@ -7,13 +7,13 @@ GCC_SYSROOT="`${BUILD_PREFIX}-gcc -print-sysroot`"
mingw_clone() {
if [ ! -d /tmp/mingw ]; then
git clone -b "${MINGW_VERSION}" --depth 1 "${REPOSITORY}" /tmp/mingw
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
else
pushd /tmp/mingw > /dev/null
git fetch --all
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
git reset --hard "${MINGW_VERSION}"
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
popd > /dev/null
fi
}
@@ -36,15 +36,15 @@ mingw_build_crt() {
--enable-lib64
)
./configure ${mingw_configure[@]}
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
# Build MinGW
make -j`nproc`
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
# Install MinGW
sudo make install
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
popd > /dev/null
}
@@ -67,15 +67,15 @@ mingw_build_headers() {
--enable-idl
)
./configure ${mingw_configure[@]}
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
# Build MinGW
make -j`nproc`
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
# Install MinGW
sudo make install
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
popd > /dev/null
}
@@ -98,22 +98,22 @@ mingw_build_library_winpthreads() {
--with-pic
)
./configure ${mingw_configure[@]}
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
# Build MinGW
make -j`nproc`
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
# Install MinGW
sudo make install
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
popd > /dev/null
}
mingw_build_libraries() {
mingw_build_library_winpthreads
if [[ $? -ne 0 ]]; then exit 1; fi
if [[ $? -ne 0 ]]; then return 1; fi
}
mingw_build() {
@@ -125,17 +125,17 @@ mingw_build() {
unset LDFLAGS
unset PKG_CONFIG_LIBDIR
mingw_build_crt
if [[ $? -ne 0 ]]; then exit 1; fi
mingw_build_headers
if [[ $? -ne 0 ]]; then exit 1; fi
mingw_build_libraries
if [[ $? -ne 0 ]]; then exit 1; fi
#mingw_build_crt
#if [[ $? -ne 0 ]]; then return 1; fi
#mingw_build_headers
#if [[ $? -ne 0 ]]; then return 1; fi
#mingw_build_libraries
#if [[ $? -ne 0 ]]; then return 1; fi
popd > /dev/null
}
#mingw_clone
mingw_clone
if [[ $? -ne 0 ]]; then exit 1; fi
#mingw_build
mingw_build
if [[ $? -ne 0 ]]; then exit 1; fi
+6 -1
View File
@@ -2,13 +2,18 @@ REPOSITORY="https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git"
function amd_amf() {
if [[ ${VERSION_MAJOR} -lt 4 ]]; then
exit 0
return 0
fi
git clone --depth 1 --branch "${AMDAMF_VERSION}" "${REPOSITORY}" /tmp/amd-amf
if [[ $? -ne 0 ]]; then return 1; fi
pushd /tmp/amd-amf > /dev/null
if [[ $? -ne 0 ]]; then return 1; fi
sudo cp -R amf/public/include/ /usr/${BUILD_PREFIX}/include/AMF
if [[ $? -ne 0 ]]; then return 1; fi
popd > /dev/null
if [[ $? -ne 0 ]]; then return 1; fi
}
amd_amf
if [[ $? -ne 0 ]]; then exit 1; fi
+7 -1
View File
@@ -2,14 +2,20 @@ REPOSITORY="https://git.videolan.org/git/ffmpeg/nv-codec-headers.git"
function nvidia_nvenc() {
if [[ ${VERSION_MAJOR} -lt 3 ]]; then
exit 0
return 0
fi
git clone --depth 1 --branch "${NVIDIANVENC_VERSION}" "${REPOSITORY}" /tmp/nvidia-nvenc
if [[ $? -ne 0 ]]; then return 1; fi
pushd "/tmp/nvidia-nvenc" > /dev/null
if [[ $? -ne 0 ]]; then return 1; fi
make PREFIX=/usr/${BUILD_PREFIX}
if [[ $? -ne 0 ]]; then return 1; fi
sudo make PREFIX=/usr/${BUILD_PREFIX} install
if [[ $? -ne 0 ]]; then return 1; fi
popd > /dev/null
if [[ $? -ne 0 ]]; then return 1; fi
}
nvidia_nvenc
if [[ $? -ne 0 ]]; then exit 1; fi
+5
View File
@@ -1,8 +1,13 @@
function install_zlib() {
curl -L -o "/tmp/zlib.zip" "https://github.com/Xaymar/zlib-ng/releases/download/${ZLIB_VERSION}/zlib-ng-${BUILD_BITS}.zip"
if [[ $? -ne 0 ]]; then return 1; fi
7z x -o/tmp/zlib/ "/tmp/zlib.zip"
if [[ $? -ne 0 ]]; then return 1; fi
sudo cp -a /tmp/zlib/. /usr/${BUILD_PREFIX}/
if [[ $? -ne 0 ]]; then return 1; fi
cp -a /tmp/zlib/bin/*.dll ./distrib/bin/
if [[ $? -ne 0 ]]; then return 1; fi
}
install_zlib
if [[ $? -ne 0 ]]; then exit 1; fi
+8 -1
View File
@@ -1,14 +1,21 @@
function install_aom() {
if [[ ${VERSION_MAJOR} -lt 4 ]]; then
exit 0
return 0
fi
curl -L -o "/tmp/aom.7z" "https://github.com/Xaymar/aom/releases/download/${AOM_VERSION}/aom-windows-${BUILD_BITS}-shared.7z"
if [[ $? -ne 0 ]]; then return 1; fi
7z x -o/tmp/aom "/tmp/aom.7z"
if [[ $? -ne 0 ]]; then return 1; fi
sed -i -E "s/^prefix=.*$/prefix=\/usr\/${BUILD_PREFIX}/g" /tmp/aom/lib/pkgconfig/aom.pc
if [[ $? -ne 0 ]]; then return 1; fi
cp /tmp/aom/lib/pkgconfig/aom.pc /tmp/aom/lib/pkgconfig/libaom.pc
if [[ $? -ne 0 ]]; then return 1; fi
sudo cp -a /tmp/aom/. /usr/${BUILD_PREFIX}/
if [[ $? -ne 0 ]]; then return 1; fi
cp -a /tmp/aom/bin/*.dll ./distrib/bin/
if [[ $? -ne 0 ]]; then return 1; fi
}
install_aom
if [[ $? -ne 0 ]]; then exit 1; fi
+7 -2
View File
@@ -1,15 +1,20 @@
function install_libx264() {
if [[ ${VERSION_MAJOR} -lt 1 ]]; then
exit 0
return 0
fi
if [[ "${LICENSE}" != "GPL" ]]; then
exit 0
return 0
fi
curl -L -o "/tmp/x264.zip" "https://github.com/Xaymar/x264/releases/download/${X264_VERSION}/x264-${BUILD_BITS}-shared-GPLv2.zip"
if [[ $? -ne 0 ]]; then return 1; fi
7z x -o/tmp/x264/ "/tmp/x264.zip"
if [[ $? -ne 0 ]]; then return 1; fi
sudo cp -a /tmp/x264/. /usr/${BUILD_PREFIX}/
if [[ $? -ne 0 ]]; then return 1; fi
cp -a /tmp/x264/bin/*.dll ./distrib/bin/
if [[ $? -ne 0 ]]; then return 1; fi
}
install_libx264
if [[ $? -ne 0 ]]; then exit 1; fi
+30 -21
View File
@@ -1,25 +1,34 @@
export PKG_CONFIG_PATH=/usr/${BUILD_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}
function install_ffmpeg() {
export PKG_CONFIG_PATH=/usr/${BUILD_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}
# Configure FFmpeg
./configure \
--arch="${BUILD_ARCH}" \
--target-os="${BUILD_TARGET}" \
--cross-prefix="${BUILD_PREFIX}-" \
--prefix="${PWD}/distrib" \
--bindir="${PWD}/distrib/bin" \
--libdir="${PWD}/distrib/lib" \
--shlibdir="${PWD}/distrib/bin" \
--pkg-config=pkg-config \
--extra-cflags=-O3 --extra-cflags=-mmmx --extra-cflags=-msse --extra-cflags=-msse2 --extra-cflags=-msse3 --extra-cflags=-mssse3 \
--extra-cflags=-msse4.1 --extra-cflags=-msse4.2 --extra-cflags=-mavx --extra-cflags=-maes --extra-cflags=-mpclmul \
--pkg-config=pkg-config \
${BUILD_FLAGS}
# Configure FFmpeg
./configure \
--arch="${BUILD_ARCH}" \
--target-os="${BUILD_TARGET}" \
--cross-prefix="${BUILD_PREFIX}-" \
--prefix="${PWD}/distrib" \
--bindir="${PWD}/distrib/bin" \
--libdir="${PWD}/distrib/lib" \
--shlibdir="${PWD}/distrib/bin" \
--pkg-config=pkg-config \
--extra-cflags=-O3 --extra-cflags=-mmmx --extra-cflags=-msse --extra-cflags=-msse2 --extra-cflags=-msse3 --extra-cflags=-mssse3 \
--extra-cflags=-msse4.1 --extra-cflags=-msse4.2 --extra-cflags=-mavx --extra-cflags=-maes --extra-cflags=-mpclmul \
--pkg-config=pkg-config \
${BUILD_FLAGS}
if [[ $? -ne 0 ]]; then return 1; fi
# Compile FFmpeg
make -j$((`nproc` * 2))
# Compile FFmpeg
make -j$((`nproc` * 2))
if [[ $? -ne 0 ]]; then return 1; fi
# Install FFmpeg
sudo make install
# Install FFmpeg
sudo make install
if [[ $? -ne 0 ]]; then return 1; fi
# Move .lib files which are in the wrong place.
mv ./distrib/bin/*.lib ./distrib/lib/
# Move .lib files which are in the wrong place.
mv ./distrib/bin/*.lib ./distrib/lib/
if [[ $? -ne 0 ]]; then return 1; fi
}
install_ffmpeg
if [[ $? -ne 0 ]]; then exit 1; fi