Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial stab at build a plugin, with stub functionality

  • Loading branch information...
commit 91ade96dcbf16a7954f3b29366b7c7c636de8e50 1 parent 4d64752
@jhs jhs authored
Showing with 43 additions and 3 deletions.
  1. +14 −0 README.md
  2. +28 −3 tasks/couchdb.rake
  3. +1 −0  tasks/places.rb
View
14 README.md
@@ -158,6 +158,20 @@ Want to build [GeoCouch][geocouch]? No problem.
rake git="git://github.com/vmx/couchdb geocouch"
+### CouchDB Plugins
+
+Any CouchDB plugin can be loaded remotely from Git, built, and installed
+into the final CouchDB system.
+
+ rake plugin="git://github.com/vmx/couchdb origin/gc-separate"
+
+Multiple plugins can be processed together:
+
+ rake plugins="git://github.com/vmx/couchdb origin/gc-separate,git://github.com/somebody/whatever some_tag"
+
+(Both `plugin` and `plugins` supports comma-separated lists; use whichever
+you remember better.)
+
### Install CouchDB somewhere besides `build/`.
Add a `couchdb_build` parameter to place the final couchdb binaries anywhere.
View
31 tasks/couchdb.rake
@@ -12,7 +12,7 @@ namespace :couchdb do
task :dependencies => :deps
desc 'Build CouchDB'
- task :build => couchdb_build_deps + [COUCH_BIN]
+ task :build => couchdb_build_deps + [:plugins, COUCH_BIN]
desc 'Build CouchDB and then clean out unnecessary things like autotools'
task :clean_install => :build do
@@ -25,10 +25,19 @@ namespace :couchdb do
end
end
+ file COUCH_SOURCE => :known_distro do
+ git_checkout(ENV['git']) if ENV['git']
+ end
+
+ task :plugins => COUCH_SOURCE do
+ # This task will be assigned dependencies dynamically, see the "plugins" stuff below.
+ puts "Plugins done"
+ end
+
directory "#{BUILD}/var/run/couchdb"
- file COUCH_BIN => [AUTOCONF_259, "#{BUILD}/var/run/couchdb"] do
- source = ENV['git'] ? git_checkout(ENV['git']) : "#{DEPS}/couchdb"
+ file COUCH_BIN => [COUCH_SOURCE, AUTOCONF_259, "#{BUILD}/var/run/couchdb"] do
+ source = COUCH_SOURCE
begin
Dir.chdir(source) do
@@ -69,4 +78,20 @@ namespace :couchdb do
end
end
+ # Determine what plugins are desired and have them built.
+ plugins = (ENV['plugin'] || "") + "," + (ENV['plugins'] || "")
+ plugins.split(',').select{|x| ! x.strip.empty? }.each do |git_plugin|
+ remote, commit = git_plugin.split
+ plugin_mark = "#{COUCH_BUILD}/lib/build-couchdb/plugins/#{git_checkout_name remote}/#{commit}"
+
+ task :plugins => plugin_mark
+ file plugin_mark => 'environment:path' do
+ source = git_checkout(git_plugin)
+ Dir.chdir(source) do
+ ENV['COUCH_SRC'] = "#{COUCH_SOURCE}/src/couchdb"
+ gmake
+ end
+ end
+ end
+
end
View
1  tasks/places.rb
@@ -3,6 +3,7 @@
JS_LIB = "#{BUILD}/bin/js-config"
ERL_BIN = "#{BUILD}/bin/erl"
ICU_BIN = "#{BUILD}/bin/icu-config"
+COUCH_SOURCE = ENV['git'] ? git_checkout(ENV['git'], :noop => true) : "#{DEPS}/couchdb"
COUCH_BUILD = ENV['couchdb_build'] || BUILD
COUCH_BIN = "#{COUCH_BUILD}/bin/couchdb"
MANIFESTS = "#{BUILD}/manifests"
Please sign in to comment.
Something went wrong with that request. Please try again.