Skip to content

Commit 8a25079

Browse files
Merge branch 'cachyos_10.0_20260407/_wine' into cachyos_10.0_20260407/main
2 parents 0b433db + 92e69ad commit 8a25079

41 files changed

Lines changed: 1188 additions & 1995 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.sh

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
Info() {
6+
echo -e '\033[1;34m'"WineBuild:\033[0m $*"
7+
}
8+
9+
Error() {
10+
echo -e '\033[1;31m'"WineBuild:\033[0m $*"
11+
exit 1
12+
}
13+
14+
Info "Starting Wine build process..."
15+
16+
WINE_VERSION="$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^cachyos-//; s/-[^-]*$//' || echo unknown)"
17+
Info "Building Wine version: ${WINE_VERSION}"
18+
BUILD_DIR="/tmp/wine-build"
19+
mkdir -p "${BUILD_DIR}"/{build64,build32,wine-install}
20+
21+
# initialize git for build tools
22+
git config --global --add safe.directory "${PWD}"
23+
git config commit.gpgsign false
24+
git config user.email "wine@build.dev"
25+
git config user.name "winebuild"
26+
27+
Info "Generating build files..."
28+
[ -e dlls/winevulkan/make_vulkan ] && {
29+
chmod +x dlls/winevulkan/make_vulkan
30+
dlls/winevulkan/make_vulkan
31+
}
32+
33+
chmod +x tools/make_requests
34+
tools/make_requests
35+
36+
[ -e tools/make_specfiles ] && {
37+
chmod +x tools/make_specfiles
38+
tools/make_specfiles
39+
}
40+
41+
autoreconf -fiv
42+
43+
# setup reproducible build
44+
export SOURCE_DATE_EPOCH=0
45+
export PKG_CONFIG="pkg-config"
46+
47+
# gcc-mingw setup
48+
export GCC_MINGW_PATH="/usr/local/gcc-mingw"
49+
export PATH="${GCC_MINGW_PATH}/bin:${PATH}"
50+
export LIBRARY_PATH="/usr/lib/gcc-14/lib/gcc/x86_64-linux-gnu/14:/usr/lib/gcc-14/lib/gcc/x86_64-linux-gnu/14/32:/usr/lib/gcc-14/lib:/usr/lib/gcc-14/lib32:/usr/lib:/usr/lib/x86_64-linux-gnu:/usr/local/lib:/usr/local/lib/x86_64-linux-gnu:/usr/local/i386/lib/i386-linux-gnu:/usr/local/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu"
51+
export LD_LIBRARY_PATH="/usr/lib/gcc-14/lib/gcc/x86_64-linux-gnu/14:/usr/lib/gcc-14/lib/gcc/x86_64-linux-gnu/14/32:/usr/lib/gcc-14/lib:/usr/lib/gcc-14/lib32:/usr/lib:/usr/lib/x86_64-linux-gnu:/usr/local/lib:/usr/local/lib/x86_64-linux-gnu:/usr/local/i386/lib/i386-linux-gnu:/usr/local/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu"
52+
53+
# compiler settings
54+
export CC="ccache gcc"
55+
export CXX="ccache g++"
56+
export CROSSCC_X32="ccache i686-w64-mingw32-gcc"
57+
export CROSSCXX_X32="ccache i686-w64-mingw32-g++"
58+
export CROSSCC_X64="ccache x86_64-w64-mingw32-gcc"
59+
export CROSSCXX_X64="ccache x86_64-w64-mingw32-g++"
60+
export x86_64_CC="${CROSSCC_X64}"
61+
export i386_CC="${CROSSCC_X32}"
62+
63+
# compiler flags
64+
_GCC_FLAGS="-march=x86-64 -msse3 -mfpmath=sse -O2 -ftree-vectorize -static-libgcc -Wno-error=incompatible-pointer-types -Wno-error=implicit-function-declaration -Wno-error=int-conversion"
65+
_LD_FLAGS="-Wl,-O1,--sort-common,--as-needed"
66+
67+
export CFLAGS="${_GCC_FLAGS}"
68+
export CXXFLAGS="${_GCC_FLAGS}"
69+
export LDFLAGS="${_LD_FLAGS}"
70+
export CROSSCFLAGS="${_GCC_FLAGS}"
71+
export CROSSCXXFLAGS="${_GCC_FLAGS}"
72+
export CROSSLDFLAGS="${_LD_FLAGS}"
73+
export i386_CFLAGS="${CROSSCFLAGS}"
74+
export x86_64_CFLAGS="${CROSSCFLAGS}"
75+
76+
# configure options
77+
WINE_CONFIGURE_OPTS=(
78+
--prefix="${BUILD_DIR}/wine-install"
79+
--disable-tests
80+
--disable-winemenubuilder
81+
--disable-win16
82+
--with-x
83+
--with-gstreamer
84+
--with-ffmpeg
85+
--with-wayland
86+
--without-oss
87+
--without-coreaudio
88+
--without-cups
89+
--without-sane
90+
--without-gphoto
91+
--without-pcsclite
92+
--without-pcap
93+
--without-capi
94+
--without-v4l2
95+
--without-netapi
96+
--disable-msv1_0
97+
)
98+
99+
## 64-bit
100+
Info "Configuring 64-bit build..."
101+
cd "${BUILD_DIR}/build64"
102+
103+
export PKG_CONFIG_LIBDIR="/usr/local/x86_64/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig"
104+
export PKG_CONFIG_PATH="${PKG_CONFIG_LIBDIR}"
105+
export CROSSCC="${CROSSCC_X64}"
106+
107+
# libunwind support
108+
if [ -f "/usr/local/lib/libunwind.a" ] && [ -f "/usr/local/lib/liblzma.a" ]; then
109+
export UNWIND_CFLAGS=""
110+
export UNWIND_LIBS="-L/usr/local/lib/ -static-libgcc -l:libunwind.a -l:liblzma.a"
111+
fi
112+
113+
"${GITHUB_WORKSPACE}/configure" \
114+
"${WINE_CONFIGURE_OPTS[@]}" \
115+
--libdir="${BUILD_DIR}/wine-install/lib" \
116+
--enable-win64 \
117+
--with-mingw="${x86_64_CC}"
118+
119+
Info "Building 64-bit..."
120+
make -j$(($(nproc) + 1))
121+
122+
unset UNWIND_CFLAGS UNWIND_LIBS
123+
124+
## build 32-bit
125+
Info "Configuring 32-bit build..."
126+
cd "${BUILD_DIR}/build32"
127+
128+
export PKG_CONFIG_LIBDIR="/usr/local/i386/lib/i386-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig"
129+
export PKG_CONFIG_PATH="${PKG_CONFIG_LIBDIR}"
130+
export CROSSCC="${CROSSCC_X32}"
131+
132+
"${GITHUB_WORKSPACE}/configure" \
133+
"${WINE_CONFIGURE_OPTS[@]}" \
134+
--libdir="${BUILD_DIR}/wine-install/lib" \
135+
--with-wine64="${BUILD_DIR}/build64" \
136+
--with-mingw="${i386_CC}"
137+
138+
Info "Building 32-bit..."
139+
make -j$(($(nproc) + 1))
140+
141+
Info "Installing Wine..."
142+
143+
cd "${BUILD_DIR}/build32"
144+
make -j$(($(nproc) + 1)) \
145+
prefix="${BUILD_DIR}/wine-install" \
146+
libdir="${BUILD_DIR}/wine-install/lib" \
147+
dlldir="${BUILD_DIR}/wine-install/lib/wine" \
148+
install-lib
149+
150+
cd "${BUILD_DIR}/build64"
151+
make -j$(($(nproc) + 1)) \
152+
prefix="${BUILD_DIR}/wine-install" \
153+
libdir="${BUILD_DIR}/wine-install/lib" \
154+
dlldir="${BUILD_DIR}/wine-install/lib/wine" \
155+
install-lib
156+
157+
# symlinks
158+
cd "${BUILD_DIR}/wine-install"
159+
ln -srf lib lib64
160+
ln -srf lib lib32
161+
162+
[ ! -f bin/wine64 ] && [ -f bin/wine ] && ln -srf bin/wine{,64}
163+
164+
# strip binaries
165+
Info "Stripping debug symbols..."
166+
find "${BUILD_DIR}/wine-install/lib/" \
167+
-type f '(' -iname '*.a' -o -iname '*.dll' -o -iname '*.so' -o -iname '*.sys' -o -iname '*.drv' -o -iname '*.exe' ')' \
168+
-print0 | xargs -0 strip -s 2>/dev/null || true
169+
170+
# cleanup
171+
rm -rf "${BUILD_DIR}/wine-install"/{include,share/{applications,man}}
172+
173+
Info "Creating archive..."
174+
cd "${BUILD_DIR}"
175+
176+
BUILD_NAME="wine-cachy-${WINE_VERSION}"
177+
mv wine-install "${BUILD_NAME}"
178+
179+
ARCHIVE_NAME="${BUILD_NAME}-1-x86_64.tar.xz"
180+
tar -cJf \
181+
"${ARCHIVE_NAME}" \
182+
--xattrs --numeric-owner --owner=0 --group=0 "${BUILD_NAME}"
183+
184+
# move to workspace
185+
mv "${ARCHIVE_NAME}" "${GITHUB_WORKSPACE}/"
186+
Info "Build completed successfully! Archive: ${ARCHIVE_NAME}"

