mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
app-text/texlive-core: fix build w/ clang 16
wrt -D_GNU_SOURCE: this should be upstreamed but I want to revisit this once we've actually bumped to 2022. Closes: https://bugs.gentoo.org/874546 Closes: https://bugs.gentoo.org/882245 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
172
app-text/texlive-core/files/texlive-core-2021-clang-16.patch
Normal file
172
app-text/texlive-core/files/texlive-core-2021-clang-16.patch
Normal file
@@ -0,0 +1,172 @@
|
||||
https://bugs.gentoo.org/874546
|
||||
https://bugs.gentoo.org/882245
|
||||
|
||||
https://github.com/TeX-Live/texlive-source/commit/3b1470c8911cd4bc9e4a02bfb5cac0f3bebcab3a
|
||||
https://github.com/TeX-Live/texlive-source/commit/60b60503b21ea43c68d1ffbe214141a79a36190b
|
||||
|
||||
From 3b1470c8911cd4bc9e4a02bfb5cac0f3bebcab3a Mon Sep 17 00:00:00 2001
|
||||
From: Karl Berry <karl@freefriends.org>
|
||||
Date: Sat, 5 Nov 2022 15:43:53 +0000
|
||||
Subject: [PATCH] stdlib.h to placate clang16
|
||||
|
||||
git-svn-id: svn://tug.org/texlive/trunk/Build/source@64941 c570f23f-e606-0410-a88d-b1316a301751
|
||||
--- a/texk/dvisvgm/configure
|
||||
+++ b/texk/dvisvgm/configure
|
||||
@@ -23415,6 +23415,7 @@ else $as_nop
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <stdio.h>
|
||||
+ #include <stdlib.h>
|
||||
#include <ghostscript/iapi.h>
|
||||
int main () {
|
||||
gsapi_revision_t r;
|
||||
--- a/texk/dvisvgm/configure.ac
|
||||
+++ b/texk/dvisvgm/configure.ac
|
||||
@@ -94,6 +94,7 @@ else
|
||||
# query Ghostscript version
|
||||
AC_MSG_CHECKING([Ghostscript version])
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([#include <stdio.h>
|
||||
+ #include <stdlib.h>
|
||||
#include <ghostscript/iapi.h>
|
||||
int main () {
|
||||
gsapi_revision_t r;
|
||||
--- a/texk/kpathsea/configure
|
||||
+++ b/texk/kpathsea/configure
|
||||
@@ -14633,7 +14633,8 @@ then :
|
||||
else $as_nop
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
-int fork() { exit(1); }
|
||||
+#include <stdlib.h>
|
||||
+ int fork() { exit(1); }
|
||||
int vfork() { exit(1); }
|
||||
extern char *getcwd();
|
||||
char path[100];
|
||||
--- a/texk/kpathsea/configure.ac
|
||||
+++ b/texk/kpathsea/configure.ac
|
||||
@@ -45,7 +45,8 @@ if test "x$ac_cv_func_getcwd" = xyes; then
|
||||
# We only need to run this if we have getcwd.
|
||||
AC_CACHE_CHECK([whether getcwd uses fork or vfork],
|
||||
[kb_cv_func_getcwd_forks],
|
||||
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[int fork() { exit(1); }
|
||||
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
|
||||
+ int fork() { exit(1); }
|
||||
int vfork() { exit(1); }
|
||||
extern char *getcwd();
|
||||
char path[100];]],
|
||||
|
||||
From 60b60503b21ea43c68d1ffbe214141a79a36190b Mon Sep 17 00:00:00 2001
|
||||
From: Karl Berry <karl@freefriends.org>
|
||||
Date: Sun, 6 Nov 2022 22:15:26 +0000
|
||||
Subject: [PATCH] void main, void args, more clang16 from sam
|
||||
|
||||
git-svn-id: svn://tug.org/texlive/trunk/Build/source@64953 c570f23f-e606-0410-a88d-b1316a301751
|
||||
--- /dev/null
|
||||
+++ b/libs/freetype2/TLpatches/patch-04-void-main
|
||||
@@ -0,0 +1,13 @@
|
||||
+diff --git a/libs/freetype2/freetype-src/builds/unix/freetype2.m4 b/libs/freetype2/freetype-src/builds/unix/freetype2.m4
|
||||
+index 0cafc8e8c..51843f5fa 100644
|
||||
+--- a/libs/freetype2/freetype-src/builds/unix/freetype2.m4
|
||||
++++ b/libs/freetype2/freetype-src/builds/unix/freetype2.m4
|
||||
+@@ -121,7 +121,7 @@ AC_DEFUN([AC_CHECK_FT2],
|
||||
+ #include <stdlib.h>
|
||||
+
|
||||
+ int
|
||||
+-main()
|
||||
++main(void)
|
||||
+ {
|
||||
+ FT_Library library;
|
||||
+ FT_Error error;
|
||||
--- a/libs/freetype2/freetype-src/builds/unix/freetype2.m4
|
||||
+++ b/libs/freetype2/freetype-src/builds/unix/freetype2.m4
|
||||
@@ -121,7 +121,7 @@ AC_DEFUN([AC_CHECK_FT2],
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
-main()
|
||||
+main(void)
|
||||
{
|
||||
FT_Library library;
|
||||
FT_Error error;
|
||||
--- /dev/null
|
||||
+++ b/libs/gd/TLpatches/patch-03-void-main
|
||||
@@ -0,0 +1,13 @@
|
||||
+diff --git a/libs/gd/libgd-src/tests/xpm/bug00185.c b/libs/gd/libgd-src/tests/xpm/bug00185.c
|
||||
+index 3056ed950..37659d6a4 100644
|
||||
+--- a/libs/gd/libgd-src/tests/xpm/bug00185.c
|
||||
++++ b/libs/gd/libgd-src/tests/xpm/bug00185.c
|
||||
+@@ -5,7 +5,7 @@
|
||||
+
|
||||
+ /* To check memory leaks, run such as 'valgrind --leak-check=full ./bug00185' */
|
||||
+ int
|
||||
+-main()
|
||||
++main(void)
|
||||
+ {
|
||||
+ gdImagePtr im;
|
||||
+ char *path;
|
||||
--- a/libs/gd/libgd-src/tests/xpm/bug00185.c
|
||||
+++ b/libs/gd/libgd-src/tests/xpm/bug00185.c
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
/* To check memory leaks, run such as 'valgrind --leak-check=full ./bug00185' */
|
||||
int
|
||||
-main()
|
||||
+main(void)
|
||||
{
|
||||
gdImagePtr im;
|
||||
char *path;
|
||||
--- a/texk/ps2pk/basename.c
|
||||
+++ b/texk/ps2pk/basename.c
|
||||
@@ -6,11 +6,12 @@
|
||||
* AUTHOR: Piet Tutelaers
|
||||
* VERSION: 1.0 (Sept. 1995)
|
||||
*/
|
||||
+#include <stdlib.h> /* exit() */
|
||||
#include <stdio.h> /* printf() */
|
||||
#include "basics.h" /* fatal() */
|
||||
#include "filenames.h" /* basename() */
|
||||
|
||||
-main(int argc, char **argv)
|
||||
+int main(int argc, char **argv)
|
||||
{
|
||||
if (argc < 2 || argc > 3)
|
||||
fatal("Usage: basename string [suffix]\n");
|
||||
--- a/utils/m-tx/mtx-src/prepmx.c
|
||||
+++ b/utils/m-tx/mtx-src/prepmx.c
|
||||
@@ -769,7 +769,7 @@ Static void topOfPMXfile(void)
|
||||
}
|
||||
|
||||
|
||||
-main(int argc, Char *argv[])
|
||||
+int main(int argc, Char *argv[])
|
||||
{ /* ---- Main program ------------------------ */
|
||||
PASCAL_MAIN(argc, argv);
|
||||
strcpy(this_version, version);
|
||||
--- /dev/null
|
||||
+++ b/utils/pmx/TLpatches/patch-01-main-ret
|
||||
@@ -0,0 +1,13 @@
|
||||
+diff --git a/utils/pmx/pmx-src/libf2c/main.c b/utils/pmx/pmx-src/libf2c/main.c
|
||||
+index 453974904..f485a0cd0 100644
|
||||
+--- a/utils/pmx/pmx-src/libf2c/main.c
|
||||
++++ b/utils/pmx/pmx-src/libf2c/main.c
|
||||
+@@ -106,7 +106,7 @@ char **xargv;
|
||||
+ #ifdef KR_headers
|
||||
+ main(argc, argv) int argc; char **argv;
|
||||
+ #else
|
||||
+-main(int argc, char **argv)
|
||||
++int main(int argc, char **argv)
|
||||
+ #endif
|
||||
+ {
|
||||
+ xargc = argc;
|
||||
--- a/utils/pmx/pmx-src/libf2c/main.c
|
||||
+++ b/utils/pmx/pmx-src/libf2c/main.c
|
||||
@@ -106,7 +106,7 @@ char **xargv;
|
||||
#ifdef KR_headers
|
||||
main(argc, argv) int argc; char **argv;
|
||||
#else
|
||||
-main(int argc, char **argv)
|
||||
+int main(int argc, char **argv)
|
||||
#endif
|
||||
{
|
||||
xargc = argc;
|
||||
|
||||
@@ -166,6 +166,7 @@ src_prepare() {
|
||||
eapply "${WORKDIR}"/patches
|
||||
eapply "${FILESDIR}"/${P}-cairo-strings.patch
|
||||
eapply "${FILESDIR}"/${P}-slibtool.patch
|
||||
eapply "${FILESDIR}"/${P}-clang-16.patch
|
||||
|
||||
default
|
||||
|
||||
@@ -188,6 +189,9 @@ src_configure() {
|
||||
# Also only pkg-config works for prefix as described in bug #690094
|
||||
export ac_cv_prog_ac_ct_FT2_CONFIG=no
|
||||
|
||||
# revisit/upstream once we bupm to 2022, bug #882245
|
||||
append-cppflags -D_GNU_SOURCE
|
||||
|
||||
tc-export CC CXX AR RANLIB
|
||||
ECONF_SOURCE="${B}" \
|
||||
econf -C \
|
||||
Reference in New Issue
Block a user