[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] gnu: Add php.
From: |
David Thompson |
Subject: |
[PATCH 2/2] gnu: Add php. |
Date: |
Thu, 29 Jan 2015 16:44:59 -0500 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) |
>From 320aedada4de414e83c4c4207717d48a6ca1bbbc Mon Sep 17 00:00:00 2001
From: David Thompson <address@hidden>
Date: Sun, 16 Nov 2014 13:48:11 -0500
Subject: [PATCH 2/2] gnu: Add php.
* gnu/packages/patches/php-fix-configure.patch: New file.
* gnu/packages/php.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
---
gnu-system.am | 1 +
gnu/packages/patches/php-fix-configure.patch | 68 +++++++++++++
gnu/packages/php.scm | 144 +++++++++++++++++++++++++++
3 files changed, 213 insertions(+)
create mode 100644 gnu/packages/patches/php-fix-configure.patch
create mode 100644 gnu/packages/php.scm
diff --git a/gnu-system.am b/gnu-system.am
index f09b5bd..db70fa9 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -219,6 +219,7 @@ GNU_SYSTEM_MODULES = \
gnu/packages/pem.scm \
gnu/packages/perl.scm \
gnu/packages/photo.scm \
+ gnu/packages/php.scm \
gnu/packages/pkg-config.scm \
gnu/packages/plotutils.scm \
gnu/packages/polkit.scm \
diff --git a/gnu/packages/patches/php-fix-configure.patch
b/gnu/packages/patches/php-fix-configure.patch
new file mode 100644
index 0000000..e25057f
--- /dev/null
+++ b/gnu/packages/patches/php-fix-configure.patch
@@ -0,0 +1,68 @@
+diff -ru php-5.4.14/configure php-5.4.14-new/configure
+--- php-5.4.14/configure 2013-04-10 09:53:26.000000000 +0200
++++ php-5.4.14-new/configure 2013-04-22 17:13:55.039043622 +0200
+@@ -6513,7 +6513,7 @@
+
+ case $host_alias in
+ *aix*)
+- APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR`
++ APXS_LIBEXECDIR="$prefix/modules"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl
-Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
+ PHP_AIX_LDFLAGS="-Wl,-brtl"
+ build_type=shared
+@@ -6706,7 +6706,7 @@
+ if test "$?" != "0"; then
+ APACHE_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not
have -S option
+ else
+- APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
++ APXS_LIBEXECDIR="$prefix/modules"
+ if test -z `$APXS -q SYSCONFDIR`; then
+ APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+@@ -7909,7 +7909,7 @@
+ { (exit 1); exit 1; }; }
+ fi
+
+- APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
++ APXS_LIBEXECDIR="$prefix/modules"
+ if test -z `$APXS -q SYSCONFDIR`; then
+ INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+@@ -8779,7 +8779,7 @@
+ { (exit 1); exit 1; }; }
+ fi
+
+- APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
++ APXS_LIBEXECDIR="$prefix/modules"
+ if test -z `$APXS -q SYSCONFDIR`; then
+ INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+@@ -9634,7 +9634,7 @@
+
+ case $host_alias in
+ *aix*)
+- APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR`
++ APXS_LIBEXECDIR="$prefix/modules"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl
-Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
+ PHP_AIX_LDFLAGS="-Wl,-brtl"
+ build_type=shared
+@@ -9827,7 +9827,7 @@
+ if test "$?" != "0"; then
+ APACHE_HOOKS_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does
not have -S option
+ else
+- APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
++ APXS_LIBEXECDIR="$prefix/modules"
+ if test -z `$APXS -q SYSCONFDIR`; then
+ APACHE_HOOKS_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+@@ -59657,9 +59657,7 @@
+
+
+ if test "$PHP_GETTEXT" != "no"; then
+- for i in $PHP_GETTEXT /usr/local /usr; do
+- test -r $i/include/libintl.h && GETTEXT_DIR=$i && break
+- done
++ GETTEXT_DIR=$PHP_GETTEXT
+
+ if test -z "$GETTEXT_DIR"; then
+ { { $as_echo "$as_me:$LINENO: error: Cannot locate header file libintl.h"
>&5
diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm
new file mode 100644
index 0000000..06dbb86
--- /dev/null
+++ b/gnu/packages/php.scm
@@ -0,0 +1,144 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014 David Thompson <address@hidden>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages php)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages)
+ #:use-module (guix download)
+ #:use-module (guix utils)
+ #:use-module (guix build-system gnu)
+ #:use-module (gnu packages)
+ #: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 icu4c)
+ #:use-module (gnu packages image)
+ #:use-module (gnu packages mcrypt)
+ #:use-module (gnu packages multiprecision)
+ #:use-module (gnu packages openldap)
+ #:use-module (gnu packages openssl)
+ #:use-module (gnu packages pcre)
+ #:use-module (gnu packages perl)
+ #:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages readline)
+ #:use-module (gnu packages video)
+ #:use-module (gnu packages web)
+ #:use-module (gnu packages xml)
+ #:use-module (gnu packages xorg))
+
+(define-public php
+ (package
+ (name "php")
+ (version "5.6.3")
+ (source (origin
+ (method url-fetch)
+ ;; TODO: Use a mirror.
+ (uri (string-append "http://us1.php.net/distributions/php-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "1da44by82grcjfx4yjjlv4b96kwsqfrjk0dsdbjhzwf7di849lps"))
+ ;; Taken from nixpkgs. Fixes gettext and some module issues.
+ (patches (list (search-patch "php-fix-configure.patch")))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:configure-flags (let ((with (lambda* (name input #:optional (extra
""))
+ (string-append "--with-" name "="
+ (assoc-ref %build-inputs
+ input)
+ extra))))
+ (list (with "libxml-dir" "libxml2")
+ (with "xsl" "libxslt")
+ (with "zlib" "zlib")
+ (with "bz2" "bzip2")
+ (with "curl" "curl")
+ (with "pcre-dir" "pcre")
+ (with "openssl" "openssl")
+ (with "openssl-dir" "openssl")
+ (with "gd" "gd")
+ (with "vpx-dir" "libvpx")
+ (with "jpeg-dir" "libjpeg")
+ (with "png-dir" "libpng")
+ (with "xpm-dir" "libxpm")
+ (with "freetype-dir" "freetype")
+ (with "gettext" "gettext")
+ (with "gmp" "gmp")
+ (with "ldap" "openldap")
+ (with "ldap-sasl" "cyrus-sasl")
+ (with "mcrypt" "libmcrypt")
+ (with "pdo-mysql" "mysql")
+ (with "pdo-pgsql" "postgresql")
+ (with "pdo-sqlite" "sqlite")
+ (with "readline" "readline")
+ (with "icu-dir" "icu4c")
+ ;; FIXME: This breaks the build!
+ ;; (with "apxs2" "httpd" "/bin/apxs")
+ "--enable-exif"
+ "--enable-ftp"
+ "--enable-calendar"
+ "--enable-intl"
+ "--enable-gd-native-ttf"
+ "--enable-bcmath"
+ "--enable-soap"
+ "--enable-sockets"
+ "--enable-mbtring"
+ "--enable-zip"
+ "--enable-fpm"
+ "--enable-pcntl"
+ "--enable-opcache"))
+ ;; FIXME: The tests fail but a status code of 0 is returned.
+ #:test-target "test"))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("perl" ,perl)))
+ (inputs
+ `(("gmp" ,gmp)
+ ("libxml2" ,libxml2)
+ ("libxslt" ,libxslt)
+ ("readline" ,readline)
+ ("curl" ,curl)
+ ("zlib" ,zlib)
+ ("bzip2" ,bzip2)
+ ("mysql" ,mysql)
+ ("postgresql" ,postgresql)
+ ("sqlite" ,sqlite)
+ ("gd" ,gd)
+ ("libvpx" ,libvpx)
+ ("libjpeg" ,libjpeg)
+ ("libpng" ,libpng)
+ ("libxpm" ,libxpm)
+ ("libx11" ,libx11)
+ ("freetype" ,freetype)
+ ("openssl" ,openssl)
+ ("openldap" ,openldap)
+ ("cyrus-sasl" ,cyrus-sasl)
+ ("libmcrypt" ,libmcrypt)
+ ("pcre" ,pcre)
+ ("httpd" ,httpd)
+ ("icu4c" ,icu4c)))
+ (synopsis "PHP programming language interpreter")
+ (description "PHP is a general-purpose scripting language that is
+especially suited to web development.")
+ (home-page "http://php.net")
+ ;; TODO: Add and use the PHP license.
+ (license license:expat)))
--
2.1.4
--
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate