mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 09:25:35 +08:00
Add idn2
This commit is contained in:
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user