Skip to content

Commit d1353aa

Browse files
committed
emacs: Fix building with newer versions of mingw64-w64 headers
Also download tarball from mirror server.
1 parent e748cbc commit d1353aa

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

mingw-w64-emacs/005-lseek.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- emacs-30.2/nt/inc/ms-w32.h.orig 2025-01-04 12:05:30.000000000 +0100
2+
+++ emacs-30.2/nt/inc/ms-w32.h 2025-12-10 10:31:12.089835100 +0100
3+
@@ -328,8 +328,8 @@
4+
#endif
5+
#define isatty _isatty
6+
#define _longjmp longjmp
7+
-/* MinGW64 defines lseek to invoke lseek64. */
8+
-#ifndef lseek
9+
+/* MinGW64 declares lseek to invoke lseek64. */
10+
+#ifdef _MSC_VER
11+
#define lseek _lseek
12+
#endif
13+
#define popen _popen

mingw-w64-emacs/PKGBUILD

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ _realname=emacs
88
pkgbase=mingw-w64-${_realname}
99
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
1010
pkgver=30.2
11-
pkgrel=5
11+
pkgrel=6
1212
pkgdesc="The extensible, customizable, self-documenting, real-time display editor (mingw-w64)"
1313
arch=('any')
1414
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
@@ -42,11 +42,12 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
4242
# Don't zip info files because the built-in info reader uses gzip to
4343
# decompress them. gzip is not available as a mingw binary.
4444
options=('!zipman')
45-
source=("https://ftp.gnu.org/gnu/${_realname}/${_realname}-${pkgver}.tar.xz"{,.sig}
45+
source=("https://ftpmirror.gnu.org/gnu/${_realname}/${_realname}-${pkgver}.tar.xz"{,.sig}
4646
"001-ucrt.patch"
4747
"002-clang-fixes.patch"
4848
"003-aarch64-fixes.patch"
4949
"004-dll-versions.patch"
50+
"005-lseek.patch"
5051
"emacs-ARM64.manifest")
5152
# source=("https://alpha.gnu.org/gnu/${_realname}/pretest/${_realname}-${pkgver}.tar.xz"{,.sig})
5253
sha256sums=('b3f36f18a6dd2715713370166257de2fae01f9d38cfe878ced9b1e6ded5befd9'
@@ -55,21 +56,32 @@ sha256sums=('b3f36f18a6dd2715713370166257de2fae01f9d38cfe878ced9b1e6ded5befd9'
5556
'd8732584a8f3bfd0badbd16d15384b7098e25c5df48632beb02d35f6050c358b'
5657
'd128982d87af1e524ae809147613168153f0e5c1efb0ef633793df47b762c9e1'
5758
'1fcba307b278a7794ecca4f09e7ce1a715b4ee255badd3fa376ca1ef1aa7246f'
59+
'b91e8a63f6afef93fad119f5b4b5bca132bb7f5564df6f26d085dcfa9e28c64c'
5860
'bfe64602dbeeec85799c1156ca4f3837fdac42a076e83a4221768db3417220e1')
5961
validpgpkeys=('28D3BED851FDF3AB57FEF93C233587A47C207910'
6062
'17E90D521672C04631B1183EE78DAE0F3115E06B'
6163
'E6C9029C363AD41D787A8EBB91C1262F01EB8D39'
6264
'CEA1DE21AB108493CC9C65742E82323B8F4353EE')
6365

66+
apply_patch_with_msg() {
67+
for _patch in "$@"
68+
do
69+
msg2 "Applying $_patch"
70+
patch -Np1 -i "${srcdir}/$_patch"
71+
done
72+
}
73+
6474
prepare() {
6575
cp "${srcdir}/emacs-ARM64.manifest" "${_realname}-${pkgver}/nt"
6676

6777
cd "${_realname}-${pkgver}"
6878

69-
patch -Np1 -i "${srcdir}/001-ucrt.patch"
70-
patch -Np1 -i "${srcdir}/002-clang-fixes.patch"
71-
patch -Np1 -i "${srcdir}/003-aarch64-fixes.patch"
72-
patch -Np1 -i "${srcdir}/004-dll-versions.patch"
79+
apply_patch_with_msg \
80+
001-ucrt.patch \
81+
002-clang-fixes.patch \
82+
003-aarch64-fixes.patch \
83+
004-dll-versions.patch \
84+
005-lseek.patch
7385

7486
# Fail if 004-dll-versions.patch needs to be updated
7587
_dllname_xml=$(dlltool --identify "${MINGW_PREFIX}/lib/libxml2.dll.a")

0 commit comments

Comments
 (0)