-
-
Notifications
You must be signed in to change notification settings - Fork 339
V3 feat/re2c #992
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
Merged
Merged
V3 feat/re2c #992
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a1cadec
Refactor re2c fix-item
crazywhalecc 80d922a
Use patch for current package exclusively
crazywhalecc 20e0711
Add libedit package build
crazywhalecc 11e7a59
Add ncurses package build
crazywhalecc 321f2e1
Allow all types of package can be built
crazywhalecc f4bb026
Fix ncurses static-libs
crazywhalecc b384345
Add php-micro patch for embed mode
crazywhalecc 80128ed
Add patch description display
crazywhalecc 78234ef
Add missing patchPkgconfPrefix function
crazywhalecc 7b16f68
Allow package implementation using parent class functions
crazywhalecc a4bd2a7
Add shared extension build support
crazywhalecc 0db26be
Correct SAPI-packages to be installed
crazywhalecc e004d10
Fix phpstan
crazywhalecc 808aed2
Refactor package stage handling and update class structures for impro…
crazywhalecc ac01867
Refactor stage execution to use method references for improved clarity
crazywhalecc b0f630f
Add package outputs, colorize motd
crazywhalecc bcaef59
Support full --no-ansi options
crazywhalecc 4a96875
Update src/Package/Library/ncurses.php
crazywhalecc f68adc3
Update src/Package/Target/php.php
crazywhalecc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Package\Library; | ||
|
|
||
| use StaticPHP\Attribute\Package\BeforeStage; | ||
| use StaticPHP\Attribute\Package\BuildFor; | ||
| use StaticPHP\Attribute\Package\Library; | ||
| use StaticPHP\Package\LibraryPackage; | ||
| use StaticPHP\Runtime\Executor\UnixAutoconfExecutor; | ||
| use StaticPHP\Util\FileSystem; | ||
|
|
||
| #[Library('libedit')] | ||
| class libedit extends LibraryPackage | ||
| { | ||
| #[BeforeStage(stage: 'build')] | ||
| public function patchBeforeBuild(): void | ||
| { | ||
| FileSystem::replaceFileRegex( | ||
| "{$this->getSourceDir()}/src/sys.h", | ||
| '|//#define\s+strl|', | ||
| '#define strl' | ||
| ); | ||
| } | ||
|
|
||
| #[BuildFor('Darwin')] | ||
| #[BuildFor('Linux')] | ||
| public function build(): void | ||
| { | ||
| UnixAutoconfExecutor::create($this) | ||
| ->appendEnv(['CFLAGS' => '-D__STDC_ISO_10646__=201103L']) | ||
| ->configure() | ||
| ->make(); | ||
| $this->patchPkgconfPrefix(['libedit.pc']); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Package\Library; | ||
|
|
||
| use StaticPHP\Attribute\Package\BuildFor; | ||
| use StaticPHP\Attribute\Package\Library; | ||
| use StaticPHP\Package\LibraryPackage; | ||
| use StaticPHP\Runtime\Executor\UnixAutoconfExecutor; | ||
| use StaticPHP\Toolchain\Interface\ToolchainInterface; | ||
| use StaticPHP\Util\DirDiff; | ||
| use StaticPHP\Util\FileSystem; | ||
|
|
||
| #[Library('ncurses')] | ||
| class ncurses | ||
| { | ||
| #[BuildFor('Darwin')] | ||
| #[BuildFor('Linux')] | ||
| public function build(LibraryPackage $package, ToolchainInterface $toolchain): void | ||
| { | ||
| $dirdiff = new DirDiff(BUILD_BIN_PATH); | ||
|
|
||
| UnixAutoconfExecutor::create($package) | ||
| ->appendEnv([ | ||
| 'LDFLAGS' => $toolchain->isStatic() ? '-static' : '', | ||
| ]) | ||
| ->configure( | ||
| '--enable-overwrite', | ||
| '--with-curses-h', | ||
| '--enable-pc-files', | ||
| '--enable-echo', | ||
| '--disable-widec', | ||
| '--with-normal', | ||
| '--with-ticlib', | ||
| '--without-tests', | ||
| '--without-dlsym', | ||
| '--without-debug', | ||
| '--enable-symlinks', | ||
| "--bindir={$package->getBinDir()}", | ||
| "--includedir={$package->getIncludeDir()}", | ||
| "--libdir={$package->getLibDir()}", | ||
| "--prefix={$package->getBuildRootPath()}", | ||
| ) | ||
| ->make(); | ||
| $new_files = $dirdiff->getIncrementFiles(true); | ||
| foreach ($new_files as $file) { | ||
| @unlink(BUILD_BIN_PATH . '/' . $file); | ||
| } | ||
|
|
||
| shell()->cd(BUILD_ROOT_PATH)->exec('rm -rf share/terminfo'); | ||
| shell()->cd(BUILD_ROOT_PATH)->exec('rm -rf lib/terminfo'); | ||
|
|
||
| $pkgconf_list = ['form.pc', 'menu.pc', 'ncurses++.pc', 'ncurses.pc', 'panel.pc', 'tic.pc']; | ||
| $package->patchPkgconfPrefix($pkgconf_list); | ||
|
|
||
| foreach ($pkgconf_list as $pkgconf) { | ||
| FileSystem::replaceFileStr("{$package->getLibDir()}/pkgconfig/{$pkgconf}", "-L{$package->getLibDir()}", '-L${libdir}'); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Package\Target; | ||
|
|
||
| use StaticPHP\Attribute\Package\BeforeStage; | ||
| use StaticPHP\Attribute\Package\Target; | ||
| use StaticPHP\Attribute\PatchDescription; | ||
| use StaticPHP\Package\TargetPackage; | ||
| use StaticPHP\Util\FileSystem; | ||
|
|
||
| #[Target('php-micro')] | ||
| class micro | ||
| { | ||
| #[BeforeStage('php', [php::class, 'makeEmbedForUnix'], 'php-micro')] | ||
| #[PatchDescription('Patch Makefile to build only libphp.la for embedding')] | ||
| public function patchBeforeEmbed(TargetPackage $package): void | ||
| { | ||
| FileSystem::replaceFileStr("{$package->getSourceDir()}/Makefile", 'OVERALL_TARGET =', 'OVERALL_TARGET = libphp.la'); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.