From d494fdb90a960226709d2babb36daac6e48abc39 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 5 Mar 2021 13:40:44 +0100 Subject: [PATCH] add trivial patch to fix build with PHP 8 --- libguestfs-php8.patch | 20 ++++++++++++++++++++ libguestfs.spec | 4 ++++ 2 files changed, 24 insertions(+) create mode 100644 libguestfs-php8.patch diff --git a/libguestfs-php8.patch b/libguestfs-php8.patch new file mode 100644 index 0000000..5fbd871 --- /dev/null +++ b/libguestfs-php8.patch @@ -0,0 +1,20 @@ +diff -up ./generator/php.ml.php8 ./generator/php.ml +--- ./generator/php.ml.php8 2021-03-05 12:58:48.985383761 +0100 ++++ ./generator/php.ml 2021-03-05 13:00:10.731000947 +0100 +@@ -98,9 +98,15 @@ and generate_php_c () = + + static int res_guestfs_h; + ++/* removed from PHP 8 */ ++#ifndef TSRMLS_CC ++#define TSRMLS_DC ++#define TSRMLS_CC ++#endif ++ + #if ZEND_MODULE_API_NO >= 20151012 + # define GUESTFS_RETURN_STRING(x, duplicate) \\ +- do { if (duplicate) RETURN_STRING(x) else { RETVAL_STRING(x); efree ((char *)x); return; } } while (0) ++ do { if (duplicate) { RETURN_STRING(x); } else { RETVAL_STRING(x); efree ((char *)x); return; } } while (0) + # define guestfs_add_assoc_string(arg, key, str, dup) \\ + add_assoc_string(arg, key, str) + # define guestfs_add_assoc_stringl(arg, key, str, len, dup) \\ diff --git a/libguestfs.spec b/libguestfs.spec index e20c25e..5fd3700 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -86,6 +86,9 @@ Source7: libguestfs.keyring # Maintainer script which helps with handling patches. Source8: copy-patches.sh +# Trivial fix for PHP 8 +Patch0: %{name}-php8.patch + %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool, gettext-devel %endif @@ -1308,6 +1311,7 @@ rm ocaml/html/.gitignore %changelog * Fri Mar 5 2021 Remi Collet - 1:1.45.1-2 - rebuild for https://fedoraproject.org/wiki/Changes/php80 +- add trivial patch to fix build with PHP 8 * Wed Mar 3 2021 Richard W.M. Jones - 1:1.45.1-1 - New upstream version 1.45.1.