File tree Expand file tree Collapse file tree 4 files changed +109
-0
lines changed
Expand file tree Collapse file tree 4 files changed +109
-0
lines changed Original file line number Diff line number Diff line change 1+ libcares :
2+ type : library
3+ artifact :
4+ source :
5+ type : ghrel
6+ repo : c-ares/c-ares
7+ match : c-ares-.+\.tar\.gz
8+ prefer-stable : true
9+ source-mirror :
10+ type : filelist
11+ url : ' https://c-ares.org/download/'
12+ regex : ' /href="\/download\/(?<file>c-ares-(?<version>[^"]+)\.tar\.gz)"/'
13+ binary : hosted
14+ metadata :
15+ license-files : [LICENSE.md]
16+ headers@unix :
17+ - ares.h
18+ - ares_dns.h
19+ - ares_nameser.h
20+ static-libs@unix :
21+ - libcares.a
22+ pkg-configs :
23+ - libcares
Original file line number Diff line number Diff line change 1+ zstd :
2+ type : library
3+ artifact :
4+ source :
5+ type : ghrel
6+ repo : facebook/zstd
7+ match : zstd.+\.tar\.gz
8+ prefer-stable : true
9+ metadata :
10+ license-files : [LICENSE]
11+ license : BSD-3-Clause
12+ headers@unix :
13+ - zdict.h
14+ - zstd.h
15+ - zstd_errors.h
16+ static-libs@unix :
17+ - libzstd.a
18+ pkg-configs :
19+ - libzstd
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Package \Library ;
6+
7+ use StaticPHP \Attribute \Package \BuildFor ;
8+ use StaticPHP \Attribute \Package \Library ;
9+ use StaticPHP \Attribute \Package \PatchBeforeBuild ;
10+ use StaticPHP \Attribute \PatchDescription ;
11+ use StaticPHP \Package \LibraryPackage ;
12+ use StaticPHP \Runtime \Executor \UnixAutoconfExecutor ;
13+ use StaticPHP \Util \FileSystem ;
14+
15+ #[Library('libcares ' )]
16+ class libcares
17+ {
18+ #[PatchBeforeBuild]
19+ #[PatchDescription('Add missing dnsinfo.h for Apple platforms ' )]
20+ public function patchBeforeBuild (LibraryPackage $ lib ): bool
21+ {
22+ if (!file_exists ("{$ lib ->getSourceDir ()}/src/lib/thirdparty/apple/dnsinfo.h " )) {
23+ FileSystem::createDir ("{$ lib ->getSourceDir ()}/src/lib/thirdparty/apple " );
24+ copy (ROOT_DIR . '/src/globals/extra/libcares_dnsinfo.h ' , "{$ lib ->getSourceDir ()}/src/lib/thirdparty/apple/dnsinfo.h " );
25+ return true ;
26+ }
27+ return false ;
28+ }
29+
30+ #[BuildFor('Linux ' )]
31+ #[BuildFor('Darwin ' )]
32+ public function build (LibraryPackage $ lib ): void
33+ {
34+ UnixAutoconfExecutor::create ($ lib )->configure ('--disable-tests ' )->make ();
35+
36+ $ lib ->patchPkgconfPrefix (['libcares.pc ' ], PKGCONF_PATCH_PREFIX );
37+ }
38+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Package \Library ;
6+
7+ use StaticPHP \Attribute \Package \BuildFor ;
8+ use StaticPHP \Attribute \Package \Library ;
9+ use StaticPHP \Package \LibraryPackage ;
10+ use StaticPHP \Runtime \Executor \UnixCMakeExecutor ;
11+
12+ #[Library('zstd ' )]
13+ class zstd
14+ {
15+ #[BuildFor('Linux ' )]
16+ #[BuildFor('Darwin ' )]
17+ public function build (LibraryPackage $ lib ): void
18+ {
19+ UnixCMakeExecutor::create ($ lib )
20+ ->setBuildDir ("{$ lib ->getSourceDir ()}/build/cmake/build " )
21+ ->addConfigureArgs (
22+ '-DZSTD_BUILD_STATIC=ON ' ,
23+ '-DZSTD_BUILD_SHARED=OFF ' ,
24+ )
25+ ->build ();
26+
27+ $ lib ->patchPkgconfPrefix (['libzstd.pc ' ], PKGCONF_PATCH_PREFIX );
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments