Re: [PATCH] Add php

2016-11-21 Thread Leo Famulari
On Sun, Nov 20, 2016 at 06:02:59PM +0100, Marius Bakke wrote:
> Sorry for the delay, PHP is in master now!

Wow, thanks to everyone who worked on this!


signature.asc
Description: PGP signature


Re: [PATCH] Add php

2016-11-21 Thread Ludovic Courtès
Marius Bakke  skribis:

> Marius Bakke  writes:
>
 > Failures in tests caused by external gd are not too serious to
 > require us to switch to the bundled one I think. We may not even
 > need to patch our libgd with php specific patches, since the
 > failures are only slight deviation from the spec on corner cases.
 > If you prefer that we apply these patches too, then we could, and I
 > would still try to keep that up to date.
 
 OK. Let's use external gd for now barring any serious issues.
 
 >
 > What I am more worried about are the iconv crashes. That may be due
 > to lacking locales though.
 
 You could try commenting them out and adding "glibc-locales" to
 native-inputs. Not sure if they will get picked up by that however.
 
 A better test may be to try out that particular functionality using
 the installed version of php. If that works, we can be reasonably
 sure that dropping the tests is fine.
 
 Attached is the final product, after adding a "gd-for-php" variable
 with the two upstream patches, as well as sqlite-3.15.1 (separate
 patch).
 
 I'll push this tomorrow if there are no further comments. Thanks for
 your perseverance :)
>>> Just one question: why defining gd-for-php with define, and not
>>> define-public?
>>
>> It's to prevent it from showing up when people are searching for 'gd',
>> and also to prevent it from being included by other files.
>>
>> It's only a temporary measure until the next version is released, so I
>> saw no reason to export it.
>>
>> I'm on my way out, but will commit this tomorrow most likely :-)
>
> Sorry for the delay, PHP is in master now!

Cool, thank you all!

Ludo’.



Re: [PATCH] Add php

2016-11-20 Thread Marius Bakke
Marius Bakke  writes:

>>> > Failures in tests caused by external gd are not too serious to
>>> > require us to switch to the bundled one I think. We may not even
>>> > need to patch our libgd with php specific patches, since the
>>> > failures are only slight deviation from the spec on corner cases.
>>> > If you prefer that we apply these patches too, then we could, and I
>>> > would still try to keep that up to date.
>>> 
>>> OK. Let's use external gd for now barring any serious issues.
>>> 
>>> >
>>> > What I am more worried about are the iconv crashes. That may be due
>>> > to lacking locales though.
>>> 
>>> You could try commenting them out and adding "glibc-locales" to
>>> native-inputs. Not sure if they will get picked up by that however.
>>> 
>>> A better test may be to try out that particular functionality using
>>> the installed version of php. If that works, we can be reasonably
>>> sure that dropping the tests is fine.
>>> 
>>> Attached is the final product, after adding a "gd-for-php" variable
>>> with the two upstream patches, as well as sqlite-3.15.1 (separate
>>> patch).
>>> 
>>> I'll push this tomorrow if there are no further comments. Thanks for
>>> your perseverance :)
>> Just one question: why defining gd-for-php with define, and not
>> define-public?
>
> It's to prevent it from showing up when people are searching for 'gd',
> and also to prevent it from being included by other files.
>
> It's only a temporary measure until the next version is released, so I
> saw no reason to export it.
>
> I'm on my way out, but will commit this tomorrow most likely :-)

Sorry for the delay, PHP is in master now!


signature.asc
Description: PGP signature


Re: [PATCH] Add php

2016-11-18 Thread Marius Bakke
Julien Lepiller  writes:

> On Thu, 17 Nov 2016 21:43:39 +0100
> Marius Bakke  wrote:
>
>> Julien Lepiller  writes:
>> 
>> >> >> Unfortunately that only fixed a handful of tests, the remaining
>> >> >> 50-something had to be disabled for a variety of reasons.
>> >> >> 
>> >> >> I've added a commentary to each disabled test. If you recognize
>> >> >> any of these errors/think you know what's going on, please
>> >> >> update the patch. It would be nice to know if the iconv and gd
>> >> >> stuff is expected, and if the two sqlite tests can really be
>> >> >> ignored. The curl one is strange too.  
>> >> >
>> >> > Just as I wanted to send a similar patch ;)
>> >> >
>> >> > I've been looking at some of them. The failing sqlite test is a
>> >> > bug in sqlite that has been fixed last august 
>> >> > (https://sqlite.org/src/info/ef360601). We currently have
>> >> > version 3.14.1, when the latest upstream version is 3.15.1.
>> >> > Updating should fix the problem.
>> >> >
>> >> > 73159 has been fixed in gd:
>> >> > https://github.com/libgd/libgd/issues/289 (more recent than
>> >> > latest gd release unfortunately)
>> >> >
>> >> > 73155 has also been fixed in gd: 
>> >> > https://github.com/libgd/libgd/issues/309 (even more recent)
>> >> >
>> >> > 72482 is fixed here: 
>> >> > https://gist.github.com/anonymous/873314feb4f89bd8336711333299f748
>> >> > (a patch to the bundled libgd)
>> >> >
>> >> > 73213 is fixed here: 
>> >> > https://git.php.net/?p=php-src.git;a=blobdiff;f=ext/gd/libgd/gd.c;h=033d4fa5f0e9740e8b8c397a9038a115c617c419;hp=0b4b42fa27558fa32cc54e14dc297d9d0ba10832;hb=9acfb1a3a5268febb123b7e5fbd4eaf072c83537;hpb=c0219b323e0048440acbdd9ad74624c4bc33c335
>> >> >  
>> >> > (a patch to the bundled libgd)
>> >> >
>> >> > 72339 has a CVE id: 2016-5766, but it should be fixed in libgd
>> >> > 2.2.3 that we have according to the CVE description, and the
>> >> > failure is different from what the report says.
>> >> >
>> >> > 39780 has the unexpected output described in the bug report, so
>> >> > it really fails. I don't think we can fix our libgd though,
>> >> > because the bundled one has some php_* functions that are used
>> >> > to get a warning instead of an error.
>> >> >
>> >> > we could include patches to our libgd to fix two (maybe four)
>> >> > issues. We should also upgrade our sqlite version, but many
>> >> > packages will then have to be rebuilt, or we could create a
>> >> > separate package for the newer version. What do you suggest?  
>> >> 
>> >> Wow, thanks for this list! Including the two upstream gd fixes in a
>> >> "gd-for-php" package should be fine, until a new release of gd is
>> >> out. I'm more vary about including the PHP-specific ones though.
>> >> 
>> >> If there are serious problems with using an external (vanilla) gd,
>> >> I think we either need to maintain a "gd-for-php" package
>> >> indefinitely, or bite the bullet and use the bundled one.
>> >> 
>> >> Do you think it's safe to use our gd? And if not, would you be
>> >> willing to keep up with PHP development and maintain the
>> >> externalized gd component with it?
>> >
>> > Failures in tests caused by external gd are not too serious to
>> > require us to switch to the bundled one I think. We may not even
>> > need to patch our libgd with php specific patches, since the
>> > failures are only slight deviation from the spec on corner cases.
>> > If you prefer that we apply these patches too, then we could, and I
>> > would still try to keep that up to date.
>> 
>> OK. Let's use external gd for now barring any serious issues.
>> 
>> >
>> > What I am more worried about are the iconv crashes. That may be due
>> > to lacking locales though.
>> 
>> You could try commenting them out and adding "glibc-locales" to
>> native-inputs. Not sure if they will get picked up by that however.
>> 
>> A better test may be to try out that particular functionality using
>> the installed version of php. If that works, we can be reasonably
>> sure that dropping the tests is fine.
>> 
>> Attached is the final product, after adding a "gd-for-php" variable
>> with the two upstream patches, as well as sqlite-3.15.1 (separate
>> patch).
>> 
>> I'll push this tomorrow if there are no further comments. Thanks for
>> your perseverance :)
> Just one question: why defining gd-for-php with define, and not
> define-public?

It's to prevent it from showing up when people are searching for 'gd',
and also to prevent it from being included by other files.

It's only a temporary measure until the next version is released, so I
saw no reason to export it.

I'm on my way out, but will commit this tomorrow most likely :-)


signature.asc
Description: PGP signature


Re: [PATCH] Add php

2016-11-18 Thread Julien Lepiller
On Thu, 17 Nov 2016 21:43:39 +0100
Marius Bakke  wrote:

