Commit b9beb8a2 authored by Pavel Beketov's avatar Pavel Beketov

Update files

parent 44058778
#!/bin/sh -x
. ./config.sh
# build only 32 bit on i586 arch
[ "$(epm print info -a)" = "x86" ] && BUILDARCH=win32
# overrride BUILDARCH
[ "$1" ] && BUILDARCH="$1"
CLANG="$(which ccache 2>/dev/null) clang"
check_clang()
{
# TODO: check we have complete 11 or complete 12
if [ "$(epm print info -e)" = "AstraLinux/orel" ] ; then
epm assure llvm-link llvm-9 || fatal
epm assure clang-9 clang-9 || fatal
#epm assure clang clang || fatal
epm assure /usr/bin/lld-link lld-9 || fatal
epm assure /usr/bin/llvm-dlltool llvm-9 || fatal
# to allow clang build 32 bit
#epm install libgcc-10-dev-i386-cross || fatal
epm install gcc-multilib
elif [ "$(epm print info -p)" = "deb" ] ; then
epm assure llvm-link llvm-11 || fatal
epm assure clang-11 clang-11 || fatal
#epm assure clang clang || fatal
epm assure /usr/bin/lld-link lld-11 || fatal
epm assure /usr/bin/llvm-dlltool llvm-11 || fatal
# to allow clang build 32 bit
epm install libgcc-10-dev-i386-cross || fatal
else
epm assure llvm-link llvm || fatal
epm assure clang || fatal
epm assure /usr/bin/lld-link || fatal
epm assure /usr/bin/llvm-dlltool || fatal
# hack for p9
if ! clang --version | grep "clang version 1[1-9]" || ! lld-link --version | grep "LLD 1[1-9]" ; then
epmqp llvm10 | epme --auto
epmqp llvm7 | epme --auto
epm install llvm11.0 clang11.0 /usr/bin/lld-link /usr/bin/llvm-dlltool || fatal
fi
fi
}
epm assure git
epm assure time
case "$COMPILER" in
clang)
check_clang
export CC=$CLANG
;;
gcc)
;;
*)
fatal "Unknown COMPILER $COMPILER"
esac
case "$CROSSCOMPILER" in
clang)
check_clang
for i in clang clang-11 clang-10 clang-9 ; do
which $i 2>/dev/null >/dev/null || continue
export CROSSCC=$i
break
done
WINE_BUILD_OPTIONS="$WINE_BUILD_OPTIONS --with-mingw"
;;
mingw)
WINE_BUILD_OPTIONS="$WINE_BUILD_OPTIONS --with-mingw"
;;
none|'')
WINE_BUILD_OPTIONS="$WINE_BUILD_OPTIONS --without-mingw"
;;
*)
fatal "Unknown CROSSCOMPILER $CROSSCOMPILER"
esac
epm assure jmake etersoft-build-utils || fatal
get_current_branch()
{
( cd $REPO && git branch | grep '^\*' | sed 's/^..//' | tr -d "\n" )
}
print_build_mark()
{
echo "SOURCEREPO=$(realpath $REPO) BRANCH=$(get_current_branch) WINEVERSION='$(cat $REPO/VERSION)' CC=$COMPILER CROSSCC=$CROSSCOMPILER BUILDARCH=$BUILDARCH PLATFORM=$(epm print info -e)"
}
cd_to_repo()
{
if [ -d "$1" ] ; then
[ -f "$1/.eterbuild" ] || fatal "Нет флага .eterbuild в $1, создано не этим скриптом."
if [ "$(print_build_mark)" != "$(cat "$1/.eterbuild")" ] ; then
echo "Build mark $(print_build_mark) is changed (was $(cat "$1/.eterbuild")), removing old build dirs ..."
rm -rvf "$1"
fi
fi
# create dir if missed or just removed above
if [ ! -d "$1" ] ; then
mkdir -p "$1"
print_build_mark > "$1/.eterbuild"
fi
cd $1 || fatal
}
# need we?
# disable rpath using for executable
# subst "s|^\(LDRPATH_INSTALL =\).*|\1|" Makefile.in
if [ "$BUILDARCH" = "win64" ] || [ "$BUILDARCH" = "both" ] ; then
cd_to_repo $BUILDREPO64
$REPO/configure --enable-win64 ${WINE_BUILD_OPTIONS} || fatal "Return from $(pwd)"
fi
if [ "$BUILDARCH" = "win32" ] || [ "$BUILDARCH" = "both" ] ; then
cd_to_repo $BUILDREPO
# don't search X11 via pkg-config, so it will not help. For Astra I made ln -s /usr/lib32/i386-linux-gnu /usr/lib/i386-linux-gnu
#[ -d /usr/lib32/i386-linux-gnu/pkgconfig ] && export PKG_CONFIG_PATH=/usr/lib32/i386-linux-gnu/pkgconfig
# but default use wine tools from with-wine64 path (checking for the directory containing the Wine tools...)
#RELPATH64=../$(basename $BUILDREPO64)
RELPATH64=$BUILDREPO64
[ "$BUILDARCH" = "both" ] && [ -f "$BUILDREPO64/.eterbuild" ] && WINEOPT="--with-wine64=$RELPATH64" || WINEOPT=''
$REPO/configure $WINEOPT ${WINE_BUILD_OPTIONS} || fatal "Return from $(pwd)"
fi
if [ "$BUILDARCH" = "win64" ] || [ "$BUILDARCH" = "both" ] ; then
cd_to_repo $BUILDREPO64
jmake || fatal "Return from $(pwd)"
fi
if [ "$BUILDARCH" = "win32" ] || [ "$BUILDARCH" = "both" ] ; then
cd_to_repo $BUILDREPO
jmake || fatal "Return from $(pwd)"
fi
echo "Done: $(print_build_mark)"
# добавить в ww детект префикса (TODO: в wine?)
fatal()
{
echo "$*" >&2
exit 1
}
get_current_branch()
{
git branch | grep '^\*' | sed 's/^..//' | tr -d "\n"
}
# work repo
REPO=../wine-rebased
pref=$(epm print info -s)
BUILDREPO=../wine-$pref
BUILDREPO64=${BUILDREPO}64
# gcc, clang
COMPILER=gcc
# mingw, clang, none
CROSSCOMPILER=none
# win32, win64, both
BUILDARCH=both
WINE_BUILD_OPTIONS="--disable-tests --without-gstreamer --without-oss --without-capi --without-hal --with-xattr"
# see rpm-macros-feature too
if [ "$(epm print info -e)" != "ALTLinux/p9" ] && [ "$(epm print info -e)" != "AstraLinux/orel" ] ; then
# Vulkan support
WINE_BUILD_OPTIONS="$WINE_BUILD_OPTIONS --with-vulkan --with-vkd3d --with-faudio"
fi
if [ "$(epm print info -e)" = "AstraLinux/orel" ] ; then
WINE_BUILD_OPTIONS="$WINE_BUILD_OPTIONS --without-sdl --with-faudio"
fi
# https://bugs.etersoft.ru/show_bug.cgi?id=15244
#WINE_BUILD_OPTIONS="$WINE_BUILD_OPTIONS --without-unwind"
# удалённая система, куда копировать код
TARGET=/tmp/WINE/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment