Skip to content
This repository
Browse code

Remove unnecessary dependencies

Signed-off-by: Eashwar Ranganathan <crystal.dome@gmail.com>
  • Loading branch information...
commit 2cfc57510c736fe44204dbd4a01c3fe38fa2b979 1 parent 44b9763
Eashwar Ranganathan authored June 29, 2012
3  Formula/php53-midgard2.rb
@@ -15,8 +15,7 @@ def install
15 15
     ENV.universal_binary
16 16
 
17 17
     system "phpize"
18  
-    system "./configure", "--prefix=#{prefix}",
19  
-                          "--with-php-config=/usr/bin/php-config"
  18
+    system "./configure", "--prefix=#{prefix}"
20 19
     system "make"
21 20
     prefix.install "modules/midgard2.so"
22 21
   end
5  Formula/php53-redis.rb
... ...
@@ -1,9 +1,5 @@
1 1
 require 'formula'
2 2
 
3  
-def redis_installed?
4  
-  `which redis-server`.length > 0
5  
-end
6  
-
7 3
 class Php53Redis < Formula
8 4
   homepage 'https://github.com/nicolasff/phpredis'
9 5
   url 'https://github.com/nicolasff/phpredis/tarball/2.2.0'
@@ -11,7 +7,6 @@ class Php53Redis < Formula
11 7
   head 'https://github.com/nicolasff/phpredis.git'
12 8
 
13 9
   depends_on 'autoconf' => :build
14  
-  depends_on 'redis' => :recommended unless redis_installed?
15 10
 
16 11
   fails_with :clang do
17 12
     build 318
13  Formula/php53.rb
... ...
@@ -1,9 +1,5 @@
1 1
 require 'formula'
2 2
 
3  
-def mysql_installed?
4  
-  `which mysql_config`.length > 0
5  
-end
6  
-
7 3
 def postgres_installed?
8 4
   `which pg_config`.length > 0
9 5
 end
@@ -31,10 +27,6 @@ class Php53 < Formula
31 27
   # Sanity Checks
32 28
   if ARGV.include? '--with-mysql' and ARGV.include? '--with-mariadb'
33 29
     raise "Cannot specify more than one MySQL variant to build against."
34  
-  elsif ARGV.include? '--with-mysql'
35  
-    depends_on 'mysql' => :recommended unless mysql_installed?
36  
-  elsif ARGV.include? '--with-mariadb'
37  
-    depends_on 'mariadb' => :recommended unless mysql_installed?
38 30
   end
39 31
 
40 32
   if ARGV.include? '--with-pgsql'
@@ -172,9 +164,12 @@ def install
172 164
       args << "--with-pdo-mysql=mysqlnd"
173 165
     end
174 166
 
175  
-    if ARGV.include? '--with-pgsql'
  167
+    if ARGV.include? '--with-pgsql' and File.directory? Formula.factory('postgresql').prefix.to_s
176 168
       args << "--with-pgsql=#{Formula.factory('postgresql').prefix}"
177 169
       args << "--with-pdo-pgsql=#{Formula.factory('postgresql').prefix}"
  170
+    elsif ARGV.include? '--with-pgsql'
  171
+      args << "--with-pgsql=#{`pg_config --includedir`}"
  172
+      args << "--with-pdo-pgsql=#{`which pg_config`}"
178 173
     end
179 174
 
180 175
     if ARGV.include? '--with-unixodbc'
3  Formula/php54-midgard2.rb
@@ -15,8 +15,7 @@ def install
15 15
     ENV.universal_binary
16 16
 
17 17
     system "phpize"
18  
-    system "./configure", "--prefix=#{prefix}",
19  
-                          "--with-php-config=/usr/bin/php-config"
  18
+    system "./configure", "--prefix=#{prefix}"
20 19
     system "make"
21 20
     prefix.install "modules/midgard2.so"
22 21
   end
5  Formula/php54-redis.rb
... ...
@@ -1,9 +1,5 @@
1 1
 require 'formula'
2 2
 
3  
-def redis_installed?
4  
-  `which redis-server`.length > 0
5  
-end
6  
-
7 3
 class Php54Redis < Formula
8 4
   homepage 'https://github.com/nicolasff/phpredis'
9 5
   url 'https://github.com/nicolasff/phpredis/tarball/2.2.0'
@@ -11,7 +7,6 @@ class Php54Redis < Formula
11 7
   head 'https://github.com/nicolasff/phpredis.git'
12 8
 
13 9
   depends_on 'autoconf' => :build
14  
-  depends_on 'redis' => :recommended unless redis_installed?
15 10
 
16 11
   fails_with :clang do
17 12
     build 318
13  Formula/php54.rb
... ...
@@ -1,9 +1,5 @@
1 1
 require 'formula'
2 2
 
3  
-def mysql_installed?
4  
-  `which mysql_config`.length > 0
5  
-end
6  
-
7 3
 def postgres_installed?
8 4
   `which pg_config`.length > 0
9 5
 end
@@ -32,10 +28,6 @@ class Php54 < Formula
32 28
   # Sanity Checks
33 29
   if ARGV.include? '--with-mysql' and ARGV.include? '--with-mariadb'
34 30
     raise "Cannot specify more than one MySQL variant to build against."
35  
-  elsif ARGV.include? '--with-mysql'
36  
-    depends_on 'mysql' => :recommended unless mysql_installed?
37  
-  elsif ARGV.include? '--with-mariadb'
38  
-    depends_on 'mariadb' => :recommended unless mysql_installed?
39 31
   end
40 32
 
41 33
   if ARGV.include? '--with-pgsql'
@@ -181,9 +173,12 @@ def install
181 173
       args << "--with-pdo-mysql=mysqlnd"
182 174
     end
183 175
 
184  
-    if ARGV.include? '--with-pgsql'
  176
+    if ARGV.include? '--with-pgsql' and File.directory? Formula.factory('postgresql').prefix.to_s
185 177
       args << "--with-pgsql=#{Formula.factory('postgresql').prefix}"
186 178
       args << "--with-pdo-pgsql=#{Formula.factory('postgresql').prefix}"
  179
+    elsif ARGV.include? '--with-pgsql'
  180
+      args << "--with-pgsql=#{`pg_config --includedir`}"
  181
+      args << "--with-pdo-pgsql=#{`which pg_config`}"
187 182
     end
188 183
 
189 184
     if ARGV.include? '--with-unixodbc'

0 notes on commit 2cfc575

Please sign in to comment.
Something went wrong with that request. Please try again.