Skip to content

Commit

Permalink
ccache build test
Browse files Browse the repository at this point in the history
  • Loading branch information
kasper93 committed Jul 22, 2023
1 parent 2dc8e70 commit 776fb51
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake pkg-config g++-mingw-w64 gcc-multilib python3-pip ninja-build nasm
sudo apt-get install -y autoconf automake pkg-config g++-mingw-w64 gcc-multilib python3-pip ninja-build nasm ccache wine
sudo python3 -m pip install meson
./bootstrap.py
Expand Down
231 changes: 117 additions & 114 deletions ci/build-mingw64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ cat >"$prefix_dir/crossfile" <<EOF
buildtype = 'release'
wrap_mode = 'nodownload'
[binaries]
c = '${CC}'
cpp = '${CXX}'
c = ['ccache', '${CC}']
cpp = ['ccache', '${CXX}']
ar = '${AR}'
strip = '${TARGET}-strip'
pkgconfig = 'pkg-config'
Expand All @@ -43,6 +43,9 @@ cpu = '${TARGET%%-*}'
endian = 'little'
EOF

export CC="ccache $CC"
export CC="ccache $CXX"

function builddir () {
[ -d "$1/builddir" ] && rm -rf "$1/builddir"
mkdir -p "$1/builddir"
Expand All @@ -66,63 +69,63 @@ function gettar () {
tar -xaf "$name"
}

## iconv
if [ ! -e "$prefix_dir/lib/libiconv.dll.a" ]; then
ver=1.17
gettar "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ver}.tar.gz"
builddir libiconv-${ver}
../configure --host=$TARGET $commonflags
makeplusinstall
popd
fi

## zlib
if [ ! -e "$prefix_dir/lib/libz.dll.a" ]; then
ver=1.2.13
gettar "https://zlib.net/fossils/zlib-${ver}.tar.gz"
pushd zlib-${ver}
make -fwin32/Makefile.gcc clean
make -fwin32/Makefile.gcc PREFIX=$TARGET- SHARED_MODE=1 \
DESTDIR="$prefix_dir" install \
BINARY_PATH=/bin INCLUDE_PATH=/include LIBRARY_PATH=/lib
popd
fi

## ffmpeg
if [ ! -e "$prefix_dir/lib/libavcodec.dll.a" ]; then
[ -d ffmpeg ] || $gitclone https://github.com/FFmpeg/FFmpeg.git ffmpeg
builddir ffmpeg
../configure --pkg-config=pkg-config --target-os=mingw32 \
--enable-cross-compile --cross-prefix=$TARGET- --arch=${TARGET%%-*} \
$commonflags \
--disable-{doc,programs,muxers,encoders,devices}
makeplusinstall
popd
fi

## shaderc
if [ ! -e "$prefix_dir/lib/libshaderc_shared.dll.a" ]; then
if [ ! -d shaderc ]; then
$gitclone https://github.com/google/shaderc.git
(cd shaderc && ./utils/git-sync-deps)
fi
builddir shaderc
cmake .. -DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF \
-DSHADERC_SKIP_TESTS=ON -DCMAKE_INSTALL_PREFIX=/
makeplusinstall
popd
fi

## spirv-cross
if [ ! -e "$prefix_dir/lib/libspirv-cross-c-shared.dll.a" ]; then
[ -d SPIRV-Cross ] || $gitclone https://github.com/KhronosGroup/SPIRV-Cross
builddir SPIRV-Cross
cmake .. -DCMAKE_SYSTEM_NAME=Windows \
-DSPIRV_CROSS_SHARED=ON -DSPIRV_CROSS_{CLI,STATIC}=OFF
makeplusinstall
popd
fi
# ## iconv
# if [ ! -e "$prefix_dir/lib/libiconv.dll.a" ]; then
# ver=1.17
# gettar "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ver}.tar.gz"
# builddir libiconv-${ver}
# ../configure --host=$TARGET $commonflags
# makeplusinstall
# popd
# fi

# ## zlib
# if [ ! -e "$prefix_dir/lib/libz.dll.a" ]; then
# ver=1.2.13
# gettar "https://zlib.net/fossils/zlib-${ver}.tar.gz"
# pushd zlib-${ver}
# make -fwin32/Makefile.gcc clean
# make -fwin32/Makefile.gcc PREFIX=$TARGET- SHARED_MODE=1 \
# DESTDIR="$prefix_dir" install \
# BINARY_PATH=/bin INCLUDE_PATH=/include LIBRARY_PATH=/lib
# popd
# fi

# ## ffmpeg
# if [ ! -e "$prefix_dir/lib/libavcodec.dll.a" ]; then
# [ -d ffmpeg ] || $gitclone https://github.com/FFmpeg/FFmpeg.git ffmpeg
# builddir ffmpeg
# ../configure --pkg-config=pkg-config --target-os=mingw32 \
# --enable-cross-compile --cross-prefix=$TARGET- --arch=${TARGET%%-*} \
# $commonflags \
# --disable-{doc,programs,muxers,encoders,devices}
# makeplusinstall
# popd
# fi

# ## shaderc
# if [ ! -e "$prefix_dir/lib/libshaderc_shared.dll.a" ]; then
# if [ ! -d shaderc ]; then
# $gitclone https://github.com/google/shaderc.git
# (cd shaderc && ./utils/git-sync-deps)
# fi
# builddir shaderc
# cmake .. -DCMAKE_SYSTEM_NAME=Windows \
# -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF \
# -DSHADERC_SKIP_TESTS=ON -DCMAKE_INSTALL_PREFIX=/
# makeplusinstall
# popd
# fi

# ## spirv-cross
# if [ ! -e "$prefix_dir/lib/libspirv-cross-c-shared.dll.a" ]; then
# [ -d SPIRV-Cross ] || $gitclone https://github.com/KhronosGroup/SPIRV-Cross
# builddir SPIRV-Cross
# cmake .. -DCMAKE_SYSTEM_NAME=Windows \
# -DSPIRV_CROSS_SHARED=ON -DSPIRV_CROSS_{CLI,STATIC}=OFF
# makeplusinstall
# popd
# fi

## libplacebo
if [ ! -e "$prefix_dir/lib/libplacebo.dll.a" ]; then
Expand All @@ -133,61 +136,61 @@ if [ ! -e "$prefix_dir/lib/libplacebo.dll.a" ]; then
popd
fi

## freetype2
if [ ! -e "$prefix_dir/lib/libfreetype.dll.a" ]; then
ver=2.13.0
gettar "https://mirror.netcologne.de/savannah/freetype/freetype-${ver}.tar.xz"
builddir freetype-${ver}
meson .. --cross-file "$prefix_dir/crossfile"
makeplusinstall
popd
fi

## fribidi
if [ ! -e "$prefix_dir/lib/libfribidi.dll.a" ]; then
ver=1.0.13
gettar "https://github.com/fribidi/fribidi/releases/download/v${ver}/fribidi-${ver}.tar.xz"
builddir fribidi-${ver}
meson .. --cross-file "$prefix_dir/crossfile" \
-D{tests,docs}=false
makeplusinstall
popd
fi

## harfbuzz
if [ ! -e "$prefix_dir/lib/libharfbuzz.dll.a" ]; then
ver=7.3.0
gettar "https://github.com/harfbuzz/harfbuzz/releases/download/${ver}/harfbuzz-${ver}.tar.xz"
builddir harfbuzz-${ver}
meson .. --cross-file "$prefix_dir/crossfile" \
-Dtests=disabled
makeplusinstall
popd
fi

## libass
if [ ! -e "$prefix_dir/lib/libass.dll.a" ]; then
[ -d libass ] || $gitclone https://github.com/libass/libass.git
builddir libass
[ -f ../configure ] || (cd .. && ./autogen.sh)
../configure --host=$TARGET $commonflags
makeplusinstall
popd
fi

## luajit
if [ ! -e "$prefix_dir/lib/libluajit-5.1.a" ]; then
ver=2.1.0-beta3
gettar "http://luajit.org/download/LuaJIT-${ver}.tar.gz"
pushd LuaJIT-${ver}
hostcc=cc
[[ "$TARGET" == "i686-"* ]] && hostcc="$hostcc -m32"
make TARGET_SYS=Windows clean
make TARGET_SYS=Windows HOST_CC="$hostcc" CROSS=$TARGET- \
BUILDMODE=static amalg
make DESTDIR="$prefix_dir" INSTALL_DEP= FILE_T=luajit.exe install
popd
fi
# ## freetype2
# if [ ! -e "$prefix_dir/lib/libfreetype.dll.a" ]; then
# ver=2.13.0
# gettar "https://mirror.netcologne.de/savannah/freetype/freetype-${ver}.tar.xz"
# builddir freetype-${ver}
# meson .. --cross-file "$prefix_dir/crossfile"
# makeplusinstall
# popd
# fi

# ## fribidi
# if [ ! -e "$prefix_dir/lib/libfribidi.dll.a" ]; then
# ver=1.0.13
# gettar "https://github.com/fribidi/fribidi/releases/download/v${ver}/fribidi-${ver}.tar.xz"
# builddir fribidi-${ver}
# meson .. --cross-file "$prefix_dir/crossfile" \
# -D{tests,docs}=false
# makeplusinstall
# popd
# fi

# ## harfbuzz
# if [ ! -e "$prefix_dir/lib/libharfbuzz.dll.a" ]; then
# ver=7.3.0
# gettar "https://github.com/harfbuzz/harfbuzz/releases/download/${ver}/harfbuzz-${ver}.tar.xz"
# builddir harfbuzz-${ver}
# meson .. --cross-file "$prefix_dir/crossfile" \
# -Dtests=disabled
# makeplusinstall
# popd
# fi

# ## libass
# if [ ! -e "$prefix_dir/lib/libass.dll.a" ]; then
# [ -d libass ] || $gitclone https://github.com/libass/libass.git
# builddir libass
# [ -f ../configure ] || (cd .. && ./autogen.sh)
# ../configure --host=$TARGET $commonflags
# makeplusinstall
# popd
# fi

# ## luajit
# if [ ! -e "$prefix_dir/lib/libluajit-5.1.a" ]; then
# ver=2.1.0-beta3
# gettar "http://luajit.org/download/LuaJIT-${ver}.tar.gz"
# pushd LuaJIT-${ver}
# hostcc=cc
# [[ "$TARGET" == "i686-"* ]] && hostcc="$hostcc -m32"
# make TARGET_SYS=Windows clean
# make TARGET_SYS=Windows HOST_CC="$hostcc" CROSS=$TARGET- \
# BUILDMODE=static amalg
# make DESTDIR="$prefix_dir" INSTALL_DEP= FILE_T=luajit.exe install
# popd
# fi

## mpv

Expand Down

0 comments on commit 776fb51

Please sign in to comment.