.github/workflows/builder.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Snapshot
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'cachyos_*_*/main'
8+
- 'cachyos_*_*/dev'
9+
10+
concurrency:
11+
group: ${{ github.ref_name }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
version:
16+
name: Version
17+
runs-on: ubuntu-latest
18+
outputs:
19+
tag_abbrev: ${{ steps.version.outputs.tag_abbrev }}
20+
tag_offset: ${{ steps.version.outputs.tag_offset }}
21+
sha_short: ${{ steps.version.outputs.sha_short }}
22+
full_desc: ${{ steps.version.outputs.full_desc }}
23+
branch: ${{ steps.version.outputs.branch }}
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
fetch-tags: true
30+
31+
- name: Version
32+
id: version
33+
shell: bash
34+
run: |
35+
tag_abbrev=$(git describe --tags --abbrev=0)
36+
echo "tag_abbrev=$tag_abbrev" >> $GITHUB_OUTPUT
37+
echo "tag_offset=$(git rev-list $tag_abbrev..HEAD --count)" >> $GITHUB_OUTPUT
38+
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
39+
echo "full_desc=$(git describe --long --tags)" >> $GITHUB_OUTPUT
40+
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
41+
42+
build:
43+
name: Build
44+
needs: version
45+
runs-on: ubuntu-latest
46+
container:
47+
image: nellokudo/wine-builder:latest
48+
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0
54+
55+
- name: Build
56+
run: |
57+
chmod +x .github/workflows/build.sh
58+
.github/workflows/build.sh
59+
60+
- name: Upload
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: wine-cachyos-${{ needs.version.outputs.full_desc }}
64+
path: '*.tar.xz'
65+
if-no-files-found: error

aclocal.m4

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ dnl
275275
dnl Usage: AC_REQUIRE([WINE_CONFIG_HELPERS])
276276
dnl
277277
AC_DEFUN([WINE_CONFIG_HELPERS],
278-
[AS_VAR_SET([wine_rules],["all:"])
278+
[AS_VAR_SET([wine_rules],["all:
279+
@echo 'Wine build complete.'"])
279280
AC_SUBST(SUBDIRS,"")
280281
AC_SUBST(DISABLED_SUBDIRS,"")
281282
AC_SUBST(CONFIGURE_TARGETS,"")
@@ -302,15 +303,6 @@ wine_fn_config_makefile ()
302303
programs/*,*\ arm64ec\ *) AS_VAR_APPEND([arm64ec_DISABLED_SUBDIRS],[" $[1]"]) ;;
303304
esac ;;
304305
esac
305-
}
306-
307-
wine_fn_config_symlink ()
308-
{
309-
ac_links=$[@]
310-
AS_VAR_APPEND([wine_rules],["
311-
$ac_links:
312-
@./config.status \$[@]"])
313-
for f in $ac_links; do AS_VAR_APPEND([CONFIGURE_TARGETS],[" $f"]); done
314306
}])
315307

316308
dnl **** Define helper function to append a rule to a makefile command list ****
@@ -320,17 +312,6 @@ dnl
320312
AC_DEFUN([WINE_APPEND_RULE],[AC_REQUIRE([WINE_CONFIG_HELPERS])AS_VAR_APPEND([wine_rules],["
321313
$1"])])
322314

323-
dnl **** Create symlinks from config.status ****
324-
dnl
325-
dnl Usage: WINE_CONFIG_SYMLINK(target,src,enable)
326-
dnl
327-
AC_DEFUN([WINE_CONFIG_SYMLINK],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
328-
m4_ifval([$3],[if test $3; then
329-
])AC_CONFIG_LINKS([$1:$2])dnl
330-
wine_fn_config_symlink[ $1]m4_ifval([$3],[
331-
fi])[]dnl
332-
])])
333-
334315
dnl **** Create a makefile from config.status ****
335316
dnl
336317
dnl Usage: WINE_CONFIG_MAKEFILE(file,enable,condition)

0 commit comments

Comments
 (0)