-
-
Notifications
You must be signed in to change notification settings - Fork 383
add extra libs for curl (psl, krb5, unistring, idn2) #968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
54ceca8
aee733b
a33ca44
81dce02
ecea6c1
1fed8f2
a1b8d20
9382161
875e1d0
376b8e7
6861e9c
e8d1970
2b0a0bd
84e9f13
1e09017
1662ac4
e9ad3c0
f14df19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace SPC\builder\linux\library; | ||
|
|
||
| class idn2 extends LinuxLibraryBase | ||
| { | ||
| use \SPC\builder\unix\library\idn2; | ||
|
|
||
| public const NAME = 'idn2'; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace SPC\builder\linux\library; | ||
|
|
||
| class krb5 extends LinuxLibraryBase | ||
| { | ||
| use \SPC\builder\unix\library\krb5; | ||
|
|
||
| public const NAME = 'krb5'; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace SPC\builder\linux\library; | ||
|
|
||
| class libunistring extends LinuxLibraryBase | ||
| { | ||
| use \SPC\builder\unix\library\libunistring; | ||
|
|
||
| public const NAME = 'libunistring'; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace SPC\builder\macos\library; | ||
|
|
||
| class idn2 extends MacOSLibraryBase | ||
| { | ||
| use \SPC\builder\unix\library\idn2; | ||
|
|
||
| public const NAME = 'idn2'; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace SPC\builder\macos\library; | ||
|
|
||
| class krb5 extends MacOSLibraryBase | ||
| { | ||
| use \SPC\builder\unix\library\krb5; | ||
|
|
||
| public const NAME = 'krb5'; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace SPC\builder\macos\library; | ||
|
|
||
| class libunistring extends MacOSLibraryBase | ||
| { | ||
| use \SPC\builder\unix\library\libunistring; | ||
|
|
||
| public const NAME = 'libunistring'; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace SPC\builder\unix\library; | ||
|
|
||
| use SPC\util\executor\UnixAutoconfExecutor; | ||
|
|
||
| trait idn2 | ||
| { | ||
| protected function build(): void | ||
| { | ||
| UnixAutoconfExecutor::create($this) | ||
| ->configure( | ||
| '--disable-nls', | ||
| '--disable-doc', | ||
| '--enable-year2038', | ||
| '--disable-rpath' | ||
| ) | ||
| ->optionalLib('libiconv', "--with-libiconv-prefix={$this->getBuildRootPath()}") | ||
| ->optionalLib('libunistring', "--with-libunistring-prefix={$this->getBuildRootPath()}") | ||
| ->optionalLib('gettext', "--with-libnintl-prefix={$this->getBuildRootPath()}") | ||
| ->make(); | ||
| $this->patchPkgconfPrefix(['libidn2.pc']); | ||
| $this->patchLaDependencyPrefix(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace SPC\builder\unix\library; | ||
|
|
||
| use SPC\util\executor\UnixAutoconfExecutor; | ||
| use SPC\util\SPCConfigUtil; | ||
|
|
||
| trait krb5 | ||
| { | ||
| protected function build(): void | ||
| { | ||
| $origin_source_dir = $this->source_dir; | ||
| $this->source_dir .= '/src'; | ||
| shell()->cd($this->source_dir)->exec('autoreconf -if'); | ||
|
Comment on lines
+15
to
+16
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is no need to modify the root directory, it is best to pass the subpath directly instead of modifying it.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we pass a subpath directly? I tried searching for it, but couldn't find it.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not working for UnixAutoconfExecutor, that's why I changed it.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah that makes sense. But I think it would be more appropriate to add an arg for executor. I would make changes in 3.0 rather than this PR. I will test later to see if it affects other functions, or we can restore it at the end. |
||
| $libs = array_map(fn ($x) => $x->getName(), $this->getDependencies(true)); | ||
| $spc = new SPCConfigUtil($this->builder, ['no_php' => true, 'libs_only_deps' => true]); | ||
| $config = $spc->config(libraries: $libs, include_suggest_lib: $this->builder->getOption('with-suggested-libs', false)); | ||
| $extraEnv = [ | ||
| 'CFLAGS' => '-fcommon', | ||
| 'LIBS' => $config['libs'], | ||
| ]; | ||
| if (getenv('SPC_LD_LIBRARY_PATH') && getenv('SPC_LIBRARY_PATH')) { | ||
| $extraEnv = [...$extraEnv, ...[ | ||
| 'LD_LIBRARY_PATH' => getenv('SPC_LD_LIBRARY_PATH'), | ||
| 'LIBRARY_PATH' => getenv('SPC_LIBRARY_PATH'), | ||
| ]]; | ||
| } | ||
| $args = [ | ||
| '--disable-nls', | ||
| '--disable-rpath', | ||
| '--without-system-verto', | ||
| ]; | ||
| if (PHP_OS_FAMILY === 'Darwin') { | ||
| $extraEnv['LDFLAGS'] = '-framework Kerberos'; | ||
| $args[] = 'ac_cv_func_secure_getenv=no'; | ||
| } | ||
| UnixAutoconfExecutor::create($this) | ||
| ->appendEnv($extraEnv) | ||
| ->optionalLib('ldap', '--with-ldap', '--without-ldap') | ||
| ->optionalLib('libedit', '--with-libedit', '--without-libedit') | ||
| ->configure(...$args) | ||
| ->make(); | ||
| $this->patchPkgconfPrefix([ | ||
| 'krb5-gssapi.pc', | ||
| 'krb5.pc', | ||
| 'kadm-server.pc', | ||
| 'kadm-client.pc', | ||
| 'kdb.pc', | ||
| 'mit-krb5-gssapi.pc', | ||
| 'mit-krb5.pc', | ||
| 'gssrpc.pc', | ||
| ]); | ||
| $this->source_dir = $origin_source_dir; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace SPC\builder\unix\library; | ||
|
|
||
| use SPC\util\executor\UnixAutoconfExecutor; | ||
|
|
||
| trait libunistring | ||
| { | ||
| protected function build(): void | ||
| { | ||
| UnixAutoconfExecutor::create($this) | ||
| ->configure('--disable-nls') | ||
| ->make(); | ||
| $this->patchLaDependencyPrefix(); | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.