unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: Hartmut Goebel <h.goebel@crazy-compilers.com>,
	guix-devel <guix-devel@gnu.org>
Subject: Re: How to "tell" a package so extent an environment variable?
Date: Sun, 11 Dec 2016 18:41:50 +0100	[thread overview]
Message-ID: <87d1gymkgx.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <584D5B85.20806@crazy-compilers.com>

[-- Attachment #1: Type: text/plain, Size: 1226 bytes --]

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Hi,
>
> I'm working on some PHP extension packages.
>
> In PHP extensions need to be enabled by listing in some .ini file and
> php needs to be told which .ini files to read. The later can be done by
> setting the environment variable PHP_INI_SCAN_DIR when running php (or
> related). This is much like setting PYTHONPATH for python modules.
>
> So I need to "tell" the package so extent PHP_INI_SCAN_DIR when it gets
> installed.
>
> How can this be done without creating a php-build-system?

If PHP can read multiple INI files (which the variable name leads me to
believe), you can add a 'native-search-path' to the PHP expression and
have each extension register an INI file in this directory.

For example:

(define-public php
[...]
    (native-search-paths
     (list (search-path-specification
            (variable "PHP_INI_SCAN_DIR")
            ;; This might not be the best place to add them.
            (files '("php/ini")))))

And then, for extensions, they should install an INI file that enables
them to $out/php/ini. When users install PHP, PHP_INI_SCAN_DIR will be
pointed towards the users' .guix-profile/php/ini directory.

Would this approach work?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2016-12-11 17:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-11 13:58 How to "tell" a package so extent an environment variable? Hartmut Goebel
2016-12-11 17:41 ` Marius Bakke [this message]
2016-12-12 10:17   ` Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d1gymkgx.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me \
    --to=mbakke@fastmail.com \
    --cc=guix-devel@gnu.org \
    --cc=h.goebel@crazy-compilers.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).