Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wine-devel, wine-staging: Allow building on 10.12 and later #27345

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 57 additions & 11 deletions emulators/wine-devel/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ name wine-devel
conflicts wine-stable wine-staging wine-crossover
set my_name wine
revision 1
platforms {darwin >= 19}
# MacPorts does not support i386 on macOS Mojave and new WoW64 requires macOS Catalina 10.15.4
platforms {darwin > 15 != 18}
set branch [lindex [split ${version} .] 0].x
license LGPL-2.1+
categories emulators
supported_archs x86_64
supported_archs i386 x86_64
maintainers {@Gcenx gmail.com:gcenx83}
homepage https://www.winehq.org
dist_subdir ${my_name}
Expand Down Expand Up @@ -52,14 +53,19 @@ depends_lib \
port:freetype \
port:gettext-runtime \
path:lib/pkgconfig/gnutls.pc:gnutls \
path:lib/libMoltenVK.dylib:MoltenVK-latest \
port:libpcap \
port:libsdl2

depends_run \
port:mingw-w64-wine-gecko-2.47.4 \
port:mingw-w64-wine-mono-9.3.0

post-extract {
# https://gitlab.winehq.org/wine/wine/-/commit/c7a97b5d5d56ef00a0061b75412c6e0e489fdc99
reinplace -q "/PKG_CONFIG_LIBDIR/d" ${worksrcpath}/configure
reinplace -q "/PKG_CONFIG_LIBDIR/d" ${worksrcpath}/configure.ac
}

patch.pre_args-replace -p0 -p1

patchfiles-append \
Expand All @@ -76,7 +82,6 @@ configure.install \
${worksrcpath}/tools/install-sh

configure.args.x86_64 \
--enable-archs=i386,x86_64 \
--enable-win64

configure.args \
Expand Down Expand Up @@ -112,7 +117,7 @@ configure.args \
--with-unwind \
--without-usb \
--without-v4l2 \
--with-vulkan \
--without-vulkan \
--without-wayland \
--without-x

Expand All @@ -125,10 +130,6 @@ configure.ldflags-append -Wl,-rpath,${compiler.library_path}
# FSF GCC cannot compile code using Apple's "blocks" language extensions
compiler.blacklist-append {*gcc*} {clang < 800} {macports-clang-3.*}

# Setting an older deployment target avoids build error with MacOSX15.sdk
# https://gitlab.winehq.org/wine/wine/-/merge_requests/5935#note_74758
macosx_deployment_target 10.15

if {${subport} eq "wine-devel"} {
patchfiles-append 1001-devel-msync.diff
}
Expand All @@ -150,10 +151,14 @@ subport wine-staging {

depends_patch-append port:autoconf

set py_ver 3.13
set py_ver_nodot [string map {. {}} ${py_ver}]
depends_patch-append port:python${py_ver_nodot}

# Applying staging after other patchfiles to avoid problems
post-patch {
system -W ${worksrcpath} \
"${workpath}/wine-staging-${staging_version}/staging/patchinstall.py --all -W eventfd_synchronization -W ntdll-Syscall_Emulation -W winemac.drv-no-flicker-patch"
"${frameworks_dir}/Python.framework/Versions/${py_ver}/bin/python3 ${workpath}/wine-staging-${staging_version}/staging/patchinstall.py --all -W eventfd_synchronization -W ntdll-Syscall_Emulation -W winemac.drv-no-flicker-patch"
system -W ${worksrcpath} \
"patch -p1 < ${filespath}/1001-staging-msync.diff"
}
Expand Down Expand Up @@ -198,7 +203,48 @@ variant kerberos description "Build ${subport} with Kerberos, for network authen
configure.args-replace --without-krb5 --with-krb5
}

default_variants +ffmpeg +gstreamer
if {${os.major} < 19} {
# Using the 10.13 SDK as that's what CodeWeavers tests against for i386
configure.sdk_version 10.13
if {${configure.sdkroot} eq ""} {
pre-fetch {
error "Building ${subport} @${version} requires the MacOSX10.13.sdk to be present in ${developer_dir}/SDKs/"
}
}

default_variants +universal

if {${universal_possible} && [variant_isset universal]} {
configure.args.i386 --with-wine64=${workpath}/${worksrcdir}-x86_64

notes-append "
\n
Wine supports both 32-bit and 64-bit now. It is compatible with your\
existing 32-bit wine prefix, but it will now default to 64-bit when you\
create a new wine prefix. The architecture can be selected using the\
WINEARCH environment variable which can be set to either \"win32\" or\
\"win64\".
To create a new pure 32-bit prefix, you can run:
\$ WINEARCH=win32 WINEPREFIX=~/.wine32 winecfg
See the Wine FAQ for details: https://wiki.winehq.org/FAQ#Wineprefixes
"
} else {
supported_archs i386
}
}

if {${os.major} > 18} {
depends_lib path:lib/libMoltenVK.dylib:MoltenVK-latest

configure.args.x86_64-append --enable-archs=i386,x86_64
configure.args-replace --without-vulkan --with-vulkan

# Setting an older deployment target avoids build error with MacOSX15.sdk
# https://gitlab.winehq.org/wine/wine/-/merge_requests/5935#note_74758
macosx_deployment_target 10.15

default_variants +ffmpeg +gstreamer
}

triplet.add_build cross
triplet.add_host none
Expand Down
Loading