Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 127 lines (99 sloc) 3.96 KB
#! /bin/bash
# COOKIE=$(mcookie|cut -c-8); grep -v V_GREP_ME $0 > /dev/shm/runme-$COOKIE.sh ; sleep 0.3; exec bash /dev/shm/runme-$COOKIE.sh
# TESTING=1
set -e
umask 022
PKG=wine
VERSION=9.10
BUILD=0
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/package/bin
PREFIX=/pkg/$PKG-$VERSION-$BUILD
if [ -n "$TESTING" ]; then PREFIX=/scratch/local2/$PKG-$VERSION-$BUILD ; fi
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ; fi
EOF
source $PREFIX/profile
BUILD_TMPDIR=/scratch/local2/$PKG-$VERSION-$BUILD.$USER.build.tmp
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR )
mkdir -p $BUILD_TMPDIR/home
# embedded patches, copy script to an accessible location
cp $0 $BUILD_TMPDIR; ME="$BUILD_TMPDIR/$(basename $0)"
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home
NPROC=$(( $(nproc) * 4 / 5 + 1 ))
mkdir -p $PREFIX/build
cd $PREFIX/build
(
VERSION=20240105
# orig: https://github.com/Winetricks/winetricks/archive/20240105/winetricks-20240105.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/3d21aa2867a0f638f36ffb9a33d3ed5f/winetricks-20240105.tar.gz
test -e winetricks-$VERSION.tar.xz || wget -nv $BEEHIVE
test -d winetricks-$VERSION || tar -xf winetricks-$VERSION.tar.gz
cd winetricks-$VERSION
mkdir -p $PREFIX/bin
cp src/winetricks $PREFIX/bin
chmod -c 0755 $PREFIX/bin/winetricks
mkdir -p $PREFIX/share/man/man1
cp -p src/winetricks.1 $PREFIX/share/man/man1
)
# orig: https://dl.winehq.org/wine/source/9.x/wine-9.10.tar.xz
BEEHIVE=https://beehive.molgen.mpg.de/a86ef50bdc9efc086e1726241aa58da2/wine-9.10.tar.xz
test -e wine-$VERSION.tar.xz || wget -nv $BEEHIVE
test -d wine-$VERSION || tar -xf wine-$VERSION.tar.xz
cd wine-$VERSION
# use a *working* clang/lld toolchain from llvm (lld-link is needed)
source /pkg/llvm-16.0.1-0/profile
sed -ne '/^#Epatch:writecopy/ s/^#Epatch:\S* // p' $ME | patch -p1 --verbose
sed -ne '/^#Epatch:flex/ s/^#Epatch:\S* // p' $ME | patch -p1 --verbose
./configure \
--prefix=$PREFIX \
--libdir=$PREFIX/lib \
--with-x \
--with-gnutls \
--with-opengl \
--without-vulkan \
--without-wayland \
--enable-win64 \
--enable-archs=i386,x86_64 \
--disable-tests
make depend
make -j $NPROC
make install
exit
# -------------------------------------------------------- Included patches
# from https://slackbuilds.org/repository/15.0/system/wine/
# ## writecopy.patch
#Epatch:writecopy --- a/dlls/kernelbase/memory.c
#Epatch:writecopy +++ a/dlls/kernelbase/memory.c
#Epatch:writecopy @@ -481,7 +481,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH VirtualLock( void *addr, SIZE_T size )
#Epatch:writecopy */
#Epatch:writecopy BOOL WINAPI DECLSPEC_HOTPATCH VirtualProtect( void *addr, SIZE_T size, DWORD new_prot, DWORD *old_prot )
#Epatch:writecopy {
#Epatch:writecopy - return VirtualProtectEx( GetCurrentProcess(), addr, size, new_prot, old_prot );
#Epatch:writecopy + BOOL ret = VirtualProtectEx( GetCurrentProcess(), addr, size, new_prot, old_prot );
#Epatch:writecopy + if (*old_prot == PAGE_WRITECOPY) *old_prot = PAGE_READWRITE;
#Epatch:writecopy + return ret;
#Epatch:writecopy }
#Epatch:writecopy
# ## flex.patch
#Epatch:flex --- a/programs/winhlp32/macro.lex.l
#Epatch:flex +++ b/programs/winhlp32/macro.lex.l
#Epatch:flex @@ -20,7 +20,7 @@
#Epatch:flex * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
#Epatch:flex */
#Epatch:flex %}
#Epatch:flex -%option noinput nounput never-interactive 8bit
#Epatch:flex +%option noinput nounput never-interactive 8bit noyywrap
#Epatch:flex %x quote
#Epatch:flex %{
#Epatch:flex #include <assert.h>
#Epatch:flex @@ -366,7 +366,3 @@ WINHELP_WINDOW* MACRO_CurrentWindow(void)
#Epatch:flex {
#Epatch:flex return lex_data ? lex_data->window : Globals.active_win;
#Epatch:flex }
#Epatch:flex -
#Epatch:flex -#ifndef yywrap
#Epatch:flex -int yywrap(void) { return 1; }
#Epatch:flex -#endif