From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: [PATCH] gnu: Add php-hello-world. Date: Thu, 8 Dec 2016 18:45:32 +0100 Message-ID: <1481219132-27353-1-git-send-email-h.goebel@crazy-compilers.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cF2lI-0006Sy-GF for guix-devel@gnu.org; Thu, 08 Dec 2016 12:45:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cF2lF-0002B7-DE for guix-devel@gnu.org; Thu, 08 Dec 2016 12:45:40 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:54757) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cF2lF-0002Av-6V for guix-devel@gnu.org; Thu, 08 Dec 2016 12:45:37 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3tZN7M1Vtdz3hjJq for ; Thu, 8 Dec 2016 18:45:35 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3tZN7M0Tv4zvnFp for ; Thu, 8 Dec 2016 18:45:35 +0100 (CET) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id b54wmnd17jy4 for ; Thu, 8 Dec 2016 18:45:33 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-188-174-144-224.dynamic.mnet-online.de [188.174.144.224]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for ; Thu, 8 Dec 2016 18:45:33 +0100 (CET) Received: from lenashee.goebel-consult.de (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 068F860108 for ; Thu, 8 Dec 2016 18:45:33 +0100 (CET) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/php.scm (php-hello-world): New variable. --- gnu/packages/php.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm index 9ccbede..f860f88 100644 --- a/gnu/packages/php.scm +++ b/gnu/packages/php.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Julien Lepiller ;;; Copyright © 2016 Marius Bakke +;;; Copyright © 2016 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -48,6 +49,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) #:use-module ((guix licenses) #:prefix license:)) ;; This fixes PHP bugs 73155 and 73159. Remove when gd @@ -332,3 +334,38 @@ systems, web content management systems and web frameworks." ) license:lgpl2.1+ ; ext/bcmath/libbcmath license:bsd-2 ; ext/fileinfo/libmagic license:expat)))) ; ext/date/lib + +(define-public php-hello-world + (package + (name "php-hello-world") + (version "0.1") + (source #f) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((out (assoc-ref %outputs "out")) + (php (assoc-ref %build-inputs "php")) + (index.php (string-append out "/index.php"))) + (mkdir-p out) + (call-with-output-file index.php + (lambda (p) + (format p " + PHP test page: Hello, Guix! + + Hello, Guix!'; ?> +

Today is:

+ +~%"))) + (chmod index.php #o555))))) + (inputs + `(("php" ,php))) + (synopsis "Hello, PHP world: An example PHP package") + (description + "PHP Hello World creates a simple HTML page saying \"Hello, Guix!\" and +the current date. It serves as an example to be used in Guix PHP packages or +services.") + (home-page "http://php.net/manual/en/tutorial.firstpage.php") + (license license:gpl3+))) -- 2.7.4