mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Add libargon2
This commit is contained in:
parent
3cfab10f85
commit
39a207076e
@ -1,18 +1,11 @@
|
||||
imagemagick:
|
||||
type: library
|
||||
artifact:
|
||||
source: {
|
||||
"type": "ghtar",
|
||||
"repo": "ImageMagick/ImageMagick"
|
||||
}
|
||||
source:
|
||||
type: ghtar
|
||||
repo: ImageMagick/ImageMagick
|
||||
metadata:
|
||||
license-files: [LICENSE]
|
||||
lang: cpp
|
||||
pkg-configs: [
|
||||
"Magick++-7.Q16HDRI",
|
||||
"MagickCore-7.Q16HDRI",
|
||||
"MagickWand-7.Q16HDRI"
|
||||
]
|
||||
depends:
|
||||
- zlib
|
||||
- libjpeg
|
||||
@ -28,5 +21,8 @@ imagemagick:
|
||||
- xz
|
||||
- libzip
|
||||
- libxml2
|
||||
|
||||
|
||||
lang: cpp
|
||||
pkg-configs:
|
||||
- Magick++-7.Q16HDRI
|
||||
- MagickCore-7.Q16HDRI
|
||||
- MagickWand-7.Q16HDRI
|
||||
|
||||
@ -1,14 +1,13 @@
|
||||
imap:
|
||||
type: library
|
||||
artifact:
|
||||
source: {
|
||||
"type": "git",
|
||||
"url": "https://github.com/static-php/imap.git",
|
||||
"rev": "master"
|
||||
}
|
||||
source:
|
||||
type: git
|
||||
url: 'https://github.com/static-php/imap.git'
|
||||
rev: master
|
||||
metadata:
|
||||
license-files: [LICENSE]
|
||||
static-libs@unix:
|
||||
- libc-client.a
|
||||
suggests@unix:
|
||||
- openssl
|
||||
static-libs@unix:
|
||||
- libc-client.a
|
||||
|
||||
@ -6,7 +6,7 @@ libacl:
|
||||
metadata:
|
||||
license-files: [doc/COPYING.LGPL]
|
||||
license: LGPL-2.1-or-later
|
||||
static-libs@unix:
|
||||
- libacl.a
|
||||
depends:
|
||||
- attr
|
||||
static-libs@unix:
|
||||
- libacl.a
|
||||
|
||||
14
config/pkg/lib/libargon2.yml
Normal file
14
config/pkg/lib/libargon2.yml
Normal file
@ -0,0 +1,14 @@
|
||||
libargon2:
|
||||
type: library
|
||||
artifact:
|
||||
source:
|
||||
type: git
|
||||
rev: master
|
||||
url: 'https://github.com/static-php/phc-winner-argon2'
|
||||
metadata:
|
||||
license-files: [LICENSE]
|
||||
license: BSD-2-Clause
|
||||
suggests:
|
||||
- libsodium
|
||||
static-libs@unix:
|
||||
- libargon2.a
|
||||
@ -1,19 +1,13 @@
|
||||
libzip:
|
||||
type: library
|
||||
artifact:
|
||||
source: {
|
||||
"type": "ghrel",
|
||||
"repo": "nih-at/libzip",
|
||||
"match": "libzip.+\\.tar\\.xz",
|
||||
"prefer-stable": true
|
||||
}
|
||||
source:
|
||||
type: ghrel
|
||||
repo: nih-at/libzip
|
||||
match: libzip.+\.tar\.xz
|
||||
prefer-stable: true
|
||||
metadata:
|
||||
license-files: [LICENSE]
|
||||
static-libs@unix:
|
||||
- libzip.a
|
||||
headers:
|
||||
- zip.h
|
||||
- zipconf.h
|
||||
depends@unix:
|
||||
- zlib
|
||||
suggests@unix:
|
||||
@ -21,3 +15,8 @@ libzip:
|
||||
- xz
|
||||
- zstd
|
||||
- openssl
|
||||
headers:
|
||||
- zip.h
|
||||
- zipconf.h
|
||||
static-libs@unix:
|
||||
- libzip.a
|
||||
|
||||
48
src/Package/Library/libargon2.php
Normal file
48
src/Package/Library/libargon2.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Package\Library;
|
||||
|
||||
use StaticPHP\Attribute\Package\BuildFor;
|
||||
use StaticPHP\Attribute\Package\Library;
|
||||
use StaticPHP\Attribute\Package\PatchBeforeBuild;
|
||||
use StaticPHP\Attribute\PatchDescription;
|
||||
use StaticPHP\Package\LibraryPackage;
|
||||
use StaticPHP\Package\PackageBuilder;
|
||||
use StaticPHP\Runtime\SystemTarget;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
|
||||
#[Library('libargon2')]
|
||||
class libargon2
|
||||
{
|
||||
#[PatchBeforeBuild]
|
||||
#[PatchDescription('Fix library path for Linux builds')]
|
||||
public function patchBeforeLinuxBuild(LibraryPackage $lib): void
|
||||
{
|
||||
spc_skip_if(SystemTarget::getTargetOS() !== 'Linux', 'Not a Linux build, skipping lib path patch.');
|
||||
FileSystem::replaceFileStr("{$lib->getSourceDir()}/Makefile", 'LIBRARY_REL ?= lib/x86_64-linux-gnu', 'LIBRARY_REL ?= lib');
|
||||
}
|
||||
|
||||
#[BuildFor('Darwin')]
|
||||
#[BuildFor('Linux')]
|
||||
public function buildUnix(LibraryPackage $lib, PackageBuilder $builder): void
|
||||
{
|
||||
shell()->cd($lib->getSourceDir())->initializeEnv($lib)
|
||||
->exec("make PREFIX='' clean")
|
||||
->exec("make -j{$builder->concurrency} PREFIX=''")
|
||||
->exec("make install PREFIX='' DESTDIR={$lib->getBuildRootPath()}");
|
||||
|
||||
$lib->patchPkgconfPrefix(['libargon2.pc']);
|
||||
|
||||
foreach (FileSystem::scanDirFiles("{$lib->getBuildRootPath()}/lib/", false, true) as $filename) {
|
||||
if (str_starts_with($filename, 'libargon2') && (str_contains($filename, '.so') || str_ends_with($filename, '.dylib'))) {
|
||||
unlink("{$lib->getBuildRootPath()}/lib/{$filename}");
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists("{$lib->getBinDir()}/argon2")) {
|
||||
unlink("{$lib->getBinDir()}/argon2");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user