mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 21:34:53 +08:00
add patch for attr on alpine
This commit is contained in:
parent
511fd0e301
commit
c6552f6800
@ -16,7 +16,7 @@ trait attr
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
|
||||
->execWithEnv('./autogen.sh')
|
||||
->execWithEnv('./configure --prefix= --enable-static --disable-shared --disable-tests')
|
||||
->execWithEnv('./configure --prefix= --enable-static --disable-shared')
|
||||
->execWithEnv("make -j {$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@ class SourcePatcher
|
||||
FileSystem::addSourceExtractHook('php-src', [SourcePatcher::class, 'patchImapLicense']);
|
||||
FileSystem::addSourceExtractHook('ext-imagick', [SourcePatcher::class, 'patchImagickWith84']);
|
||||
FileSystem::addSourceExtractHook('libaom', [SourcePatcher::class, 'patchLibaomForAlpine']);
|
||||
FileSystem::addSourceExtractHook('attr', [SourcePatcher::class, 'patchAttrForAlpine']);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -407,6 +408,15 @@ class SourcePatcher
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function patchAttrForAlpine(): bool
|
||||
{
|
||||
if (PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist()) {
|
||||
SourcePatcher::patchFile('attr_alpine_gethostname.patch', SOURCE_PATH . '/attr');
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch cli SAPI Makefile for Windows.
|
||||
*
|
||||
|
||||
11
src/globals/patch/attr_alpine_gethostname.patch
Normal file
11
src/globals/patch/attr_alpine_gethostname.patch
Normal file
@ -0,0 +1,11 @@
|
||||
diff --git a/tools/attr.c b/tools/attr.c
|
||||
index 312aef1..8e82810 100644
|
||||
--- a/tools/attr.c
|
||||
+++ b/tools/attr.c
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
+#include <libgen.h>
|
||||
|
||||
#include <attr/attributes.h>
|
||||
Loading…
x
Reference in New Issue
Block a user