1 (edited by lukaZi 2020-06-24 06:47:51)

Topic: [Solved] Rebuilding php (scl) packages with static GD/imagick

Hello Remi,

First off, thanks for all your hard work!

I'm trying to rebuild your php scl packages with static GD and imagic. The reason is that with dynamically linked GD, the php memory_limit does not actually limit the amount of memory GD can consume. Do you have any packages with that already set up?

I can't seem to get it working by either changing #global with_libgd to 0 or by setting --enable-gd=dynamic to --enable-gd or --enable-gd=static. The end error is
error: File not found: /home/<user>/rpmbuild/php74/BUILDROOT/php74-php-7.4.7-1.el7.x86_64/opt/rh/php74/root/usr/lib64/php/modules/gd.so

Any suggestions on how i should go about it?

Thanks and best regards

Re: [Solved] Rebuilding php (scl) packages with static GD/imagick

> Do you have any packages with that already set up?

Sorry, no

Should be enough to

%global  with_libgd 0

To skip use of the system library (--with-external-gd)

BTW, this is untested on my side

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: [Solved] Rebuilding php (scl) packages with static GD/imagick

Thank you. I made a mistake by modifying the spec file a bit too much.
I would like to mimic your rpm as closely as possible since we have tooling around it. Is it possible to get your defines for rpmbuild? I tried using just '--define "scl php74" --define "scl_vendor remi" --define "_scl_prefix /opt/remi"', but everything gets put in to /opt/remi/php74/.
Also, could you perhaps add the README and COPYING files in to the next source package, so i don't have to manually add it?

Re: [Solved] Rebuilding php (scl) packages with static GD/imagick

> Is it possible to get your defines for rpmbuild?

Everything is public
https://git.remirepo.net/cgit/tools/mock.git/tree/

> everything gets put in to /opt/remi/php74

Which is expected for SCL...

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: [Solved] Rebuilding php (scl) packages with static GD/imagick

> Also, could you perhaps add the README and COPYING files in to the next source package, so i don't have to manually add it?

Already there

%if ! %{with_libgd}
%license libgd_README
%license libgd_COPYING
%endif
Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: [Solved] Rebuilding php (scl) packages with static GD/imagick

Sorry, I misunderstood your problem

Indeed these files have been removed upstream

Fixed in
https://git.remirepo.net/cgit/rpms/scl- … fada866f81
https://git.remirepo.net/cgit/rpms/scl- … 897dc0f129
https://git.remirepo.net/cgit/rpms/php/ … 7124b69eab

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: [Solved] Rebuilding php (scl) packages with static GD/imagick

Thank you for the fix. If i may make another suggestion for the php 5.6 build, i suggest you limit libicu-devel to => 50 and <59, since 59 it is impossible to build with libicu62-devel (which does satisfy the current requirements) and 59 was when they made the change (char16_t is the default type for UChar).

For anyone else wondering how to build with rpmbuild so that the structure is the same as the original remi packages:
rpmbuild --define "nfsmountable 0" --define "scl php56" --define "scl_vendor remi" --define '_scl_prefix /opt/remi' -ba php.spec

Re: [Solved] Rebuilding php (scl) packages with static GD/imagick

> rpmbuild --define "nfsmountable 0" --define "scl php56" --define "scl_vendor remi" --define '_scl_prefix /opt/remi' -ba php.spec

Using rpmbuild is a terrible idea.
mock should be preferred.
And having "php##-build" package is enough to have all this macro defined.

And perhaps better to change the "vendor" as this is no more my work wink

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test