示例#1
0
 public function apply()
 {
     foreach ($this->paths as $relativePath) {
         $absolutePath = $this->build->getSourceDirectory() . DIRECTORY_SEPARATOR . $relativePath;
         $contents = $this->read($absolutePath);
         $this->backup($absolutePath, $contents);
         $newContents = $this->applyRules($contents);
         $this->write($absolutePath, $newContents);
     }
 }
示例#2
0
 /**
  * This seems also related to 5.4 when 'intl' is enabled: --enable-intl.
  *
  * This is due to intl/msgformat/msgformat_helpers.cpp being a C++ file and
  * GCC not handling that case cleanly. The exact error is specifically due
  * to GCC not linking to libstdc++. Which is, actually, kinda reasonable
  * since it's been invoked as a plain C compiler. Anyway, you can get
  * around the problem for now by adding
  * "/usr/lib/gcc/i686-apple-darwin9/4.2.1/libstdc++.dylib" (if you're
  * building with gcc-4.2) or
  * "/usr/lib/gcc/i686-apple-darwin9/4.0.1/libstdc++.dylib" (if you're
  * building with gcc-4.0, the default) to your LDFLAGS. That's right,
  * WITHOUT -l or -L. I wouldn't consider this a real solution, but a better
  * solution is pending further research into the subject.
  *
  * This fixes the build error:
  *      --------------
  *      Undefined symbols:
  *      "___gxx_personality_v0", referenced from:
  *          EH_frame1 in msgformat_helpers.o
  *      ld: symbol(s) not found
  *      collect2: ld returned 1 exit status
  *      make: *** [sapi/cgi/php-cgi] Error 1
  *
  * https://bugs.php.net/bug.php?id=48795
  * https://blog.gcos.me/2012-10-19_how-to-compile-php53-on-64bit-linux-macos.html
  *
  * Related Platform:
  *
  * - Ubuntu 11.04 http://www.serverphorums.com/read.php?7,369479
  * - Ubuntu 14.04 https://github.com/phpbrew/phpbrew/issues/707
  * - Ubuntu 12.04
  * - CentOS 7 x86_64
  * - OS X 10.5
  * - OS X 10.6
  */
 public function match(Buildable $build, Logger $logger)
 {
     return $build->isEnabledVariant('intl') && version_compare($build->getVersion(), '5.4', '<=');
 }
 public function match(Buildable $build, Logger $logger)
 {
     return $build->isEnabledVariant('apxs2');
 }
示例#4
0
 public function apply(Buildable $build, Logger $logger)
 {
     $patched = 0;
     foreach ($this->files as $file) {
         $path = $build->getSourceDirectory() . DIRECTORY_SEPARATOR . $file;
         if (!file_exists($path)) {
             $logger->error("file {$path} doesn't exist in the build directory.");
             continue;
         }
         if ($content = file_get_contents($path)) {
             $content = $this->applyTextContent($content, $patched);
             if (false === file_put_contents($path, $content)) {
                 $logger->error("Patch on {$path} write failed.");
             }
         }
     }
     return $patched;
 }
示例#5
0
 public function clean(Buildable $build)
 {
     return $this->make($build->getSourceDirectory(), 'clean');
 }
示例#6
0
 public function match(Buildable $build, Logger $logger)
 {
     // todo: not sure if this works for linux?
     return $build->osName === 'Darwin' && version_compare($build->getVersion(), '5.3.29') === 0;
 }
示例#7
0
 public function match(Buildable $build, Logger $logger)
 {
     return $build->osName === 'Darwin' && version_compare($build->osRelease, '15.0.0') > 0 && $build->isEnabledVariant('openssl');
 }