From ed232e967f30178285d4bae5219865b7ddeddebd Mon Sep 17 00:00:00 2001 From: Oscar Fuentes Date: Tue, 31 May 2022 19:18:13 +0200 Subject: [PATCH 1/3] emacs: update PKGBUILD --- mingw-w64-emacs-git/PKGBUILD | 37 +++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/mingw-w64-emacs-git/PKGBUILD b/mingw-w64-emacs-git/PKGBUILD index 317a973f9..e33435fb5 100644 --- a/mingw-w64-emacs-git/PKGBUILD +++ b/mingw-w64-emacs-git/PKGBUILD @@ -1,38 +1,40 @@ # Maintainer: Haroogan # Maintainer: Oscar Fuentes +_enable_jit=$([[ "${MSYSTEM}" =~ MINGW.* ]] && echo yes) _realname='emacs' pkgbase=mingw-w64-${_realname}-git pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-git" -pkgver=r136512.b7730c259b +pkgver=r156906.8ebfcff3a6 pkgrel=1 pkgdesc="The extensible, customizable, self-documenting, real-time display editor (mingw-w64)" url="https://www.gnu.org/software/${_realname}/" license=('GPL3') arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64') provides=("${MINGW_PACKAGE_PREFIX}-${_realname}") conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}") depends=("${MINGW_PACKAGE_PREFIX}-universal-ctags-git" - "${MINGW_PACKAGE_PREFIX}-xpm-nox" - "${MINGW_PACKAGE_PREFIX}-gnutls" + $([[ "$_enable_jit" == "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-libgccjit") "${MINGW_PACKAGE_PREFIX}-zlib" + "${MINGW_PACKAGE_PREFIX}-xpm-nox" + "${MINGW_PACKAGE_PREFIX}-freetype" "${MINGW_PACKAGE_PREFIX}-harfbuzz" - "${MINGW_PACKAGE_PREFIX}-winpthreads") + "${MINGW_PACKAGE_PREFIX}-jansson" + "${MINGW_PACKAGE_PREFIX}-gnutls" + "${MINGW_PACKAGE_PREFIX}-libwinpthread") optdepends=("${MINGW_PACKAGE_PREFIX}-giflib" - "${MINGW_PACKAGE_PREFIX}-imagemagick" "${MINGW_PACKAGE_PREFIX}-libjpeg-turbo" "${MINGW_PACKAGE_PREFIX}-libpng" "${MINGW_PACKAGE_PREFIX}-librsvg" "${MINGW_PACKAGE_PREFIX}-libtiff" "${MINGW_PACKAGE_PREFIX}-libxml2") -makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" - "${MINGW_PACKAGE_PREFIX}-pkg-config" - "make" - "autoconf" - "texinfo" +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-autotools" + "texinfo" "patch" - "git" - "${optdepends[@]}") + "git" + "${optdepends[@]}") # Don't zip info files because the built-in info reader uses gzip to # decompress them. gzip is not available as a mingw binary. options=('strip' '!zipman') @@ -54,15 +56,20 @@ build() { mkdir -p "${srcdir}/build-${MINGW_CHOST}" cd "build-${MINGW_CHOST}" + _extra_cfg="" + if [[ "$_enable_jit" == "yes" ]] ; then + _extra_cfg="$_extra_cfg --with-native-compilation" + fi "${srcdir}/${_realname}/configure" \ --prefix="${MINGW_PREFIX}" \ --build="${MINGW_CHOST}" \ - --without-dbus \ --with-modules \ - --without-compress-install + --without-dbus \ + --without-compress-install \ + $_extra_cfg # --without-compress-install is needed because we don't have gzip in - # the mingw binaries. + # the mingw binaries and it is also required by native compilation. make } From b8db0fdbe4b9065b75f1c83d00937d606234a09c Mon Sep 17 00:00:00 2001 From: Oscar Fuentes Date: Tue, 31 May 2022 19:21:10 +0200 Subject: [PATCH 2/3] emacs: removed obsolete patches --- mingw-w64-emacs-git/image.c.diff | 11 ----------- mingw-w64-emacs-git/lread.c.diff | 15 --------------- 2 files changed, 26 deletions(-) delete mode 100644 mingw-w64-emacs-git/image.c.diff delete mode 100644 mingw-w64-emacs-git/lread.c.diff diff --git a/mingw-w64-emacs-git/image.c.diff b/mingw-w64-emacs-git/image.c.diff deleted file mode 100644 index 6a0d33dd1..000000000 --- a/mingw-w64-emacs-git/image.c.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- src/image.c.orig 2014-10-15 14:18:29.088716000 +0200 -+++ src/image.c 2014-10-15 15:54:12.407522800 +0200 -@@ -7862,7 +7862,7 @@ - }; - - #if defined HAVE_NTGUI && defined WINDOWSNT --static bool init_imagemagick_functions (void); -+#define init_imagemagick_functions NULL - #else - #define init_imagemagick_functions NULL - #endif diff --git a/mingw-w64-emacs-git/lread.c.diff b/mingw-w64-emacs-git/lread.c.diff deleted file mode 100644 index 8eab5a598..000000000 --- a/mingw-w64-emacs-git/lread.c.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- src/lread.c.orig 2014-11-04 20:29:22.129549000 +0100 -+++ src/lread.c 2014-11-04 22:33:07.346414100 +0100 -@@ -4351,6 +4351,12 @@ - } /* Vinstallation_directory != Vsource_directory */ - - } /* if Vinstallation_directory */ -+ else -+ { -+ Vsource_directory -+ = Fexpand_file_name (build_string ("../"), -+ Fcar (decode_env_path (0, PATH_DATA, 0))); -+ } - } - else /* !initialized */ - { From d731611037430988f83dd72ee64ef35193208d45 Mon Sep 17 00:00:00 2001 From: Oscar Fuentes Date: Sun, 3 Mar 2024 00:20:14 +0100 Subject: [PATCH 3/3] emacs: quita -D_FORTIFY_SOURCE, usa -fno-optimize-sibling-calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sin esto el binario no funciona correctamente. Específicamente, sin -D_FORTIFY_SOURCE se producen fallos en las llamadas a procesos. --- mingw-w64-emacs-git/PKGBUILD | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mingw-w64-emacs-git/PKGBUILD b/mingw-w64-emacs-git/PKGBUILD index e33435fb5..52d49f461 100644 --- a/mingw-w64-emacs-git/PKGBUILD +++ b/mingw-w64-emacs-git/PKGBUILD @@ -60,6 +60,12 @@ build() { if [[ "$_enable_jit" == "yes" ]] ; then _extra_cfg="$_extra_cfg --with-native-compilation" fi + + # -D_FORTIFY_SOURCE breaks build + CFLAGS=${CFLAGS//"-Wp,-D_FORTIFY_SOURCE=2"} + # -foptimize-sibling-calls breaks native compilation (GCC 13.1) + CFLAGS+=" -fno-optimize-sibling-calls" + "${srcdir}/${_realname}/configure" \ --prefix="${MINGW_PREFIX}" \ --build="${MINGW_CHOST}" \