files() public static method

public static files ( $files )
Ejemplo n.º 1
0
 public function rules()
 {
     $rules = array();
     $rules[] = RegExpPatchRule::files('Makefile')->allOf(array('/^BUILD_/'))->replaces('/\\$\\(CC\\)/', '$(CXX)');
     $rules[] = RegExpPatchRule::files('Makefile')->allOf(array('/^EXTRA_LIBS =/'))->replaces('/^(.*)$/', '$1 -lstdc++');
     return $rules;
 }
Ejemplo n.º 2
0
 public function rules()
 {
     $rules = array();
     /*
     This is for replacing something like this:
     
     SAPI_SHARED=libs/libphp$PHP_MAJOR_VERSION.$SHLIB_DL_SUFFIX_NAME
     SAPI_STATIC=libs/libphp$PHP_MAJOR_VERSION.a
     SAPI_LIBTOOL=libphp$PHP_MAJOR_VERSION.la
     
     OVERALL_TARGET=libphp$PHP_MAJOR_VERSION.la
     
     OVERALL_TARGET=libs/libphp$PHP_MAJOR_VERSION.bundle
     
     SAPI_SHARED=libs/libphp5.so
     */
     $rules[] = RegExpPatchRule::files(array('configure'))->always()->replaces('#libphp\\$PHP_MAJOR_VERSION\\.#', 'libphp$PHP_VERSION.');
     $rules[] = RegExpPatchRule::files(array('configure'))->always()->replaces('#libs/libphp[57].(so|la)#', 'libs/libphp\\$PHP_VERSION.$1');
     $rules[] = RegExpPatchRule::files(array('Makefile.global'))->always()->replaces('#libphp\\$\\(PHP_MAJOR_VERSION\\)#', 'libphp$(PHP_VERSION)');
     return $rules;
 }
Ejemplo n.º 3
0
 public function rules()
 {
     /*
     Macports
      -lssl /opt/local/lib/libssl.dylib
      -lcrypto /opt/local/lib/libcrypto.dylib
     
     HomeBrew
      /usr/local/opt/openssl/lib/libssl.dylib
      /usr/local/opt/openssl/lib/libcrypto.dylib
     */
     $dylibssl = null;
     $dylibcrypto = null;
     $paths = array('/opt/local/lib/libssl.dylib', '/usr/local/opt/openssl/lib/libssl.dylib', '/usr/local/lib/libssl.dylib', '/usr/lib/libssl.dylib');
     foreach ($paths as $path) {
         if (file_exists($path)) {
             $dylibssl = $path;
             break;
         }
     }
     $paths = array('/opt/local/lib/libcrypto.dylib', '/usr/local/opt/openssl/lib/libcrypto.dylib', '/usr/local/lib/libcrypto.dylib', '/usr/lib/libcrypto.dylib');
     foreach ($paths as $path) {
         if (file_exists($path)) {
             $dylibcrypto = $path;
             break;
         }
     }
     $rules = array();
     if ($dylibssl) {
         $rules[] = RegExpPatchRule::files('Makefile')->allOf(array('/^EXTRA_LIBS =/'))->replaces('/-lssl/', $dylibssl);
     }
     if ($dylibcrypto) {
         $rules[] = RegExpPatchRule::files('Makefile')->allOf(array('/^EXTRA_LIBS =/'))->replaces('/-lcrypto/', $dylibcrypto);
     }
     return $rules;
 }