-
-
Notifications
You must be signed in to change notification settings - Fork 381
Expand file tree
/
Copy pathattr.php
More file actions
23 lines (19 loc) · 692 Bytes
/
attr.php
File metadata and controls
23 lines (19 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
declare(strict_types=1);
namespace Package\Artifact;
use StaticPHP\Artifact\Artifact;
use StaticPHP\Attribute\Artifact\AfterSourceExtract;
use StaticPHP\Attribute\PatchDescription;
use StaticPHP\Util\SourcePatcher;
use StaticPHP\Util\System\LinuxUtil;
class attr
{
#[AfterSourceExtract('attr')]
#[PatchDescription('Patch attr for Alpine Linux (musl) and macOS - gethostname declaration')]
public function patchAttrForAlpine(Artifact $artifact): void
{
if (PHP_OS_FAMILY === 'Darwin' || PHP_OS_FAMILY === 'Linux' && LinuxUtil::isMuslDist()) {
SourcePatcher::patchFile('attr_alpine_gethostname.patch', $artifact->getSourceDir());
}
}
}