guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to "tell" a package so extent an environment variable?


From: Marius Bakke
Subject: Re: How to "tell" a package so extent an environment variable?
Date: Sun, 11 Dec 2016 18:41:50 +0100
User-agent: Notmuch/0.23.3 (https://notmuchmail.org) Emacs/25.1.1 (x86_64-unknown-linux-gnu)

Hartmut Goebel <address@hidden> 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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]