tech-pkg archive

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

Re: Scripts with PHP shebang & mbedtls (wip/hiawatha)



Kevin Bloom <ktnb%posteo.net@localhost> writes:

> I'm working on bringing www/hiawatha up-to-date in wip/hiawatha and
> I'm running into an issue with some of the installed php scripts
> that get installed, namely, `lefh`. This is an optional (it isn't
> optional in my pkgsrc recipe) script that does some stuff with
> Let's Encrypt. I have in the Makefile a REPLACE_PHP which works
> but gives me a /usr/pkg/bin/php not found error during install
> phase. When I add php as a dependency or as a bl3 it always fails
> the checksum for php. Even if I use a bl3 to php83 it tries to
> install php82. I'm not sure if there is something else required
> for php that I'm missing or what. Any ideas that could be causing
> this?

I think you need to decide on one of three paths:

  A) the file is installed and the package depends on php

  B) the file is not installed

  C) make hiawatha-letsencrypt or hiawatha-scripts that installs just
  the script and depends on php, while base is option B.

A and B are easy.  A gets users php when they don't want it, and B makes
them fish the LE script out of source if they want it.  C is the right
answer probably, but it's actual work -- but maybe not that much.  I
don't know how big hiawatha is and how much php hurts, and how to choose
between A and B.

There is a way to say php is needed, and which versions are acceptable.
One needs to include

  ../../lang/php/phpversion.mk 

I am not sure why 82 isn't ok (that's strange in 2024), but if upstream
documents 8.3 only, then that's how it is.  Set PHP_VERSIONS_ACCEPTED
(but read the mk file below for docs).

I think you might be about to say "but it doesn't really depend, and it
would be nice to not require it at build time, and let the script work
at runtime if php is there".  Maybe, but pkgsrc doesn't do that; it
means the "for all programs with #!, the interpreter is there" and "if
you install it, things all work, regardless of what else" properties are
broken.

I don't follow

  When I add php as a dependency or as a bl3 it always fails the
  checksum for php.

what if you add application.mk and set PHP_VERSIONS_ACCPETED=83?


Home | Main Index | Thread Index | Old Index