[pkg-php-pear] Proposed release goal: PEAR package building using pkg-php-tools

Russ Allbery rra at debian.org
Thu Sep 19 15:41:57 UTC 2013


(Please cc me on replies as I'm not subscribed.)

Mathieu Parent <math.parent at gmail.com> writes:

> Unfortunately, it can't (yet). pkg-php-tools can build PEAR package
> (with a package.xml file) or Composer packages (with composer.json).
> None of those files are in the remctl repo.

Right, that's what I'd figured out.  Do those methods work with C
extensions, or are they really aimed at pure PHP?

> The extension may be turned into a PECL (i.e PEAR extension), but I
> couldn't find doc for this (you can copy an existing package.xml file
> and hack).

If it gets me away from the phpize/config.m4.in stuff, that would be
lovely.  I'll investigate further.

> PHP tooling is jungle: there is raw makefile, PEAR and PECL packages,
> Pyrus, Composer, Swig, ... None of the methods are really easy and
> straightforward (Pyrus should be, but is just an unfinished PEAR rewrite
> IMO, also not in Debian)

> As a general answer for having multiple bindings for an API, I recommend
> swig http://www.swig.org/

I'm intentionally not using SWIG because I think it produces substandard
and unnatural interfaces.  It basically translates the C API directly into
some other language, which is fine if all you need is quick-and-dirty
access to a C library from inside the language, but isn't so great if you
want a more idiomatic interface.  Not that I'm great at designing
idiomatic interfaces for PHP, but the problem with SWIG is that if you
decide you don't like the C-level interface it decides on, you mostly have
to start over from scratch; it's not easy to fine-tune it unless you build
a whole translation layer and then end up supporting two interfaces, a
low-level C one and a high-level one.

This may all just be a personal quirk.  :)

It's actually very easy and quite nice to write PHP extensions directly in
C.  The API is quite clean.  I just don't know how to get as clean of a
build process.  (At least yet.)

-- 
Russ Allbery (rra at debian.org)               <http://www.eyrie.org/~eagle/>



More information about the pkg-php-pear mailing list