add patch for attr on alpine

This commit is contained in:
Marc Henderkes 2025-03-10 09:46:20 +01:00
parent 511fd0e301
commit c6552f6800
3 changed files with 22 additions and 1 deletions

View File

@ -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);

View File

@ -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.
*

View 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>