File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,25 @@ public function tryPatchMakefileUnix(): void
161161 shell ()->cd (SOURCE_PATH . '/php-src ' )->exec ('sed -i "s|//lib|/lib|g" Makefile ' );
162162 }
163163
164+ #[BeforeStage('php ' , [self ::class, 'makeForUnix ' ], 'php ' )]
165+ #[PatchDescription('Patch info.c to hide configure command in release builds ' )]
166+ public function patchInfoCForRelease (): void
167+ {
168+ if (str_contains ((string ) getenv ('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS ' ), '-release ' )) {
169+ FileSystem::replaceFileLineContainsString (
170+ SOURCE_PATH . '/php-src/ext/standard/info.c ' ,
171+ '#ifdef CONFIGURE_COMMAND ' ,
172+ '#ifdef NO_CONFIGURE_COMMAND ' ,
173+ );
174+ } else {
175+ FileSystem::replaceFileLineContainsString (
176+ SOURCE_PATH . '/php-src/ext/standard/info.c ' ,
177+ '#ifdef NO_CONFIGURE_COMMAND ' ,
178+ '#ifdef CONFIGURE_COMMAND ' ,
179+ );
180+ }
181+ }
182+
164183 #[Stage]
165184 public function makeForUnix (TargetPackage $ package , PackageInstaller $ installer ): void
166185 {
You can’t perform that action at this time.
0 commit comments