all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to "tell" a package so extent an environment variable?
@ 2016-12-11 13:58 Hartmut Goebel
  2016-12-11 17:41 ` Marius Bakke
  0 siblings, 1 reply; 3+ messages in thread
From: Hartmut Goebel @ 2016-12-11 13:58 UTC (permalink / raw)
  To: guix-devel

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?

(Creating a php-build-system is too much time-consuming for me right now.)

-- 
Regards
Hartmut Goebel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to "tell" a package so extent an environment variable?
  2016-12-11 13:58 How to "tell" a package so extent an environment variable? Hartmut Goebel
@ 2016-12-11 17:41 ` Marius Bakke
  2016-12-12 10:17   ` Hartmut Goebel
  0 siblings, 1 reply; 3+ messages in thread
From: Marius Bakke @ 2016-12-11 17:41 UTC (permalink / raw)
  To: Hartmut Goebel, guix-devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to "tell" a package so extent an environment variable?
  2016-12-11 17:41 ` Marius Bakke
@ 2016-12-12 10:17   ` Hartmut Goebel
  0 siblings, 0 replies; 3+ messages in thread
From: Hartmut Goebel @ 2016-12-12 10:17 UTC (permalink / raw)
  To: Marius Bakke, guix-devel

Am 11.12.2016 um 18:41 schrieb Marius Bakke:
> If PHP can read multiple INI files (which the variable name leads me to

Yes, PHP can read multiple INI files.

> (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.

I assume, the INI files of all extension packages will be linked into
.guix-profile/php/ini. Right? So this would work.

But when building he extension, I'd expect PHP_INI_SCAN_DIR to be set in
/var/tmp/guix-build-….drv-0/environment-variables. But it isn't there.
(For building I would need the header files, not the .ini files, or
course. But this should work the same, shouldn't it?)

-- 
Regards
Hartmut Goebel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-12 10:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-11 13:58 How to "tell" a package so extent an environment variable? Hartmut Goebel
2016-12-11 17:41 ` Marius Bakke
2016-12-12 10:17   ` Hartmut Goebel

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.