Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 606932

Summary: dev-php/twig Add PHP_TARGETS for php 7.x
Product: Gentoo Linux Reporter: Denis I. Polukarov <dipolukarov>
Component: Current packagesAssignee: Dirkjan Ochtman (RETIRED) <djc>
Status: RESOLVED INVALID    
Severity: normal CC: php-bugs
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Denis I. Polukarov 2017-01-23 16:03:52 UTC
Please add ebuild with php 7.1 support.
Comment 1 Guillaume Seren 2017-01-24 16:06:39 UTC
Hey Denis,
I think we could upgrade the ebuild to remove the USE_PHP="php5-6" as twig suggest to use >=php-5.2.7 [1].

But the constraint is here on purpose, see that commit message 8c4b6858a1, in brief it is needed to build the C extension of Twig:

```
    But the new ebuild also adds a feature, the ability to build the C
    extension for Twig. In older versions of PHP, the C implementation
    provides improved performance over the pure-PHP implementation. The
    only "older version" we support is php:5.6, so the C extension is only
    built when the user's PHP_TARGETS contains "php5-6". The extension
    will only be built with USE=extension; otherwise users who did not
    want the extension would be required to add "php5-6" to PHP_TARGETS in
    order to appease our eclass.

    Upstream does not currently support building the extension against
    php:7.0 or php:7.1, but the performance improvement is not so great
    with those versions of PHP anyway.
```

But the last version of twig suggest php-7 so it should work with this branch, but I am not sure for the php5 branch.

[1]: https://packagist.org/packages/twig/twig#v1.29.0
[2]: https://packagist.org/packages/twig/twig
Comment 2 Michael Orlitzky gentoo-dev 2017-01-25 14:41:49 UTC
^ what he said.

The USE_PHP variable (and your PHP_TARGETS) matters only for C extensions to PHP, not for regular PHP code. PHP is different than python and ruby in that respect.

The C extension for Twig only works with php-5.6, so we only need php5-6 in USE_PHP. That's not a big problem because Twig does work with php-7.x, and it's so fast that you don't need the C extension!

If you install the current version of Twig, it should work fine with php-7.1.