Skip to content

Commit

Permalink
wine-cachyos-opt: version 9.0-20241115, build with clang/llvm
Browse files Browse the repository at this point in the history
  • Loading branch information
loathingKernel authored and ptr1337 committed Nov 17, 2024
1 parent 79e6819 commit 5e7753f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1,163 deletions.
18 changes: 10 additions & 8 deletions wine-cachyos-opt/.SRCINFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgbase = wine-cachyos-opt
pkgdesc = A compatibility layer for running Windows programs, with extra CachyOS flavor (installs under /opt)
pkgver = 9.0.20241031
pkgver = 9.0.20241115
pkgrel = 1
epoch = 2
url = https://github.com/CachyOS/wine-cachyos
Expand All @@ -12,8 +12,12 @@ pkgbase = wine-cachyos-opt
makedepends = bison
makedepends = perl
makedepends = flex
makedepends = mingw-w64-gcc
makedepends = clang
makedepends = lld
makedepends = git
makedepends = python
makedepends = llvm
makedepends = lib32-llvm
makedepends = giflib
makedepends = lib32-giflib
makedepends = gnutls
Expand Down Expand Up @@ -72,8 +76,8 @@ pkgbase = wine-cachyos-opt
depends = lib32-gettext
depends = freetype2
depends = lib32-freetype2
depends = gcc-libs
depends = lib32-gcc-libs
depends = llvm-libs
depends = lib32-llvm-libs
depends = libpcap
depends = lib32-libpcap
depends = desktop-file-utils
Expand Down Expand Up @@ -121,15 +125,13 @@ pkgbase = wine-cachyos-opt
options = !staticlibs
options = !lto
options = !debug
source = wine-cachyos::git+https://github.com/CachyOS/wine-cachyos.git#tag=cachyos-9.0-20241031-wine
source = wine-cachyos::git+https://github.com/CachyOS/wine-cachyos.git#tag=cachyos-9.0-20241115-wine
source = 30-win32-aliases.conf
source = wine-binfmt.conf
source = wine-optical-flow.patch
validpgpkeys = 5AC1A08B03BD7A313E0A955AF5E6E9EEB9461DD7
validpgpkeys = DA23579A74D4AD9AF9D3F945CEFAC8EAAF17519D
b2sums = 07db0f26144e00738fbbdeff3a96c303a62c706fa56d346d8c4b5a4956697fb9a05f7a91ae1235bdb922a8ec89ebf85479e7fdc5a99a19a02ea7bde4f5416d66
b2sums = a60f80f5ebc8ac7e855b18f6f4614d3b080bee06eaaedda4a3ff83d485197d79f0fe0a1847992b0e44b13eafdf991e2fccf719c065f32298e1e60f261dbb722d
b2sums = 45db34fb35a679dc191b4119603eba37b8008326bd4f7d6bd422fbbb2a74b675bdbc9f0cc6995ed0c564cf088b7ecd9fbe2d06d42ff8a4464828f3c4f188075b
b2sums = e9de76a32493c601ab32bde28a2c8f8aded12978057159dd9bf35eefbf82f2389a4d5e30170218956101331cf3e7452ae82ad0db6aad623651b0cc2174a61588
b2sums = 3c4516dd44c8bbec45fc30e75c45e3a87ca6d0275f22e1ba8a9b9a423768ea789166140519cceae3c8e24476d1d9acab5439075b073c3422c4fead4fa7a18b88

pkgname = wine-cachyos-opt
54 changes: 25 additions & 29 deletions wine-cachyos-opt/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Contributor: Giovanni Scafora <[email protected]>

