mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
Add idn2
This commit is contained in:
parent
e4d6723b01
commit
2e8f6bbb31
21
config/pkg/lib/idn2.yml
Normal file
21
config/pkg/lib/idn2.yml
Normal file
@ -0,0 +1,21 @@
|
||||
idn2:
|
||||
type: library
|
||||
artifact:
|
||||
source:
|
||||
type: filelist
|
||||
url: 'https://ftp.gnu.org/gnu/libidn/'
|
||||
regex: '/href="(?<file>libidn2-(?<version>[^"]+)\.tar\.gz)"/'
|
||||
metadata:
|
||||
license-files: ['COPYING.LESSERv3']
|
||||
license: LGPL-3.0-or-later
|
||||
pkg-configs:
|
||||
- libidn2
|
||||
headers:
|
||||
- idn2.h
|
||||
suggests@unix:
|
||||
- libiconv
|
||||
- gettext
|
||||
- libunistring
|
||||
depends@macos:
|
||||
- libiconv
|
||||
- gettext
|
||||
33
src/Package/Library/idn2.php
Normal file
33
src/Package/Library/idn2.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Package\Library;
|
||||
|
||||
use StaticPHP\Attribute\Package\BuildFor;
|
||||
use StaticPHP\Attribute\Package\Library;
|
||||
use StaticPHP\Package\LibraryPackage;
|
||||
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||
|
||||
#[Library('idn2')]
|
||||
class idn2
|
||||
{
|
||||
#[BuildFor('Linux')]
|
||||
#[BuildFor('Darwin')]
|
||||
public function build(LibraryPackage $lib): void
|
||||
{
|
||||
UnixAutoconfExecutor::create($lib)
|
||||
->configure(
|
||||
'--disable-nls',
|
||||
'--disable-doc',
|
||||
'--enable-year2038',
|
||||
'--disable-rpath'
|
||||
)
|
||||
->optionalPackage('libiconv', '--with-libiconv-prefix=' . BUILD_ROOT_PATH)
|
||||
->optionalPackage('libunistring', '--with-libunistring-prefix=' . BUILD_ROOT_PATH)
|
||||
->optionalPackage('gettext', '--with-libnintl-prefix=' . BUILD_ROOT_PATH)
|
||||
->make();
|
||||
$lib->patchPkgconfPrefix(['libidn2.pc']);
|
||||
$lib->patchLaDependencyPrefix();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user