> Julien Lepiller  writes:
> 
> >> >> Unfortunately that only fixed a handful of tests, the remaining
> >> >> 50-something had to be disabled for a variety of reasons.
> >> >> 
> >> >> I've added a commentary to each disabled test. If you recognize
> >> >> any of these errors/think you know what's going on, please
> >> >> update the patch. It would be nice to know if the iconv and gd
> >> >> stuff is expected, and if the two sqlite tests can really be
> >> >> ignored. The curl one is strange too.  
> >> >
> >> > Just as I wanted to send a similar patch ;)
> >> >
> >> > I've been looking at some of them. The failing sqlite test is a
> >> > bug in sqlite that has been fixed last august 
> >> > (https://sqlite.org/src/info/ef360601). We currently have
> >> > version 3.14.1, when the latest upstream version is 3.15.1.
> >> > Updating should fix the problem.
> >> >
> >> > 73159 has been fixed in gd:
> >> > https://github.com/libgd/libgd/issues/289 (more recent than
> >> > latest gd release unfortunately)
> >> >
> >> > 73155 has also been fixed in gd: 
> >> > https://github.com/libgd/libgd/issues/309 (even more recent)
> >> >
> >> > 72482 is fixed here: 
> >> > https://gist.github.com/anonymous/873314feb4f89bd8336711333299f748
> >> > (a patch to the bundled libgd)
> >> >
> >> > 73213 is fixed here: 
> >> > https://git.php.net/?p=php-src.git;a=blobdiff;f=ext/gd/libgd/gd.c;h=033d4fa5f0e9740e8b8c397a9038a115c617c419;hp=0b4b42fa27558fa32cc54e14dc297d9d0ba10832;hb=9acfb1a3a5268febb123b7e5fbd4eaf072c83537;hpb=c0219b323e0048440acbdd9ad74624c4bc33c335
> >> >  
> >> > (a patch to the bundled libgd)
> >> >
> >> > 72339 has a CVE id: 2016-5766, but it should be fixed in libgd
> >> > 2.2.3 that we have according to the CVE description, and the
> >> > failure is different from what the report says.
> >> >
> >> > 39780 has the unexpected output described in the bug report, so
> >> > it really fails. I don't think we can fix our libgd though,
> >> > because the bundled one has some php_* functions that are used
> >> > to get a warning instead of an error.
> >> >
> >> > we could include patches to our libgd to fix two (maybe four)
> >> > issues. We should also upgrade our sqlite version, but many
> >> > packages will then have to be rebuilt, or we could create a
> >> > separate package for the newer version. What do you suggest?  
> >> 
> >> Wow, thanks for this list! Including the two upstream gd fixes in a
> >> "gd-for-php" package should be fine, until a new release of gd is
> >> out. I'm more vary about including the PHP-specific ones though.
> >> 
> >> If there are serious problems with using an external (vanilla) gd,
> >> I think we either need to maintain a "gd-for-php" package
> >> indefinitely, or bite the bullet and use the bundled one.
> >> 
> >> Do you think it's safe to use our gd? And if not, would you be
> >> willing to keep up with PHP development and maintain the
> >> externalized gd component with it?
> >
> > Failures in tests caused by external gd are not too serious to
> > require us to switch to the bundled one I think. We may not even
> > need to patch our libgd with php specific patches, since the
> > failures are only slight deviation from the spec on corner cases.
> > If you prefer that we apply these patches too, then we could, and I
> > would still try to keep that up to date.
> 
> OK. Let's use external gd for now barring any serious issues.
> 
> >
> > What I am more worried about are the iconv crashes. That may be due
> > to lacking locales though.
> 
> You could try commenting them out and adding "glibc-locales" to
> native-inputs. Not sure if they will get picked up by that however.
> 
> A better test may be to try out that particular functionality using
> the installed version of php. If that works, we can be reasonably
> sure that dropping the tests is fine.
> 
> Attached is the final product, after adding a "gd-for-php" variable
> with the two upstream patches, as well as sqlite-3.15.1 (separate
> patch).
> 
> I'll push this tomorrow if there are no further comments. Thanks for
> your perseverance :)
Just one question: why defining gd-for-php with define, and not
define-public?

> 




Re: [PATCH] Add php

2016-11-17 Thread Marius Bakke
Julien Lepiller  writes:

>> >> Unfortunately that only fixed a handful of tests, the remaining
>> >> 50-something had to be disabled for a variety of reasons.
>> >> 
>> >> I've added a commentary to each disabled test. If you recognize
>> >> any of these errors/think you know what's going on, please update
>> >> the patch. It would be nice to know if the iconv and gd stuff is
>> >> expected, and if the two sqlite tests can really be ignored. The
>> >> curl one is strange too.  
>> >
>> > Just as I wanted to send a similar patch ;)
>> >
>> > I've been looking at some of them. The failing sqlite test is a bug
>> > in sqlite that has been fixed last august 
>> > (https://sqlite.org/src/info/ef360601). We currently have version 
>> > 3.14.1, when the latest upstream version is 3.15.1. Updating should
>> > fix the problem.
>> >
>> > 73159 has been fixed in gd:
>> > https://github.com/libgd/libgd/issues/289 (more recent than latest
>> > gd release unfortunately)
>> >
>> > 73155 has also been fixed in gd: 
>> > https://github.com/libgd/libgd/issues/309 (even more recent)
>> >
>> > 72482 is fixed here: 
>> > https://gist.github.com/anonymous/873314feb4f89bd8336711333299f748
>> > (a patch to the bundled libgd)
>> >
>> > 73213 is fixed here: 
>> > https://git.php.net/?p=php-src.git;a=blobdiff;f=ext/gd/libgd/gd.c;h=033d4fa5f0e9740e8b8c397a9038a115c617c419;hp=0b4b42fa27558fa32cc54e14dc297d9d0ba10832;hb=9acfb1a3a5268febb123b7e5fbd4eaf072c83537;hpb=c0219b323e0048440acbdd9ad74624c4bc33c335
>> >  
>> > (a patch to the bundled libgd)
>> >
>> > 72339 has a CVE id: 2016-5766, but it should be fixed in libgd
>> > 2.2.3 that we have according to the CVE description, and the
>> > failure is different from what the report says.
>> >
>> > 39780 has the unexpected output described in the bug report, so it 
>> > really fails. I don't think we can fix our libgd though, because
>> > the bundled one has some php_* functions that are used to get a
>> > warning instead of an error.
>> >
>> > we could include patches to our libgd to fix two (maybe four)
>> > issues. We should also upgrade our sqlite version, but many
>> > packages will then have to be rebuilt, or we could create a
>> > separate package for the newer version. What do you suggest?  
>> 
>> Wow, thanks for this list! Including the two upstream gd fixes in a
>> "gd-for-php" package should be fine, until a new release of gd is out.
>> I'm more vary about including the PHP-specific ones though.
>> 
>> If there are serious problems with using an external (vanilla) gd, I
>> think we either need to maintain a "gd-for-php" package indefinitely,
>> or bite the bullet and use the bundled one.
>> 
>> Do you think it's safe to use our gd? And if not, would you be willing
>> to keep up with PHP development and maintain the externalized gd
>> component with it?
>
> Failures in tests caused by external gd are not too serious to require
> us to switch to the bundled one I think. We may not even need to patch
> our libgd with php specific patches, since the failures are only slight
> deviation from the spec on corner cases. If you prefer that we apply
> these patches too, then we could, and I would still try to keep that up
> to date.

OK. Let's use external gd for now barring any serious issues.

>
> What I am more worried about are the iconv crashes. That may be due to
> lacking locales though.

You could try commenting them out and adding "glibc-locales" to
native-inputs. Not sure if they will get picked up by that however.

A better test may be to try out that particular functionality using the
installed version of php. If that works, we can be reasonably sure that
dropping the tests is fine.

Attached is the final product, after adding a "gd-for-php" variable with
the two upstream patches, as well as sqlite-3.15.1 (separate patch).

I'll push this tomorrow if there are no further comments. Thanks for
your perseverance :)



signature.asc
Description: PGP signature
>From ae98ee11b6eb2e0feb79c735497b8647ebf80d6f Mon Sep 17 00:00:00 2001
From: Marius Bakke 
Date: Thu, 17 Nov 2016 18:53:10 +0100
Subject: [PATCH 1/2] gnu: Add sqlite-3.15.1.

* gnu/packages/databases.scm (sqlite-3.15.1): New variable.
---
 gnu/packages/databases.scm | 20 
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index ab9c6d6..d6746f0 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -558,6 +558,26 @@ widely deployed SQL database engine in the world.  The source code for SQLite
 is in the public domain.")
(license public-domain)))
 
