diff --git a/src/SPC/builder/unix/library/attr.php b/src/SPC/builder/unix/library/attr.php index d82d12f6..542fd807 100644 --- a/src/SPC/builder/unix/library/attr.php +++ b/src/SPC/builder/unix/library/attr.php @@ -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); diff --git a/src/SPC/store/SourcePatcher.php b/src/SPC/store/SourcePatcher.php index 5c7db38f..93703ce2 100644 --- a/src/SPC/store/SourcePatcher.php +++ b/src/SPC/store/SourcePatcher.php @@ -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. * diff --git a/src/globals/patch/attr_alpine_gethostname.patch b/src/globals/patch/attr_alpine_gethostname.patch new file mode 100644 index 00000000..ee6e4bdd --- /dev/null +++ b/src/globals/patch/attr_alpine_gethostname.patch @@ -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 + #include + #include ++#include + + #include \ No newline at end of file