Topic: PHP 8.0.17 - Error building from source

Hi,
I am using Remo's spec-file to build the RPMS from source, but I am having the following error with GD - even after installing Remi's latest GD and GD-devel libs (2.3.3):

In file included from /root/rpmbuild/BUILD/php-8.0.17/main/php.h:439,
                 from /root/rpmbuild/BUILD/php-8.0.17/ext/gd/gd.c:28:
/root/rpmbuild/BUILD/php-8.0.17/ext/gd/gd.c: In function 'zm_startup_gd':
/root/rpmbuild/BUILD/php-8.0.17/ext/gd/gd.c:353:48: error: 'GD_FLIP_HORIZONTAL' undeclared (first use in this function); did you mean 'GD_AFFINE_SHEAR_HORIZONTAL'?
  REGISTER_LONG_CONSTANT("IMG_FLIP_HORIZONTAL", GD_FLIP_HORIZONTAL, CONST_CS | CONST_PERSISTENT);
                                                ^~~~~~~~~~~~~~~~~~
/root/rpmbuild/BUILD/php-8.0.17/Zend/zend_constants.h:50:105: note: in definition of macro 'REGISTER_LONG_CONSTANT'
 #define REGISTER_LONG_CONSTANT(name, lval, flags)  zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)

Any hints on how to fix? I've seen that this has been a problem for those compiling php from source, but strangely enough, I manage to compile php 8.0.17 on the same machine, and I don't get this error - I just get it when running rpmpuild -ba with php80.spec.

Re: PHP 8.0.17 - Error building from source

Don't know what you are trying to achieve (distro, version, arch, goal...)
And why (isn't more simple to use my repo ?)

BTW, gd 2.3.3 is broken and cannot be used for PHP without some patches

Desktop: Fedora 35 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 34 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP 8.0.17 - Error building from source

Hi Remi, and thanks for your reply!
I am trying to build the RPM's in house (yes, it would be simpler to use your repo, but unfortunately I have to build these in house).

I am using a RHEL 8.5, x64. I download the tree with the specs, and installed all the dependencies. When I run rpmbuild, I get that error.

Do you know how I can work around that error, or which patch I should use? Should I try another gd version - any that you'd recommend? I saw on the spec file that it probably should use the system package, but it is using the bundled one, right?
Best,
Francis

Re: PHP 8.0.17 - Error building from source

> When I run rpmbuild, I get that error.

worst way to build RPM.... use mock instead

> but unfortunately I have to build these in house

Sadly... such a waste of energy

My build use gd3php, so you need gd3php-devel

> I saw on the spec file that it probably should use the system package, but it is using the bundled one, right?

No, it uses the system library.

Desktop: Fedora 35 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 34 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP 8.0.17 - Error building from source

BTW, on EL-8 you must build "modules", not RPM wink
Else installation will be a nightmare

Desktop: Fedora 35 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 34 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP 8.0.17 - Error building from source

Remi wrote:

> When I run rpmbuild, I get that error.

worst way to build RPM.... use mock instead

Sadly... such a waste of energy

My build use gd3php, so you need gd3php-devel

> I saw on the spec file that it probably should use the system package, but it is using the bundled one, right?

No, it uses the system library.

I am using gd3php, but do I have to specify anything specific? I was using "rpmbuild -ba php80.spec", but somehow I keep having that error, even having gd3php-devel.
I will check mock.
I will check also the modules option.
Do you have a small recipe on how to build it based on your spec file?

Re: PHP 8.0.17 - Error building from source

> Do you have a small recipe on how to build it based on your spec file?

Sorry, no.

My goal is to provide binary RPMs.


P.S. sometime I may help new packager, but this is limited on my rare spare time.

Desktop: Fedora 35 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 34 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP 8.0.17 - Error building from source

Remi wrote:

> Do you have a small recipe on how to build it based on your spec file?

Sorry, no.

My goal is to provide binary RPMs.


P.S. sometime I may help new packager, but this is limited on my rare spare time.

Ok, thanks anyway for the pointers. I will try a bit more to see if I manage this to get built.