mariancerny / freebsd-ports-php56

FreeBSD ports subtree to build unsupported (EoL) PHP 5.6
21 stars 11 forks source link

archivers/php56-phar fails build: bad syntax in BUILD_DEPENDS #7

Closed rwp0 closed 10 months ago

rwp0 commented 2 years ago

First of all, I'd like to thank you @mariancerny for maintaining this custom port as there is still a lot of websites running on PHP 5.6 in production.

archivers/php56-phar # make
===>   php56-phar-5.6.40 depends on file: /usr/local/bin/phpize - found
===>   php56-phar-5.6.40 depends on package: autoconf>0 - found
Error: bad dependency syntax in BUILD_DEPENDS
expecting: pattern:origin[@flavour][:target]
got: /usr/local/lib/php/20131226/hash.so:
Errors with dependencies.
*** Error code 1

Stop.
make: stopped in archivers/php56-phar

Please help in resolving this; I need it to install php56-extensions meta-package, to pkg create a PHP 5.6 bundle.

The rest (55 packages) built nicely on FreeBSD 13.1 using

mount -t unionfs /opt/php56 /usr/ports

The default option of -o rw is needed rather than -o ro for creating work directories while building.

This is a list of packages that were built and installed successfully on 13.1-RELEASE:

Used the supplied print/freetype2 for building php56-gd.

rwp0 commented 2 years ago

@mariancerny could you please see this?

Also (in addition to php56-phar port failing to build) the php56-recode package causes segmentation fault when loaded.

Thanks

victor-sudakov commented 2 years ago

I'm sorry to say that FreeBSD has probably become so irrelevant in the modern world of containerized apps that nobody cares any more.

rwp0 commented 2 years ago

I'm sorry to say that FreeBSD has probably become so irrelevant in the modern world of containerized apps that nobody cares any more.

Interesting point of view, though I don't agree with that.

PHP 5.6 on FreeBSD 13.1 is still being used and needed.

victor-sudakov commented 2 years ago

PHP 5.6 on FreeBSD 13.1 is still being used and needed.

In Linux you can install and run multiple versions of PHP simultaneously (almost out of the box). Sorry for the rant but it was one of the major reasons for me to switch to Linux.

mariancerny commented 2 years ago

Sorry, I am not using PHP 5.6 any more (finally), so I am not maintaining freebsd-ports-php56 any more.

For the mount -rw option... This can be avoided by using the following statement in make.conf:

WRKDIRPREFIX ?= /tmp/portbuild
rwp0 commented 2 years ago

A note to self and others interested:

In /opt/php56/archivers/php56-phar/work/php-5.6.40/ext/phar where the extension's source lives (ie. within the work directory of the port source) :

In file included from /u/php56/archivers/php56-phar/work/php-5.6.40/ext/phar/util.c:23:
In file included from ./phar_internal.h:59:
In file included from /usr/local/include/php/ext/spl/spl_array.h:26:
In file included from /usr/local/include/php/ext/spl/spl_iterators.h:27:
/usr/local/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found
#include "pcre.h"
         ^~~~~~~~
1 warning and 1 error generated.
*** Error code 1

Stop.
make: stopped in /opt/php56/archivers/php56-phar/work/php-5.6.40/ext/phar

Could compile and install phar.so by doing the following:

Edit /usr/local/include/php/ext/pcre/php_pcre.h (installed by php56-5.6.40):

19 /* $Id$ */
20 
21 #ifndef PHP_PCRE_H
22 #define PHP_PCRE_H
23 
24 #if HAVE_PCRE || HAVE_BUNDLED_PCRE
25 
26 #if HAVE_BUNDLED_PCRE
27 #include "pcrelib/pcre.h"
28 #else
29 // #include "pcre.h"
30 #include "/usr/local/include/pcre.h"
31 #endif
32 

Change #include "pcre.h" to #include "/usr/local/include/pcre.h"

pcre.h header is installed by the FreeBSD pcre package.

image

Basically including the full path in the header since it has relate path for some reason.


make clean runs the following:

find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la       modules/* libs/*