+(define-public sqlite-3.15.1
+  (package (inherit sqlite)
+   (version "3.15.1")
+   (source (origin
+ (method url-fetch)
+ (uri (let ((numeric-version
+ (match (string-split version #\.)
+   ((first-digit other-digits ...)
+(str

Re: [PATCH] Add php

2016-11-17 Thread Julien Lepiller
On Thu, 17 Nov 2016 11:22:53 +0100
Hartmut Goebel  wrote:

> Am 17.11.2016 um 01:01 schrieb Marius Bakke:
> > If there are no further comments, I will push this in the next few
> > days:  
> 
> Thanks for your work on this. It seems to be laborious.
> 
> I don't have time to inspect not to test the patch, so just some
> thought. I'm not a php-user, but wanted to install a php-driven
> website on Guix some weeks ago and had a look on what else would be
> required.
> 
>   * Does this php package include what other distributions call
> "php-cli", "php-fpm" and "php-cgi"? Maybe you want to mention it
> in the synopsis. (Addendum: I just found in
>  that it looks
> like these are part of the package.)
>   * As far as I understood, "pear" and "pecl" are important for
> installing php packages. Are these part of your package, too?

The package contains the following executables in sbin and bin:
php-fpm  pear  peardev  pecl  phar  phar.phar  php  php-cgi  php-config
phpdbg  phpize

> 
> 
>   * What do you think about adding "Packaging guideline" for "PHP
> Modules" section to the manual?
>   * Do yo think we need some php build system?
I have no idea how system-wide php packages could be installed, so I
can't answer that (yet?). Sorry.

> 
> 




Re: [PATCH] Add php

2016-11-17 Thread Julien Lepiller
On Thu, 17 Nov 2016 19:22:48 +0100
Marius Bakke  wrote:

> tyreunom  writes:
> 
> > Le 2016-11-17 01:01, Marius Bakke a écrit :  
> >> Ludovic Courtès  writes:
> >>   
> >>> Marius Bakke  skribis:
> >>>   
>  Some failures are indeed due to missing network or programs in
>  the build
>  environment. I tried patching a few just now, but unfortunately
>  some files are in a format apparently not supported by Guile!
>  
>   870: 5 [call-with-input-file
>  "ext/mbstring/tests/bug26639.phpt" ...] In 
>  /gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/build/utils.scm:
>   556: 4 [#  /gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/buil
>  d/utils.scm:555:10 (in)> #  ext/mbstring/tests/bug26639.phpt   
>  11>]  
>   592: 3 [#  /gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/buil
>  d/utils.scm:578:6 (in out)> #  ext/mbstring/tests/bug26639.phpt   
>  11> ...]  
>  In ice-9/rdelim.scm:
>   188: 2 [read-line # 
>  concat]
>  In unknown file:
> ?: 1 [%read-line #  11>] In ice-9/boot-9.scm:
>   109: 0 [#  (thrown-k . args)> decoding-error ...]  
>  
>  ice-9/boot-9.scm:109:20: In procedure #  ice-9/boot-9.scm:100:6 (thrown-k . arg  
>  s)>:  
>  ice-9/boot-9.scm:109:20: Throw to key `decoding-error' with args 
>  `("scm_getc" "input decoding error
>  " 84 #)'.
>  
>  `file` reports: ext/mbstring/tests/bug26639.phpt: Non-ISO 
>  extended-ASCII text  
> >>> 
> >>> Presumably this is ‘substitute*’ failing to read the file.
> >>> 
> >>> ‘substitute*’ expects input files to be UTF-8-encoded; when this
> >>> is not
> >>> the case, you need to bind ‘%default-port-encoding’ to whatever
> >>> is the right encoding or #f for the catch-all ISO-8859-1.  See
> >>> ‘gettext-minimal’ for an example.  
> >> 
> >> Thank you! That was exactly what I needed.
> >> 
> >> Unfortunately that only fixed a handful of tests, the remaining
> >> 50-something had to be disabled for a variety of reasons.
> >> 
> >> I've added a commentary to each disabled test. If you recognize
> >> any of these errors/think you know what's going on, please update
> >> the patch. It would be nice to know if the iconv and gd stuff is
> >> expected, and if the two sqlite tests can really be ignored. The
> >> curl one is strange too.  
> >
> > Just as I wanted to send a similar patch ;)
> >
> > I've been looking at some of them. The failing sqlite test is a bug
> > in sqlite that has been fixed last august 
> > (https://sqlite.org/src/info/ef360601). We currently have version 
> > 3.14.1, when the latest upstream version is 3.15.1. Updating should
> > fix the problem.
> >
> > 73159 has been fixed in gd:
> > https://github.com/libgd/libgd/issues/289 (more recent than latest
> > gd release unfortunately)
> >
> > 73155 has also been fixed in gd: 
> > https://github.com/libgd/libgd/issues/309 (even more recent)
> >
> > 72482 is fixed here: 
> > https://gist.github.com/anonymous/873314feb4f89bd8336711333299f748
> > (a patch to the bundled libgd)
> >
> > 73213 is fixed here: 
> > https://git.php.net/?p=php-src.git;a=blobdiff;f=ext/gd/libgd/gd.c;h=033d4fa5f0e9740e8b8c397a9038a115c617c419;hp=0b4b42fa27558fa32cc54e14dc297d9d0ba10832;hb=9acfb1a3a5268febb123b7e5fbd4eaf072c83537;hpb=c0219b323e0048440acbdd9ad74624c4bc33c335
> >  
> > (a patch to the bundled libgd)
> >
> > 72339 has a CVE id: 2016-5766, but it should be fixed in libgd
> > 2.2.3 that we have according to the CVE description, and the
> > failure is different from what the report says.
> >
> > 39780 has the unexpected output described in the bug report, so it 
> > really fails. I don't think we can fix our libgd though, because
> > the bundled one has some php_* functions that are used to get a
> > warning instead of an error.
> >
> > we could include patches to our libgd to fix two (maybe four)
> > issues. We should also upgrade our sqlite version, but many
> > packages will then have to be rebuilt, or we could create a
> > separate package for the newer version. What do you suggest?  
> 
> Wow, thanks for this list! Including the two upstream gd fixes in a
> "gd-for-php" package should be fine, until a new release of gd is out.
> I'm more vary about including the PHP-specific ones though.
> 
> If there are serious problems with using an external (vanilla) gd, I
> think we either need to maintain a "gd-for-php" package indefinitely,
> or bite the bullet and use the bundled one.
> 
> Do you think it's safe to use our gd? And if not, would you be willing
> to keep up with PHP development and maintain the externalized gd
> component with it?

Failures in tests caused by external gd are not too serious to require
us to switch to the bundled one I think. We may not even need to patch
our libgd with php specific patches, since the failures are only slight
deviation from the spec on corner cases. If you prefer that we apply
these pat

Re: [PATCH] Add php

2016-11-17 Thread Marius Bakke
tyreunom  writes:

> Le 2016-11-17 01:01, Marius Bakke a écrit :
>> Ludovic Courtès  writes:
>> 
>>> Marius Bakke  skribis:
>>> 
 Some failures are indeed due to missing network or programs in the 
 build
 environment. I tried patching a few just now, but unfortunately some
 files are in a format apparently not supported by Guile!
 
  870: 5 [call-with-input-file "ext/mbstring/tests/bug26639.phpt" ...]
 In 
 /gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/build/utils.scm:
  556: 4 [#>>> /gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/buil
 d/utils.scm:555:10 (in)> #>>> 11>]
  592: 3 [#>>> /gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/buil
 d/utils.scm:578:6 (in out)> #>>> 11> ...]
 In ice-9/rdelim.scm:
  188: 2 [read-line # 
 concat]
 In unknown file:
?: 1 [%read-line #]
 In ice-9/boot-9.scm:
  109: 0 [#>>> args)> decoding-error ...]
 
 ice-9/boot-9.scm:109:20: In procedure #>>> ice-9/boot-9.scm:100:6 (thrown-k . arg
 s)>:
 ice-9/boot-9.scm:109:20: Throw to key `decoding-error' with args 
 `("scm_getc" "input decoding error
 " 84 #)'.
 
 `file` reports: ext/mbstring/tests/bug26639.phpt: Non-ISO 
 extended-ASCII text
>>> 
>>> Presumably this is ‘substitute*’ failing to read the file.
>>> 
>>> ‘substitute*’ expects input files to be UTF-8-encoded; when this is 
>>> not
>>> the case, you need to bind ‘%default-port-encoding’ to whatever is the
>>> right encoding or #f for the catch-all ISO-8859-1.  See
>>> ‘gettext-minimal’ for an example.
>> 
>> Thank you! That was exactly what I needed.
>> 
>> Unfortunately that only fixed a handful of tests, the remaining
>> 50-something had to be disabled for a variety of reasons.
>> 
>> I've added a commentary to each disabled test. If you recognize any of
>> these errors/think you know what's going on, please update the patch.
>> It would be nice to know if the iconv and gd stuff is expected, and if
>> the two sqlite tests can really be ignored. The curl one is strange 
>> too.
>
> Just as I wanted to send a similar patch ;)
>
> I've been looking at some of them. The failing sqlite test is a bug in 
> sqlite that has been fixed last august 
> (https://sqlite.org/src/info/ef360601). We currently have version 
> 3.14.1, when the latest upstream version is 3.15.1. Updating should fix 
> the problem.
>
> 73159 has been fixed in gd: https://github.com/libgd/libgd/issues/289 
> (more recent than latest gd release unfortunately)
>
> 73155 has also been fixed in gd: 
> https://github.com/libgd/libgd/issues/309 (even more recent)
>
> 72482 is fixed here: 
> https://gist.github.com/anonymous/873314feb4f89bd8336711333299f748 (a 
> patch to the bundled libgd)
>
> 73213 is fixed here: 
> https://git.php.net/?p=php-src.git;a=blobdiff;f=ext/gd/libgd/gd.c;h=033d4fa5f0e9740e8b8c397a9038a115c617c419;hp=0b4b42fa27558fa32cc54e14dc297d9d0ba10832;hb=9acfb1a3a5268febb123b7e5fbd4eaf072c83537;hpb=c0219b323e0048440acbdd9ad74624c4bc33c335
>  
> (a patch to the bundled libgd)
>
> 72339 has a CVE id: 2016-5766, but it should be fixed in libgd 2.2.3 
> that we have according to the CVE description, and the failure is 
> different from what the report says.
>
> 39780 has the unexpected output described in the bug report, so it 
> really fails. I don't think we can fix our libgd though, because the 
> bundled one has some php_* functions that are used to get a warning 
> instead of an error.
>
> we could include patches to our libgd to fix two (maybe four) issues. We 
> should also upgrade our sqlite version, but many packages will then have 
> to be rebuilt, or we could create a separate package for the newer 
> version. What do you suggest?

Wow, thanks for this list! Including the two upstream gd fixes in a
"gd-for-php" package should be fine, until a new release of gd is out.
I'm more vary about including the PHP-specific ones though.

If there are serious problems with using an external (vanilla) gd, I
think we either need to maintain a "gd-for-php" package indefinitely, or
bite the bullet and use the bundled one.

Do you think it's safe to use our gd? And if not, would you be willing
to keep up with PHP development and maintain the externalized gd
component with it?

I've confirmed that using a newer sqlite fixes the sqlite test, thanks
for that. I will submit a "sqlite-3.15.1" package with this patch, and
make sure it's updated in the next 'core-updates' cycle.


signature.asc
Description: PGP signature


Re: [PATCH] Add php

2016-11-17 Thread Ludovic Courtès
Hello!

tyreunom  skribis:

> we could include patches to our libgd to fix two (maybe four)
> issues. We should also upgrade our sqlite version, but many packages
> will then have to be rebuilt, or we could create a separate package
> for the newer version. What do you suggest?

Until we upgrade ‘gd’ (that’d be in ‘staging’), we can always have a gd
variant that includes all the relevant fixes and use this variant for
PHP.

Ludo’.



Re: [PATCH] Add php

2016-11-17 Thread tyreunom

Le 2016-11-17 01:01, Marius Bakke a écrit :

Ludovic Courtès  writes:


Marius Bakke  skribis:

Some failures are indeed due to missing network or programs in the 
build

environment. I tried patching a few just now, but unfortunately some
files are in a format apparently not supported by Guile!

 870: 5 [call-with-input-file "ext/mbstring/tests/bug26639.phpt" ...]
In 
/gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/build/utils.scm:
 556: 4 [#/gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/buil
d/utils.scm:555:10 (in)> #11>]
 592: 3 [#/gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/buil
d/utils.scm:578:6 (in out)> #11> ...]

In ice-9/rdelim.scm:
 188: 2 [read-line # 
concat]

In unknown file:
   ?: 1 [%read-line #]
In ice-9/boot-9.scm:
 109: 0 [#args)> decoding-error ...]


ice-9/boot-9.scm:109:20: In procedure #ice-9/boot-9.scm:100:6 (thrown-k . arg

s)>:
ice-9/boot-9.scm:109:20: Throw to key `decoding-error' with args 
`("scm_getc" "input decoding error

" 84 #)'.

`file` reports: ext/mbstring/tests/bug26639.phpt: Non-ISO 
extended-ASCII text


Presumably this is ‘substitute*’ failing to read the file.

‘substitute*’ expects input files to be UTF-8-encoded; when this is 
not

the case, you need to bind ‘%default-port-encoding’ to whatever is the
right encoding or #f for the catch-all ISO-8859-1.  See
‘gettext-minimal’ for an example.


Thank you! That was exactly what I needed.

Unfortunately that only fixed a handful of tests, the remaining
50-something had to be disabled for a variety of reasons.

I've added a commentary to each disabled test. If you recognize any of
these errors/think you know what's going on, please update the patch.
It would be nice to know if the iconv and gd stuff is expected, and if
the two sqlite tests can really be ignored. The curl one is strange 
too.


Just as I wanted to send a similar patch ;)

I've been looking at some of them. The failing sqlite test is a bug in 
sqlite that has been fixed last august 
(https://sqlite.org/src/info/ef360601). We currently have version 
3.14.1, when the latest upstream version is 3.15.1. Updating should fix 
the problem.


73159 has been fixed in gd: https://github.com/libgd/libgd/issues/289 
(more recent than latest gd release unfortunately)


73155 has also been fixed in gd: 
https://github.com/libgd/libgd/issues/309 (even more recent)


72482 is fixed here: 
https://gist.github.com/anonymous/873314feb4f89bd8336711333299f748 (a 
patch to the bundled libgd)


73213 is fixed here: 
https://git.php.net/?p=php-src.git;a=blobdiff;f=ext/gd/libgd/gd.c;h=033d4fa5f0e9740e8b8c397a9038a115c617c419;hp=0b4b42fa27558fa32cc54e14dc297d9d0ba10832;hb=9acfb1a3a5268febb123b7e5fbd4eaf072c83537;hpb=c0219b323e0048440acbdd9ad74624c4bc33c335 
(a patch to the bundled libgd)


72339 has a CVE id: 2016-5766, but it should be fixed in libgd 2.2.3 
that we have according to the CVE description, and the failure is 
different from what the report says.


39780 has the unexpected output described in the bug report, so it 
really fails. I don't think we can fix our libgd though, because the 
bundled one has some php_* functions that are used to get a warning 
instead of an error.


we could include patches to our libgd to fix two (maybe four) issues. We 
should also upgrade our sqlite version, but many packages will then have 
to be rebuilt, or we could create a separate package for the newer 
version. What do you suggest?




If there are no further comments, I will push this in the next few 
days:




Re: [PATCH] Add php

2016-11-17 Thread Hartmut Goebel
Am 17.11.2016 um 01:01 schrieb Marius Bakke:
> If there are no further comments, I will push this in the next few days:

Thanks for your work on this. It seems to be laborious.

I don't have time to inspect not to test the patch, so just some
thought. I'm not a php-user, but wanted to install a php-driven website
on Guix some weeks ago and had a look on what else would be required.

  * Does this php package include what other distributions call
"php-cli", "php-fpm" and "php-cgi"? Maybe you want to mention it in
the synopsis. (Addendum: I just found in
 that it looks like
these are part of the package.)
  * As far as I understood, "pear" and "pecl" are important for
installing php packages. Are these part of your package, too?


  * What do you think about adding "Packaging guideline" for "PHP
Modules" section to the manual?
  * Do yo think we need some php build system?


-- 
Regards
Hartmut Goebel

| Hartmut Goebel  | h.goe...@crazy-compilers.com   |
| www.crazy-compilers.com | compilers which you thought are impossible |





Re: [PATCH] Add php

2016-11-14 Thread Ludovic Courtès
Marius Bakke  skribis:

> Some failures are indeed due to missing network or programs in the build
> environment. I tried patching a few just now, but unfortunately some
> files are in a format apparently not supported by Guile!
>
>  870: 5 [call-with-input-file "ext/mbstring/tests/bug26639.phpt" ...]
> In 
> /gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/build/utils.scm:
>  556: 4 [# /gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/buil
> d/utils.scm:555:10 (in)> #]
>  592: 3 [# /gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/buil
> d/utils.scm:578:6 (in out)> # ...]
> In ice-9/rdelim.scm:
>  188: 2 [read-line # concat]
> In unknown file:
>?: 1 [%read-line #]
> In ice-9/boot-9.scm:
>  109: 0 [# 
> decoding-error ...]
>
> ice-9/boot-9.scm:109:20: In procedure # ice-9/boot-9.scm:100:6 (thrown-k . arg
> s)>:
> ice-9/boot-9.scm:109:20: Throw to key `decoding-error' with args `("scm_getc" 
> "input decoding error
> " 84 #)'.
>
> `file` reports: ext/mbstring/tests/bug26639.phpt: Non-ISO extended-ASCII text

Presumably this is ‘substitute*’ failing to read the file.

‘substitute*’ expects input files to be UTF-8-encoded; when this is not
the case, you need to bind ‘%default-port-encoding’ to whatever is the
right encoding or #f for the catch-all ISO-8859-1.  See
‘gettext-minimal’ for an example.

HTH!

Ludo’.



Re: [PATCH] Add php

2016-11-14 Thread Marius Bakke
Ludovic Courtès  writes:

> Hi Marius,
>
> Marius Bakke  skribis:
>
>> Marius Bakke  writes:
>>
>>> Julien Lepiller  writes:
>>>
> Could you send an updated patch to address those issues?  Then we can
> happily apply it.
 here is the updated patch. I let the tests be done because it doesn't
 harm, but it does no good either, so feel free to disable them if you
 prefer.
>>>
>>> Hello! I've gone through this package and made some improvements. I also
>>> managed to enable the test suite, but had to resort to strace to figure
>>> out what was going on (/bin/sh calls..).
>>
>> Oops, here is a version that actually passes `guix lint`.
>>
>> From 83b2913549784e5d3bafd29641e314b308f7df11 Mon Sep 17 00:00:00 2001
>> From: Julien Lepiller 
>> Date: Fri, 11 Nov 2016 15:18:29 +0100
>> Subject: [PATCH] gnu: Add php.
>>
>> * gnu/packages/php.scm: New file.
>> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
>
> Thanks for the update!
>
>> +;;"bcmath/libbcmath"
>
> So this one is very different from ‘bc’?

Yes, it's a completely different project and apparently more akin to
'gmp'. It's maintained within the PHP repository.

>> +;;"fileinfo/libmagic" ; This is a patched 
>> version of libmagic.
>
> Here adding a dependency on ‘file’ instead (the package that provides
> libmagic) didn’t cut it, right?

Correct. The build system expects to build this, and it appears to be
heavily patched, so I did not try very hard.

>> + (add-before 'check 'set-test-environment
>> +   (lambda _
>> + ;; Without this variable, `make test' passes regardless of 
>> failures.
>> + (setenv "REPORT_EXIT_STATUS" "1")
>> + #t)))
>> +   #:test-target "test"
>> +   #:tests? #t))
>
> Do you have more info as to what fails?  I wouldn’t be surprised if
> there were lots of issues having to do with the use of /bin/sh, host
> name lookups, and other things not available in the build environment.
>
> Could you gather more info as to what fails so that we can either fix
> it, or at least convince ourselves that these are not serious issues and
> document them in a comment?

Some failures are indeed due to missing network or programs in the build
environment. I tried patching a few just now, but unfortunately some
files are in a format apparently not supported by Guile!

 870: 5 [call-with-input-file "ext/mbstring/tests/bug26639.phpt" ...]
In 
/gnu/store/ciqw5z470c8ihl1kfswj1j3ix6hs092d-module-import/guix/build/utils.scm:
 556: 4 [# #]
 592: 3 [# # ...]
In ice-9/rdelim.scm:
 188: 2 [read-line # concat]
In unknown file:
   ?: 1 [%read-line #]
In ice-9/boot-9.scm:
 109: 0 [# 
decoding-error ...]

ice-9/boot-9.scm:109:20: In procedure #:
ice-9/boot-9.scm:109:20: Throw to key `decoding-error' with args `("scm_getc" 
"input decoding error
" 84 #)'.

`file` reports: ext/mbstring/tests/bug26639.phpt: Non-ISO extended-ASCII text

Can we work around this somehow? There are more files with non-standard
file types that can't be substituted.

I also found a flag "SKIP_ONLINE_TESTS" which should rule out some more
failures. Attached is an updated patch, but there is still a long way to
go. I will continue this journey tomorrow:



signature.asc
Description: PGP signature
>From abedcccd5a184cc600f122fe01149884ba30c318 Mon Sep 17 00:00:00 2001
From: Julien Lepiller 
Date: Fri, 11 Nov 2016 15:18:29 +0100
Subject: [PATCH] gnu: Add php.

* gnu/packages/php.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk |   1 +
 gnu/packages/php.scm | 208 +++
 2 files changed, 209 insertions(+)
 create mode 100644 gnu/packages/php.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index ce0fdeb..7d10aa6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -295,6 +295,7 @@ GNU_SYSTEM_MODULES =\
   %D%/packages/pem.scm\
   %D%/packages/perl.scm\
   %D%/packages/photo.scm			\
+  %D%/packages/php.scm\
   %D%/packages/pkg-config.scm			\
   %D%/packages/plotutils.scm			\
   %D%/packages/polkit.scm			\
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
new file mode 100644
index 000..96e3d07
--- /dev/null
+++ b/gnu/packages/php.scm
@@ -0,0 +1,208 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Julien Lepiller 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; 

Re: [PATCH] Add php

2016-11-14 Thread Ludovic Courtès
Hi Marius,

Marius Bakke  skribis:

> Marius Bakke  writes:
>
>> Julien Lepiller  writes:
>>
 Could you send an updated patch to address those issues?  Then we can
 happily apply it.
>>> here is the updated patch. I let the tests be done because it doesn't
>>> harm, but it does no good either, so feel free to disable them if you
>>> prefer.
>>
>> Hello! I've gone through this package and made some improvements. I also
>> managed to enable the test suite, but had to resort to strace to figure
>> out what was going on (/bin/sh calls..).
>
> Oops, here is a version that actually passes `guix lint`.
>
> From 83b2913549784e5d3bafd29641e314b308f7df11 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller 
> Date: Fri, 11 Nov 2016 15:18:29 +0100
> Subject: [PATCH] gnu: Add php.
>
> * gnu/packages/php.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Thanks for the update!

> +;;"bcmath/libbcmath"

So this one is very different from ‘bc’?

> +;;"fileinfo/libmagic" ; This is a patched 
> version of libmagic.

Here adding a dependency on ‘file’ instead (the package that provides
libmagic) didn’t cut it, right?

> + (add-before 'check 'set-test-environment
> +   (lambda _
> + ;; Without this variable, `make test' passes regardless of 
> failures.
> + (setenv "REPORT_EXIT_STATUS" "1")
> + #t)))
> +   #:test-target "test"
> +   #:tests? #t))

Do you have more info as to what fails?  I wouldn’t be surprised if
there were lots of issues having to do with the use of /bin/sh, host
name lookups, and other things not available in the build environment.

Could you gather more info as to what fails so that we can either fix
it, or at least convince ourselves that these are not serious issues and
document them in a comment?

Thanks Julien & Marius!

Ludo’.



Re: [PATCH] Add php

2016-11-14 Thread Marius Bakke
Marius Bakke  writes:

> Julien Lepiller  writes:
>
>>> Could you send an updated patch to address those issues?  Then we can
>>> happily apply it.
>> here is the updated patch. I let the tests be done because it doesn't
>> harm, but it does no good either, so feel free to disable them if you
>> prefer.
>
> Hello! I've gone through this package and made some improvements. I also
> managed to enable the test suite, but had to resort to strace to figure
> out what was going on (/bin/sh calls..).

Oops, here is a version that actually passes `guix lint`.



signature.asc
Description: PGP signature
>From 83b2913549784e5d3bafd29641e314b308f7df11 Mon Sep 17 00:00:00 2001
From: Julien Lepiller 
Date: Fri, 11 Nov 2016 15:18:29 +0100
Subject: [PATCH] gnu: Add php.

* gnu/packages/php.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk |   1 +
 gnu/packages/php.scm | 204 +++
 2 files changed, 205 insertions(+)
 create mode 100644 gnu/packages/php.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index ce0fdeb..7d10aa6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -295,6 +295,7 @@ GNU_SYSTEM_MODULES =\
   %D%/packages/pem.scm\
   %D%/packages/perl.scm\
   %D%/packages/photo.scm			\
+  %D%/packages/php.scm\
   %D%/packages/pkg-config.scm			\
   %D%/packages/plotutils.scm			\
   %D%/packages/polkit.scm			\
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
new file mode 100644
index 000..67d3d4d
--- /dev/null
+++ b/gnu/packages/php.scm
@@ -0,0 +1,204 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Julien Lepiller 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see .
+
+(define-module (gnu packages php)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages algebra)
+  #:use-module (gnu packages aspell)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bison)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
+  #:use-module (gnu packages cyrus-sasl)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages gd)
+  #:use-module (gnu packages gettext)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages openldap)
+  #:use-module (gnu packages pcre)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages zip)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module ((guix licenses) #:prefix license:))
+
+(define-public php
+  (package
+(name "php")
+(version "7.0.13")
+(home-page "https://secure.php.net/";)
+(source (origin
+  (method url-fetch)
+  (uri (string-append home-page "distributions/"
+  name "-" version ".tar.xz"))
+  (sha256
+   (base32
+"1gzihbpcp51jc587gs1ryn59hsnr7vf5427dmcvdimvm77wsfyrm"))
+  (modules '((guix build utils)))
+  (snippet
+   '(with-directory-excursion "ext"
+  (for-each delete-file-recursively
+;; Some of the bundled libraries have no proper upstream.
+;; Ideally we'd extract these out as separate packages:
+;;"mbstring/libmbfl"
+;;"date/lib"
+;;"bcmath/libbcmath"
+;;"fileinfo/libmagic" ; This is a patched version of libmagic.
+'("gd/libgd"
+  "mbstring/oniguruma"
+  "pcre/pcrelib"
+  "sqlite3/libsqlite"
+  "xmlrpc/libxmlrpc"
+  "zip/lib"))
+(build-system gnu-build-system)
+(arguments
+ '(#:configure-flags
+   (let-syntax ((with (syntax-rules ()
+((_ op

Re: [PATCH] Add php

2016-11-14 Thread Marius Bakke
Julien Lepiller  writes:

>> Could you send an updated patch to address those issues?  Then we can
>> happily apply it.
> here is the updated patch. I let the tests be done because it doesn't
> harm, but it does no good either, so feel free to disable them if you
> prefer.

Hello! I've gone through this package and made some improvements. I also
managed to enable the test suite, but had to resort to strace to figure
out what was going on (/bin/sh calls..).

Unsurprisingly, many of them fail still. Some look harmless, others are
testing for some specific bugs with assigned CVEs, which is concerning.

I'm hoping some of the earlier reviewers with actual PHP experience (hi
Tobias ;-)) can have a final look at it and see if it's good to go -- I
haven't done any functionality testing of this package. We'll need a way
to fix or disable these tests however.. Tips appreciated!

Also, I tried substituting a file with ISO-8859 encoding, which fails.
It's commented out for now, but it would be nice to have it working.

Other changes done:

* Sorted inputs and build flags to make it easy to tell what's enabled.
* Added '--enable-threads'.
* Added the Zend license.
* Some comment changes -- turns out libbcmath is not actually from bc.

Finally, libxml2 is both a native and regular input. Can we be sure the
one from inputs is actually the one linked against, or should the
native-input (for xml2-config) be dropped?

Thanks for working on this! I'll be mostly offline the next two days,
but hope to finish this shortly thereafter.



signature.asc
Description: PGP signature
>From 14fbe6d734a56efa7493217a79756c36b209 Mon Sep 17 00:00:00 2001
From: Julien Lepiller 
Date: Fri, 11 Nov 2016 15:18:29 +0100
Subject: [PATCH] gnu: Add php.

* gnu/packages/php.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk |   1 +
 gnu/packages/php.scm | 204 +++
 2 files changed, 205 insertions(+)
 create mode 100644 gnu/packages/php.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index ce0fdeb..7d10aa6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -295,6 +295,7 @@ GNU_SYSTEM_MODULES =\
   %D%/packages/pem.scm\
   %D%/packages/perl.scm\
   %D%/packages/photo.scm			\
+  %D%/packages/php.scm\
   %D%/packages/pkg-config.scm			\
   %D%/packages/plotutils.scm			\
   %D%/packages/polkit.scm			\
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
new file mode 100644
index 000..d6e0f14
--- /dev/null
+++ b/gnu/packages/php.scm
@@ -0,0 +1,204 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Julien Lepiller 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see .
+
+(define-module (gnu packages php)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages algebra)
+  #:use-module (gnu packages aspell)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bison)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
+  #:use-module (gnu packages cyrus-sasl)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages gd)
+  #:use-module (gnu packages gettext)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages openldap)
+  #:use-module (gnu packages pcre)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages zip)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module ((guix licenses) #:prefix license:))
+
+(define-public php
+  (package
+(name "php")
+(version "7.0.13")
+(home-page "https://secure.php.net/";)
+(source (origin
+  (method url-fetch)
+  (uri (string-append home-page "distributions/"
+  name "-" version ".tar.xz"))
+  (sha256
+   (base32
+"1gzihbpcp51jc587gs1ryn59hsnr7vf5427dmcvdimvm77wsfyrm"))
+  (modules '((guix build utils)

Re: [PATCH] Add php

2016-11-11 Thread Julien Lepiller
On Wed, 09 Nov 2016 16:44:41 +0100
l...@gnu.org (Ludovic Courtès) wrote:

> Hello Julien,
> 
> Seems like the original reviewer (hi Marius! ;-)) missed this
> revision, so here are a few comments.
> 
> Julien Lepiller  skribis:
> 
> > From 94c512aa3c9710b65b6fce0cd108744a7c308c63 Mon Sep 17 00:00:00
> > 2001 From: Julien Lepiller 
> > Date: Sun, 30 Oct 2016 15:05:51 +0100
> > Subject: [PATCH] gnu: Add php
> >
> > * gnu/packages/php.scm: New file.
> > * gnu/packages/php.scm (php): New variable.  
> 
> Only the first line is needed.
> 
> > +  (snippet
> > +'(with-directory-excursion "ext"
> > +   (for-each delete-file-recursively
> > + `("pcre/pcrelib"
> > +   "sqlite3/libsqlite"
> > +   "gd/libgd"
> > +   "mbstring/oniguruma"
> > +   "xmlrpc/libxmlrpc"
> > +   "zip/lib"))
> > +   ;; couldn't unbundle these
> > libraries:
> > +   ;"bcmath/libbcmath" ;; this is bc.
> > +   ;"fileinfo/libmagic"
> > +   ;"mbstring/libmbfl"
> > +   ;"date/lib"  
> 
> Is it hard to unbundle ‘bc’ and ‘file’ (libmagic)?
> 
> > +(build-system gnu-build-system)
> > +(arguments
> > +   '(
> > +#:configure-flags  
> 
> Please adjust the indentation (check what other files do.)
> 
> > +  (list (string-append "--with-libxml-dir="
> > +   (assoc-ref %build-inputs
> > "libxml2"))  
> 
> I suggest this trick to make it a bit more concise:
> 
>   #:configure-flags
>   (let-syntax ((with (syntax-rules ()
>((_ option input)
> (string-append option "="
>(assoc-ref %build-inputs
> input)) (list (with "--with-libxml-dir" "libxml2")
>   (with "--with-readline" "readline")
>   …))
> 
> > +; A lot of tests fail and failure is not considered fatal.
> > +#:tests? #f))  
> 
> In what sense is it not considered fatal?  :-)
> 
> It would be nice to have some understanding of why the test fails.  If
> it turns out to be difficult to fix, we can at least document the
> problem in the comment, with enough detail.  Could you try to
> investigate a bit?
I investigated a bit, but couldn't find any reason. logs say that tests
print nothing where they should print the result, so they fail. When I
run them later from outside the build environment (with the php
executable that was built), it works perfectly fine though.

> 
> > +(license license:gpl2)));(list
> > + ; (license:non-copyleft "file://LICENSE"); the php
> > license
> > + ; license:lgpl2.1;bcmath and libmbfl
> > + ; license:bsd-2;libmagic
> > + ; license:expat)));date/lib  
> 
> So PHP itself is GPLv2-only?
> 
> Apart from that, I think we’re almost done.
> 
> Could you send an updated patch to address those issues?  Then we can
> happily apply it.
here is the updated patch. I let the tests be done because it doesn't
harm, but it does no good either, so feel free to disable them if you
prefer.

> 
> Thank you for working on it!
> 
> Ludo’.

From 22a19a5681713f6adbce84bc4c1d94d94264aa51 Mon Sep 17 00:00:00 2001
From: Julien Lepiller 
Date: Fri, 11 Nov 2016 15:18:29 +0100
Subject: [PATCH] gnu: Add php

* gnu/packages/php.scm: New file.
---
 gnu/local.mk |   1 +
 gnu/packages/php.scm | 179 +++
 2 files changed, 180 insertions(+)
 create mode 100644 gnu/packages/php.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index b3a4cd5..2ec7a91 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -293,6 +293,7 @@ GNU_SYSTEM_MODULES =\
   %D%/packages/pem.scm\
   %D%/packages/perl.scm\
   %D%/packages/photo.scm			\
+  %D%/packages/php.scm\
   %D%/packages/pkg-config.scm			\
   %D%/packages/plotutils.scm			\
   %D%/packages/polkit.scm			\
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
new file mode 100644
index 000..ce35e35
--- /dev/null
+++ b/gnu/packages/php.scm
@@ -0,0 +1,179 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Julien Lepiller 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy 

Re: [PATCH] Add php

2016-11-09 Thread Ludovic Courtès
Hello Julien,

Seems like the original reviewer (hi Marius! ;-)) missed this revision,
so here are a few comments.

Julien Lepiller  skribis:

> From 94c512aa3c9710b65b6fce0cd108744a7c308c63 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller 
> Date: Sun, 30 Oct 2016 15:05:51 +0100
> Subject: [PATCH] gnu: Add php
>
> * gnu/packages/php.scm: New file.
> * gnu/packages/php.scm (php): New variable.

Only the first line is needed.

> +  (snippet
> +'(with-directory-excursion "ext"
> +   (for-each delete-file-recursively
> + `("pcre/pcrelib"
> +   "sqlite3/libsqlite"
> +   "gd/libgd"
> +   "mbstring/oniguruma"
> +   "xmlrpc/libxmlrpc"
> +   "zip/lib"))
> +   ;; couldn't unbundle these libraries:
> +   ;"bcmath/libbcmath" ;; this is bc.
> +   ;"fileinfo/libmagic"
> +   ;"mbstring/libmbfl"
> +   ;"date/lib"

Is it hard to unbundle ‘bc’ and ‘file’ (libmagic)?

> +(build-system gnu-build-system)
> +(arguments
> +   '(
> +#:configure-flags

Please adjust the indentation (check what other files do.)

> +  (list (string-append "--with-libxml-dir="
> +   (assoc-ref %build-inputs "libxml2"))

I suggest this trick to make it a bit more concise:

  #:configure-flags
  (let-syntax ((with (syntax-rules ()
   ((_ option input)
(string-append option "="
   (assoc-ref %build-inputs input))
(list (with "--with-libxml-dir" "libxml2")
  (with "--with-readline" "readline")
  …))

> +; A lot of tests fail and failure is not considered fatal.
> +#:tests? #f))

In what sense is it not considered fatal?  :-)

It would be nice to have some understanding of why the test fails.  If
it turns out to be difficult to fix, we can at least document the
problem in the comment, with enough detail.  Could you try to
investigate a bit?

> +(license license:gpl2)));(list
> + ; (license:non-copyleft "file://LICENSE"); the php license
> + ; license:lgpl2.1;bcmath and libmbfl
> + ; license:bsd-2;libmagic
> + ; license:expat)));date/lib

So PHP itself is GPLv2-only?

Apart from that, I think we’re almost done.

Could you send an updated patch to address those issues?  Then we can
happily apply it.

Thank you for working on it!

Ludo’.



Re: [PATCH] Add php

2016-11-02 Thread Julien Lepiller
On Sun, 30 Oct 2016 23:17:58 +
Marius Bakke  wrote:

> 
> We prefer HTTPS when available, which is the case for https://php.net.
> 
> 
> Please move this to a source "snippet", so that they are not included
> in `guix build -S`. I believe we also have to list the licenses of the
> bundles that cannot be removed in the (license) field.
> 

Here is a new patch that addresses these issues.
From 94c512aa3c9710b65b6fce0cd108744a7c308c63 Mon Sep 17 00:00:00 2001
From: Julien Lepiller 
Date: Sun, 30 Oct 2016 15:05:51 +0100
Subject: [PATCH] gnu: Add php

* gnu/packages/php.scm: New file.
* gnu/packages/php.scm (php): New variable.
---
 gnu/local.mk |   1 +
 gnu/packages/php.scm | 196 +++
 2 files changed, 197 insertions(+)
 create mode 100644 gnu/packages/php.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 5fe6be5..726d935 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -292,6 +292,7 @@ GNU_SYSTEM_MODULES =\
   %D%/packages/pem.scm\
   %D%/packages/perl.scm\
   %D%/packages/photo.scm			\
+  %D%/packages/php.scm\
   %D%/packages/pkg-config.scm			\
   %D%/packages/plotutils.scm			\
   %D%/packages/polkit.scm			\
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
new file mode 100644
index 000..e3e26b8
--- /dev/null
+++ b/gnu/packages/php.scm
@@ -0,0 +1,196 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Julien Lepiller 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see .
+
+(define-module (gnu packages php)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages algebra)
+  #:use-module (gnu packages aspell)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bison)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
+  #:use-module (gnu packages cyrus-sasl)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages gd)
+  #:use-module (gnu packages gettext)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages openldap)
+  #:use-module (gnu packages pcre)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages zip)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module ((guix licenses) #:prefix license:))
+
+(define-public php
+  (package
+(name "php")
+(version "7.0.12")
+(home-page "https://www.php.net/";)
+(source (origin
+  (method url-fetch)
+  (uri (string-append home-page "distributions/"
+  name "-" version ".tar.xz"))
+  (sha256
+   (base32
+"1zw33fbkrschqr2yrmvcp1z34v4rvqzm0pn1vsamjbi43jgc9mpk"))
+  (modules '((guix build utils)))
+  (snippet
+'(with-directory-excursion "ext"
+   (for-each delete-file-recursively
+ `("pcre/pcrelib"
+   "sqlite3/libsqlite"
+   "gd/libgd"
+   "mbstring/oniguruma"
+   "xmlrpc/libxmlrpc"
+   "zip/lib"))
+   ;; couldn't unbundle these libraries:
+   ;"bcmath/libbcmath" ;; this is bc.
+   ;"fileinfo/libmagic"
+   ;"mbstring/libmbfl"
+   ;"date/lib"
+(build-system gnu-build-system)
+(arguments
+   '(
+#:configure-flags
+  (list (string-append "--with-libxml-dir="
+   (assoc-ref %build-inputs "libxml2"))
+(string-append "--with-readline="
+   (assoc-ref %build-inputs "readline"))
+(string-append "--with-sqlite3="
+   (assoc-ref %build-inputs "sqlite"))
+(string-append

Re: [PATCH] Add php

2016-11-01 Thread Leo Famulari
On Sun, Oct 30, 2016 at 01:08:28PM +0100, Julien Lepiller wrote:
> Hi,
> 
> here is a patch to add php to guix.

> From b20406a07e8d8c99a189f5295929ff76a53d47e7 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller 
> Date: Sun, 30 Oct 2016 15:05:51 +0100
> Subject: [PATCH] gnu: Add php
> 
> * gnu/packages/php.scm: New file.
> * gnu/packages/php.scm (php): New variable.

I'm very happy to see this being worked on!

Once the package is added, I hope that some people will pay attention to
PHP security bug disclosures on php.net and the oss-security mailing
list so that we can fix bugs quickly and protect our users.

Thank you :)



Re: [PATCH] Add php

2016-10-30 Thread Marius Bakke

> From 2b0d70360296a9f7639529507bea6d28d3524e06 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller 
> Date: Sun, 30 Oct 2016 15:05:51 +0100
> Subject: [PATCH] gnu: Add php
>
> * gnu/packages/php.scm: New file.
> * gnu/packages/php.scm (php): New variable.
> ---
>  gnu/local.mk |   1 +
>  gnu/packages/php.scm | 192 
> +++
>  2 files changed, 193 insertions(+)
>  create mode 100644 gnu/packages/php.scm
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 8ee8b8c..dd6a4b0 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -292,6 +292,7 @@ GNU_SYSTEM_MODULES =  \
>%D%/packages/pem.scm   \
>%D%/packages/perl.scm  \
>%D%/packages/photo.scm \
> +  %D%/packages/php.scm   \
>%D%/packages/pkg-config.scm\
>%D%/packages/plotutils.scm \
>%D%/packages/polkit.scm\
> diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
> new file mode 100644
> index 000..14d9b21
> --- /dev/null
> +++ b/gnu/packages/php.scm
> @@ -0,0 +1,192 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2016 Julien Lepiller 
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix.  If not, see .
> +
> +(define-module (gnu packages php)
> +  #:use-module (gnu packages)
> +  #:use-module (gnu packages algebra)
> +  #:use-module (gnu packages aspell)
> +  #:use-module (gnu packages base)
> +  #:use-module (gnu packages bison)
> +  #:use-module (gnu packages compression)
> +  #:use-module (gnu packages curl)
> +  #:use-module (gnu packages cyrus-sasl)
> +  #:use-module (gnu packages databases)
> +  #:use-module (gnu packages fontutils)
> +  #:use-module (gnu packages gd)
> +  #:use-module (gnu packages gettext)
> +  #:use-module (gnu packages glib)
> +  #:use-module (gnu packages gnupg)
> +  #:use-module (gnu packages image)
> +  #:use-module (gnu packages multiprecision)
> +  #:use-module (gnu packages openldap)
> +  #:use-module (gnu packages pcre)
> +  #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages readline)
> +  #:use-module (gnu packages textutils)
> +  #:use-module (gnu packages tls)
> +  #:use-module (gnu packages web)
> +  #:use-module (gnu packages xml)
> +  #:use-module (gnu packages xorg)
> +  #:use-module (gnu packages zip)
> +  #:use-module (guix packages)
> +  #:use-module (guix download)
> +  #:use-module (guix build-system gnu)
> +  #:use-module ((guix licenses) #:prefix license:))
> +
> +(define-public php
> +  (package
> +(name "php")
> +(version "7.0.12")
> +(home-page "http://www.php.net/";)

We prefer HTTPS when available, which is the case for https://php.net.

> +(source (origin
> +  (method url-fetch)
> +  (uri (string-append home-page "distributions/"
> +  name "-" version ".tar.xz"))
> +  (sha256
> +   (base32
> +"1zw33fbkrschqr2yrmvcp1z34v4rvqzm0pn1vsamjbi43jgc9mpk"
> +(build-system gnu-build-system)
> +(arguments
> +  `(#:phases
> +  (modify-phases %standard-phases
> +(add-before 'configure 'unbundle
> +  (lambda* (#:key inputs #:allow-other-keys)
> +(with-directory-excursion "ext"
> +  (for-each delete-file-recursively
> +'("pcre/pcrelib"
> +  "sqlite3/libsqlite"
> +  "gd/libgd"
> +  "mbstring/oniguruma"
> +  "xmlrpc/libxmlrpc"
> +  "zip/lib"))
> +  ;; couldn't unbundle these libraries:
> +  ;"bcmath/libbcmath" ;; this is bc.
> +  ;"fileinfo/libmagic"
> +  ;"mbstring/libmbfl"

Please move this to a source "snippet", so that they are not included in
`guix build -S`. I believe we also have to list the licenses of the
bundles that cannot be removed in the (license) field.

> +#:configure-flags
> +  (list (string-append "--with-libxml-dir="
> +

Re: [PATCH] Add php

2016-10-30 Thread Ludovic Courtès
Julien Lepiller  skribis:

> Here is a new patch that addresses your comments and Efraim's. Also I'm
> pretty sure you're not supposed to end a description with a full stop.

I’m afraid Tobias was right.  ;-)

  
https://www.gnu.org/software/guix/manual/html_node/Synopses-and-Descriptions.html

Thanks for working on PHP!

Ludo’.



Re: [PATCH] Add php

2016-10-30 Thread Julien Lepiller
On Sun, 30 Oct 2016 15:03:39 +0100
Tobias Geerinckx-Rice  wrote:

> Julien,
> 
> On 30/10/16 13:08, Julien Lepiller wrote:
> > here is a patch to add php to guix.  
> 
> Excellent! I see you've broken into my machine (probably through PHP),
> stolen my bitrotting PHP 7 package and greatly improved it. Thanks!
> 
> An incomplete review:
> 
> > +(chdir "ext")  
> [...]
> > +(chdir ".."  
> 
> Try with-directory-excursion.
> 
> > +"--enable-fpm" "-with-openssl"  
> 
> s/-with-openssl/--with-openssl/, although the option would seem
> unnecessary if the result is the same.
> 
> > +;"--with-snmp"  
> 
> Best add a comment explaining why this is unavailable, desirable, and,
> if possible, what's needed to fix it.
> 
> +#:tests? #f))
> 
> There are tests, but many fail. This should be explained in a comment
> (or fixed ;-). I keep tests enabled on my machine because I hate PHP
> and like to hear it scream.
> 
> Bonus fun fact: catastrophic test failure is non-fatal and the thing
> installs fine.
> 
> > +(synopsis "PHP programming language")
> > +(description
> > +  "PHP is one of the most commonly used programming language
> > the web")  
> 
> s/language/languages/ and a missing full stop, but it would be nice to
> add even more. For example:
> 
>   PHP (PHP Hypertext Processor) is a server-side (CGI) scripting
>   language designed primarily for web development but is also used as
>   a general-purpose programming language.  PHP code may be embedded
> into HTML code, or it can be used in combination with various web
> template systems, web content management systems and web frameworks.
> 
> Thanks again for working on this!
> 
> Kind regards,
> 
> T G-R
> 

Here is a new patch that addresses your comments and Efraim's. Also I'm
pretty sure you're not supposed to end a description with a full stop.From 2b0d70360296a9f7639529507bea6d28d3524e06 Mon Sep 17 00:00:00 2001
From: Julien Lepiller 
Date: Sun, 30 Oct 2016 15:05:51 +0100
Subject: [PATCH] gnu: Add php

* gnu/packages/php.scm: New file.
* gnu/packages/php.scm (php): New variable.
---
 gnu/local.mk |   1 +
 gnu/packages/php.scm | 192 +++
 2 files changed, 193 insertions(+)
 create mode 100644 gnu/packages/php.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 8ee8b8c..dd6a4b0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -292,6 +292,7 @@ GNU_SYSTEM_MODULES =\
   %D%/packages/pem.scm\
   %D%/packages/perl.scm\
   %D%/packages/photo.scm			\
+  %D%/packages/php.scm\
   %D%/packages/pkg-config.scm			\
   %D%/packages/plotutils.scm			\
   %D%/packages/polkit.scm			\
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
new file mode 100644
index 000..14d9b21
--- /dev/null
+++ b/gnu/packages/php.scm
@@ -0,0 +1,192 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Julien Lepiller 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see .
+
+(define-module (gnu packages php)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages algebra)
+  #:use-module (gnu packages aspell)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bison)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
+  #:use-module (gnu packages cyrus-sasl)
+  #:use-module (gnu packages databases)
+  #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages gd)
+  #:use-module (gnu packages gettext)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages openldap)
+  #:use-module (gnu packages pcre)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages web)
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages zip)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module ((guix licenses) #:prefix license:))
+
+(define-public php
+  (package
+(name "php")
+(version "7.0.12")
+(home-page "http://www.php.net/";)
+(source (origin
+

Re: [PATCH] Add php

2016-10-30 Thread Tobias Geerinckx-Rice
Julien,

On 30/10/16 13:08, Julien Lepiller wrote:
> here is a patch to add php to guix.

Excellent! I see you've broken into my machine (probably through PHP),
stolen my bitrotting PHP 7 package and greatly improved it. Thanks!

An incomplete review:

> +(chdir "ext")
[...]
> +(chdir ".."

Try with-directory-excursion.

> +"--enable-fpm" "-with-openssl"

s/-with-openssl/--with-openssl/, although the option would seem
unnecessary if the result is the same.

> +;"--with-snmp"

Best add a comment explaining why this is unavailable, desirable, and,
if possible, what's needed to fix it.

+#:tests? #f))

There are tests, but many fail. This should be explained in a comment
(or fixed ;-). I keep tests enabled on my machine because I hate PHP and
like to hear it scream.

Bonus fun fact: catastrophic test failure is non-fatal and the thing
installs fine.

> +(synopsis "PHP programming language")
> +(description
> +  "PHP is one of the most commonly used programming language
> the web")

s/language/languages/ and a missing full stop, but it would be nice to
add even more. For example:

  PHP (PHP Hypertext Processor) is a server-side (CGI) scripting
  language designed primarily for web development but is also used as
  a general-purpose programming language.  PHP code may be embedded into
  HTML code, or it can be used in combination with various web template
  systems, web content management systems and web frameworks.

Thanks again for working on this!

Kind regards,

T G-R



signature.asc
Description: OpenPGP digital signature


Re: [PATCH] Add php

2016-10-30 Thread Efraim Flashner
On Sun, Oct 30, 2016 at 01:08:28PM +0100, Julien Lepiller wrote:
> Hi,
> 
> here is a patch to add php to guix.

> From b20406a07e8d8c99a189f5295929ff76a53d47e7 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller 
> Date: Sun, 30 Oct 2016 15:05:51 +0100
> Subject: [PATCH] gnu: Add php
> 
> * gnu/packages/php.scm: New file.
> * gnu/packages/php.scm (php): New variable.
> ---
>  gnu/local.mk |   1 +
>  gnu/packages/php.scm | 187 
> +++
>  2 files changed, 188 insertions(+)
>  create mode 100644 gnu/packages/php.scm
> 
> diff --git a/gnu/local.mk b/gnu/local.mk
> index a64b7ec..6a69391 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -292,6 +292,7 @@ GNU_SYSTEM_MODULES =  \
>%D%/packages/pem.scm   \
>%D%/packages/perl.scm  \
>%D%/packages/photo.scm \
> +  %D%/packages/php.scm   \
>%D%/packages/pkg-config.scm\
>%D%/packages/plotutils.scm \
>%D%/packages/polkit.scm\
> diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
> new file mode 100644
> index 000..f7fd1e0
> --- /dev/null
> +++ b/gnu/packages/php.scm
> @@ -0,0 +1,187 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2016 Julien Lepiller 
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix.  If not, see .
> +
> +(define-module (gnu packages php)
> +  #:use-module (gnu packages)
> +  #:use-module (gnu packages algebra)
> +  #:use-module (gnu packages aspell)
> +  #:use-module (gnu packages base)
> +  #:use-module (gnu packages bison)
> +  #:use-module (gnu packages compression)
> +  #:use-module (gnu packages curl)
> +  #:use-module (gnu packages cyrus-sasl)
> +  #:use-module (gnu packages databases)
> +  #:use-module (gnu packages fontutils)
> +  #:use-module (gnu packages gd)
> +  #:use-module (gnu packages gettext)
> +  #:use-module (gnu packages glib)
> +  #:use-module (gnu packages gnupg)
> +  #:use-module (gnu packages image)
> +  #:use-module (gnu packages multiprecision)
> +  #:use-module (gnu packages pcre)
> +  #:use-module (gnu packages photo)
> +  #:use-module (gnu packages pkg-config)
> +  #:use-module (gnu packages readline)
> +  #:use-module (gnu packages textutils)
> +  #:use-module (gnu packages tls)
> +  #:use-module (gnu packages web)
> +  #:use-module (gnu packages xml)
> +  #:use-module (gnu packages xorg)
> +  #:use-module (gnu packages zip)
> +  #:use-module (guix packages)
> +  #:use-module (guix download)
> +  #:use-module (guix build-system gnu)
> +  #:use-module ((guix licenses) #:prefix license:))
> +
> +(define-public php
> +  (package
> +(name "php")
> +(version "7.0.12")
> +(home-page "http://www.php.net/";)
> +(source (origin
> +  (method url-fetch)
> +  (uri (string-append home-page "distributions/"
> +  name "-" version ".tar.xz"))
> +  (sha256
> +   (base32
> +"1zw33fbkrschqr2yrmvcp1z34v4rvqzm0pn1vsamjbi43jgc9mpk"
> +(build-system gnu-build-system)
> +(arguments
> +  `(#:phases
> +  (modify-phases %standard-phases
> +(add-before 'configure 'unbundle
> +  (lambda* (#:key inputs #:allow-other-keys)
> +(chdir "ext")
> +(for-each delete-file-recursively
> +  '("pcre/pcrelib"
> +"sqlite3/libsqlite"
> +"gd/libgd"
> +"mbstring/oniguruma"
> +"xmlrpc/libxmlrpc"
> +"zip/lib"))
> +;; couldn't unbundle these libraries:
> +;"bcmath/libbcmath" ;; this is bc.
> +;"fileinfo/libmagic"
> +;"mbstring/libmbfl"
> +(chdir ".."
> +#:configure-flags
> +  (list (string-append "--with-libxml-dir="
> +   (assoc-ref %build-inputs "libxml2"))
> +(string-append "--with-readline="
> +   (assoc-ref %build-inputs "readline"))
> +