pkgname=wine-cachyos-opt
_srctag=9.0-20241031
_srctag=9.0-20241115
pkgver=${_srctag//-/.}
pkgrel=1
epoch=2
Expand All @@ -19,7 +19,6 @@ source=(wine-cachyos::git+https://github.com/CachyOS/wine-cachyos.git#tag=cachyo
30-win32-aliases.conf
wine-binfmt.conf)
source+=(
wine-optical-flow.patch
)
validpgpkeys=(5AC1A08B03BD7A313E0A955AF5E6E9EEB9461DD7
DA23579A74D4AD9AF9D3F945CEFAC8EAAF17519D)
Expand All @@ -38,7 +37,7 @@ depends=(
libxi lib32-libxi
gettext lib32-gettext
freetype2 lib32-freetype2
gcc-libs lib32-gcc-libs
llvm-libs lib32-llvm-libs
libpcap lib32-libpcap
desktop-file-utils
)
Expand All @@ -47,8 +46,10 @@ depends+=(
wayland lib32-wayland
)

makedepends=(autoconf bison perl flex mingw-w64-gcc
makedepends=(autoconf bison perl flex clang lld
git
python
llvm lib32-llvm
giflib lib32-giflib
gnutls lib32-gnutls
libxinerama lib32-libxinerama
Expand Down Expand Up @@ -113,7 +114,6 @@ prepare() {
git config user.email "[email protected]"
git config user.name "wine cachyos"
git tag wine-9.0 --annotate -m "$pkgver" --force
patch -Np1 -i "$srcdir"/wine-optical-flow.patch
./dlls/winevulkan/make_vulkan -x vk.xml
./tools/make_specfiles
./tools/make_requests
Expand All @@ -122,35 +122,32 @@ prepare() {
}

build() {
# Doesn't compile without remove these flags as of 4.10
export CFLAGS="$CFLAGS -ffat-lto-objects"
export CC="clang"
export CXX="clang++"

local -a split=($CFLAGS)
local -A flags
for opt in "${split[@]}"; do flags["${opt%%=*}"]="${opt##*=}"; done
local march="${flags["-march"]:-nocona}"
local mtune="generic" #"${flags["-mtune"]:-core-avx2}"
local mtune="${flags["-mtune"]:-core-avx2}"

# From Proton
OPTIMIZE_FLAGS="-O3 -march=$march -mtune=$mtune -mfpmath=sse -pipe -fno-semantic-interposition"
SANITY_FLAGS="-fwrapv -fno-strict-aliasing"
WARNING_FLAGS="-Wno-incompatible-pointer-types"
COMMON_FLAGS="$OPTIMIZE_FLAGS $SANITY_FLAGS $WARNING_FLAGS -s"

COMMON_LDFLAGS="-Wl,-O1,--sort-common,--as-needed"
LTO_FLAGS="-fuse-linker-plugin -fdevirtualize-at-ltrans -flto-partition=one -flto -Wl,-flto"
COMMON_FLAGS="$OPTIMIZE_FLAGS $SANITY_FLAGS $WARNING_FLAGS"

export LDFLAGS="$COMMON_LDFLAGS $LTO_FLAGS"
export CROSSLDFLAGS="$COMMON_LDFLAGS -Wl,--file-alignment,4096"
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed"
export CROSSLDFLAGS="-Wl,/FILEALIGN:4096,/OPT:REF,/OPT:ICF"

cd "$srcdir"

msg2 "Building Wine-64..."

export CFLAGS="$COMMON_FLAGS -mcmodel=small $LTO_FLAGS"
export CXXFLAGS="$COMMON_FLAGS -mcmodel=small -std=c++17 $LTO_FLAGS"
export CROSSCFLAGS="$COMMON_FLAGS -mcmodel=small"
export CROSSCXXFLAGS="$COMMON_FLAGS -mcmodel=small -std=c++17"
export CFLAGS="$COMMON_FLAGS -mcmodel=small"
export CXXFLAGS="$COMMON_FLAGS -mcmodel=small -std=c++17"
export CROSSCFLAGS="$CFLAGS"
export CROSSCXXFLAGS="$CXXFLAGS"
export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig"
cd "$srcdir/${pkgname//-opt}-64-build"
../${pkgname//-opt}/configure \
Expand All @@ -159,7 +156,7 @@ build() {
--with-x \
--with-wayland \
--with-gstreamer \
--with-mingw \
--with-mingw=clang \
--with-alsa \
--without-oss \
--disable-winemenubuilder \
Expand All @@ -172,18 +169,18 @@ build() {
msg2 "Building Wine-32..."

# Disable AVX instead of using 02, for 32bit
export CFLAGS="$COMMON_FLAGS -mstackrealign -mno-avx $LTO_FLAGS"
export CXXFLAGS="$COMMON_FLAGS -mstackrealign -mno-avx -std=c++17 $LTO_FLAGS"
export CROSSCFLAGS="$COMMON_FLAGS -mstackrealign -mno-avx"
export CROSSCXXFLAGS="$COMMON_FLAGS -mstackrealign -mno-avx -std=c++17"
export CFLAGS="$COMMON_FLAGS -mstackrealign"
export CXXFLAGS="$COMMON_FLAGS -mstackrealign -std=c++17"
export CROSSCFLAGS="$CFLAGS"
export CROSSCXXFLAGS="$CXXFLAGS"
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig:/usr/share/pkgconfig"
cd "$srcdir/${pkgname//-opt}-32-build"
../${pkgname//-opt}/configure \
--prefix=/opt/"${pkgname//-opt}" \
--with-x \
--with-wayland \
--with-gstreamer \
--with-mingw \
--with-mingw=clang \
--with-alsa \
--without-oss \
--disable-winemenubuilder \
Expand All @@ -210,15 +207,14 @@ package() {
dlldir="$pkgdir/opt/${pkgname//-opt}/lib/wine" install


i686-w64-mingw32-strip --strip-unneeded "$pkgdir"/opt/"${pkgname//-opt}"/lib32/wine/i386-windows/*.{dll,exe}
x86_64-w64-mingw32-strip --strip-unneeded "$pkgdir"/opt/"${pkgname//-opt}"/lib/wine/x86_64-windows/*.{dll,exe}
llvm-strip --strip-unneeded "$pkgdir"/opt/"${pkgname//-opt}"/lib32/wine/i386-windows/*.{dll,exe}
llvm-strip --strip-unneeded "$pkgdir"/opt/"${pkgname//-opt}"/lib/wine/x86_64-windows/*.{dll,exe}

find "$pkgdir"/opt/"${pkgname//-opt}"/lib{,32}/wine -iname "*.a" -delete
find "$pkgdir"/opt/"${pkgname//-opt}"/lib{,32}/wine -iname "*.def" -delete
}

# vim:set ts=8 sts=2 sw=2 et:
b2sums=('07db0f26144e00738fbbdeff3a96c303a62c706fa56d346d8c4b5a4956697fb9a05f7a91ae1235bdb922a8ec89ebf85479e7fdc5a99a19a02ea7bde4f5416d66'
b2sums=('a60f80f5ebc8ac7e855b18f6f4614d3b080bee06eaaedda4a3ff83d485197d79f0fe0a1847992b0e44b13eafdf991e2fccf719c065f32298e1e60f261dbb722d'
'45db34fb35a679dc191b4119603eba37b8008326bd4f7d6bd422fbbb2a74b675bdbc9f0cc6995ed0c564cf088b7ecd9fbe2d06d42ff8a4464828f3c4f188075b'
'e9de76a32493c601ab32bde28a2c8f8aded12978057159dd9bf35eefbf82f2389a4d5e30170218956101331cf3e7452ae82ad0db6aad623651b0cc2174a61588'
'3c4516dd44c8bbec45fc30e75c45e3a87ca6d0275f22e1ba8a9b9a423768ea789166140519cceae3c8e24476d1d9acab5439075b073c3422c4fead4fa7a18b88')
'e9de76a32493c601ab32bde28a2c8f8aded12978057159dd9bf35eefbf82f2389a4d5e30170218956101331cf3e7452ae82ad0db6aad623651b0cc2174a61588')
Loading

0 comments on commit 5e7753f

Please sign in to comment.