dev-util/premake: fix modern C issues

Closes: https://bugs.gentoo.org/895842
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2025-01-19 00:16:10 +00:00
parent 5c64ff2c9d
commit 766b0c26c4
2 changed files with 64 additions and 2 deletions

View File

@@ -0,0 +1,59 @@
https://bugs.gentoo.org/895842#c6
diff '--color=auto' -burN premake-core-5.0.0-beta2-orig/contrib/libzip/config.h premake-core-5.0.0-beta2/contrib/libzip/config.h
--- premake-core-5.0.0-beta2-orig/contrib/libzip/config.h 2022-09-02 21:11:21.000000000 +0200
+++ premake-core-5.0.0-beta2/contrib/libzip/config.h 2024-05-17 14:07:31.072971328 +0200
@@ -25,6 +25,7 @@
#endif
/* #undef HAVE_STRINGS_H */
/* #undef HAVE_UNISTD_H */
+#define HAVE_UNISTD_H 1
#define __INT8_LIBZIP 1
#define INT8_T_LIBZIP 1
#define UINT8_T_LIBZIP 1
diff '--color=auto' -burN premake-core-5.0.0-beta2-orig/contrib/libzip/mkstemp.c premake-core-5.0.0-beta2/contrib/libzip/mkstemp.c
--- premake-core-5.0.0-beta2-orig/contrib/libzip/mkstemp.c 2022-09-02 21:11:21.000000000 +0200
+++ premake-core-5.0.0-beta2/contrib/libzip/mkstemp.c 2024-05-17 14:07:31.073971328 +0200
@@ -31,6 +31,8 @@
* SUCH DAMAGE.
*/
+#include "zipint.h"
+
#include <sys/types.h>
#include <sys/stat.h>
@@ -43,13 +45,14 @@
#endif
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#ifndef O_BINARY
#define O_BINARY 0
#endif
-
-
int
_zip_mkstemp(char *path)
{
diff '--color=auto' -burN premake-core-5.0.0-beta2-orig/contrib/libzip/zip_fdopen.c premake-core-5.0.0-beta2/contrib/libzip/zip_fdopen.c
--- premake-core-5.0.0-beta2-orig/contrib/libzip/zip_fdopen.c 2022-09-02 21:11:21.000000000 +0200
+++ premake-core-5.0.0-beta2/contrib/libzip/zip_fdopen.c 2024-05-17 14:06:29.441972020 +0200
@@ -31,11 +31,10 @@
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
-
#include "zipint.h"
-
-
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
ZIP_EXTERN struct zip *
zip_fdopen(int fd_orig, int _flags, int *zep)

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -16,7 +16,10 @@ LICENSE="BSD"
SLOT="5"
KEYWORDS="~amd64 ~arm64 ppc x86"
PATCHES=( "${FILESDIR}/${PN}-5.0.0-remove-hardcoded-libpath.patch" )
PATCHES=(
"${FILESDIR}/${PN}-5.0.0-remove-hardcoded-libpath.patch"
"${FILESDIR}/${PN}-5.0.0-c99.patch"
)
src_compile() {
# bug #773505