Permalink
Browse files

rip out jeweler, use bundler skeleton task

  • Loading branch information...
1 parent 1debb6f commit 3f9e869264b827b619d1997d2bd93be40fd5eff7 @mwotton committed Feb 23, 2011
Showing with 73 additions and 223 deletions.
  1. +10 −6 Gemfile
  2. +1 −1 Haskell/Language/Ruby/Hubris/GHCBuild.hs
  3. +4 −3 Haskell/hubris.cabal
  4. +32 −119 Rakefile
  5. +2 −1 ext/hubris.rb
  6. +24 −93 hubris.gemspec
View
@@ -1,7 +1,11 @@
source :rubygems
-gem 'jeweler', '1.5.1'
-gem 'gemcutter'
-gem 'rspec', '1.3.0'
-gem 'rake'
-gem 'rake-compiler'
-gem 'open4'
+# gem 'jeweler', '1.5.1'
+# gem 'gemcutter'
+# gem 'rspec', '1.3.0'
+# gem 'rake'
+# gem 'rake-compiler'
+# gem 'open4'
+# source "http://rubygems.org"
+
+# Specify your gem's dependencies in Hubris.gemspec
+gemspec
@@ -11,7 +11,7 @@ import Control.Monad(forM_,guard)
import System.IO(hPutStr, hClose, openTempFile)
import System( exitWith, system)
import System.Exit
-import Includes (extraIncludeDirs) -- this is generated by Cabal
+import Language.Ruby.Hubris.Includes (extraIncludeDirs) -- this is generated by Cabal
newtype GHCOptions = GHCOptions { strict :: Bool }
@@ -21,7 +21,8 @@ Description: Support library for Hubris, the Ruby to Haskell bridge
Library
-- the ordering is critical, because Cabal doesn't do dependency analysis.
- Exposed-Modules: Language.Ruby.Hubris.Binding, Language.Ruby.Hubris, Language.Ruby.Hubris.LibraryBuilder, Language.Ruby.Hubris.ZCode, Language.Ruby.Hubris.GHCBuild, Includes
+ Exposed-Modules: Language.Ruby.Hubris.Binding, Language.Ruby.Hubris, Language.Ruby.Hubris.LibraryBuilder, Language.Ruby.Hubris.ZCode, Language.Ruby.Hubris.GHCBuild,Language.Ruby.Hubris.Includes
+-- , Language.Ruby.Hubris.Includes
c-sources: cbits/rshim.c
-- includes: cbits/rshim.h
install-includes: cbits/rshim.h
@@ -33,11 +34,11 @@ Library
--extra-include-dirs=/opt/local/include/ruby-1.9.1/
--extra-lib-dirs: /opt/local/lib
extra-libraries: ruby
- build-depends: ghc, Cabal>=1.7.4 && < 2.0, base, haskell98, containers, bytestring, array, mtl, old-time, ghc-paths, hint >= 0.3.3.2, HUnit
+ build-depends: ghc, Cabal>=1.7.4 && < 2.0, base, haskell98, containers, bytestring, array, mtl, old-time, ghc-paths, hint >= 0.3.3.2, HUnit
Executable Hubrify
Main-is: Hubrify.hs
- Build-Depends: base >= 3 && < 5, ghc, Cabal>=1.7.4 && < 2.0, base, haskell98, containers, bytestring, array, mtl, old-time, ghc-paths, hint, process
+ Build-Depends: base >= 3 && < 5, Cabal>=1.7.4 && < 2.0, base, haskell98, containers, bytestring, array, mtl, old-time, ghc-paths, hint, process,ghc
Other-Modules: Language.Ruby.Hubris.Binding
c-sources: cbits/rshim.c
include-dirs: cbits
View
@@ -1,141 +1,54 @@
-require 'rubygems'
-require 'rake'
-
-require 'fileutils'
-begin
- require 'jeweler'
-
- jeweler_tasks = Jeweler::Tasks.new do |gem|
- gem.name = "hubris"
- gem.summary = "a bridge between Haskell and Ruby"
- gem.description = "a bridge between Haskell and Ruby"
- gem.email = "mwotton@gmail.com"
- gem.homepage = "http://github.com/mwotton/hubris"
- gem.add_development_dependency("rspec", "= 1.3.0")
- gem.add_dependency("open4")
- gem.add_dependency("rake-compiler")
- gem.extensions = FileList["ext/**/extconf.rb"]
- gem.authors = ["Mark Wotton", "Josh Price", "James Britt"]
- gem.files.include('lib/stub.*')
- end
- $gemspec = jeweler_tasks.gemspec
- # black magic: http://karottenreibe.github.com/2009/10/25/jeweler-interlude/
- $gemspec.version = jeweler_tasks.jeweler.version
- Jeweler::GemcutterTasks.new
-
-rescue LoadError
- puts "Jeweler not available. Install it with: gem install jeweler"
-end
+require 'bundler'
+Bundler::GemHelper.install_tasks
+require 'rake'
+require 'fileutils'
# require 'rake-compiler'
require 'rake/extensiontask'
# require 'rake/extensiontesttask'
-Rake::ExtensionTask.new('stub', $gemspec) do |ext|
- # ext.cross_compile = true
- # ext.cross_platform = 'x86-mswin32'
- # ext.test_files = FileList['test/c/*']
-end
-
-# CLEAN.include 'lib/**/*.so'
-Rake::Task.tasks.each do |task_name|
- case task_name.to_s
- when /^native/
- task_name.prerequisites.unshift("fix_rake_compiler_gemspec_dump")
- end
-end
+# task "build:native" => [:no_extconf, :native, :build] do
+# file = "pkg/stub-#{`cat VERSION`.chomp}.gem"
+# mv file, "#{file.ext}-i686-linux.gem"
+# end
-task :fix_rake_compiler_gemspec_dump do
- %w{files extra_rdoc_files test_files}.each do |accessor|
- $gemspec.send(accessor).instance_eval {
- @exclude_procs = Array.new
- }
- end
-end
-desc("Build linux and windows specific gems")
-task :gems do
- sh "rake clean build:native"
- sh "rake clean build:cross"
- sh "rake clean build"
-end
+Rake::ExtensionTask.new('stub')
-task "build:native" => [:no_extconf, :native, :build] do
- file = "pkg/stub-#{`cat VERSION`.chomp}.gem"
- mv file, "#{file.ext}-i686-linux.gem"
+# intended to be called by the gem builder
+task :haskell_compile => [:compile] do
+ ghc_version='/usr/local/bin/ghc' # FIXME, should be able to pick
+ # this out from somewhere
+ # write the Includes file
+ pwd =`pwd`.strip
+ arch_headers = "#{RbConfig::CONFIG['rubyhdrdir']}/#{RbConfig::CONFIG['arch']}"
+ lib_dir = RbConfig::CONFIG['libdir']
+ headers = RbConfig::CONFIG['rubyhdrdir']
+ File.open("#{pwd}/Haskell/Language/Ruby/Hubris/Includes.hs","w") do |file|
+ file.write "module Language.Ruby.Hubris.Includes where
+extraIncludeDirs = [\"#{headers}\", \"#{arch_headers}\"]"
+ end
+# command="cd Haskell; cabal update; cabal install
+ # --extra-include-dirs=#{RbConfig::CONFIG['rubyhdrdir']}
+ # --extra-include-dirs=#{RbConfig::CONFIG['rubyhdrdir']}/#{RbConfig::CONFIG['arch']} --extra-lib-dirs=#{RbConfig::CONFIG['libdir']} --user --enable-shared --with-ghc=#{ghc_version}"
+ command="cd Haskell; cabal install --extra-include-dirs=#{arch_headers} --extra-include-dirs=#{headers} --extra-lib-dirs=#{lib_dir} --user --enable-shared --with-ghc=#{ghc_version}"
+ result=%x{#{command}}
+ raise "ERROR: ran #{command}, got #{result}" unless $?.success?
end
task :no_extconf do
$gemspec.extensions = []
end
-begin
- require 'spec/rake/spectask'
- Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
- end
-
-
- Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
- end
-
- rescue LoadError
-
-end
-
-# task :spec => :check_dependencies
-
-begin
- require 'reek/adapters/rake_task'
- Reek::RakeTask.new do |t|
- t.fail_on_error = true
- t.verbose = false
- t.source_files = 'lib/**/*.rb'
- end
-rescue LoadError
- task :reek do
- abort "Reek is not available. In order to run reek, you must: sudo gem install reek"
- end
-end
-
-begin
- require 'roodi'
- require 'roodi_task'
- RoodiTask.new do |t|
- t.verbose = false
- end
-rescue LoadError
- task :roodi do
- abort "Roodi is not available. In order to run roodi, you must: sudo gem install roodi"
- end
-end
-
-task :default => :spec
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "mygem #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
-
+task :default => :haskell_compile
task :clean do
FileList[File.expand_path("~/.hubris_cache/*"),
- 'lib*.so', 'lib/*.o', 'libfoo_*.bundle' ].each do |f|
- begin
- File.delete(f)
- rescue
- end
+ 'lib*.so', 'lib/*.o' ].each do |f|
+ File.delete(f) rescue nil
end
end
+
View
@@ -1,3 +1,4 @@
puts "I AM A BANANA"
-raise "FUCK YOOOOOOOOOOOOU"
+# raise "FUCK YOOOOOOOOOOOOU"
+system "touch Makefile"
View
@@ -1,100 +1,31 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "hubris/version"
+require 'rake'
Gem::Specification.new do |s|
- s.name = %q{hubris}
- s.version = "0.0.3"
+ s.name = "hubris"
+ s.version = Hubris::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Mark Wotton", "James Britt", "Josh Price"]
+ s.email = ["mwotton@gmail.com"]
+ s.homepage = "http://rubygems.org/gems/hubris"
+ s.summary = %q{A bridge between Ruby and Haskell}
+ s.description = %q{A bridge between Ruby and Haskell}
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Mark Wotton", "Josh Price", "James Britt"]
- s.date = %q{2010-12-28}
- s.description = %q{a bridge between Haskell and Ruby}
- s.email = %q{mwotton@gmail.com}
- s.executables = ["ghc_builder", "jhc_builder"]
- s.extensions = ["ext/stub/extconf.rb"]
- s.extra_rdoc_files = [
- "README.markdown"
- ]
- s.files = [
- ".gitignore",
- ".rvmrc",
- "Gemfile",
- "HISTORY.markdown",
- "Haskell/Hubrify.hs",
- "Haskell/LICENSE",
- "Haskell/Language/Ruby/Foo.hs",
- "Haskell/Language/Ruby/Hubris.hs",
- "Haskell/Language/Ruby/Hubris/GHCBuild.hs",
- "Haskell/Language/Ruby/Hubris/Hash.hs",
- "Haskell/Language/Ruby/Hubris/Interpolator.hs",
- "Haskell/Language/Ruby/Hubris/LibraryBuilder.hs",
- "Haskell/Language/Ruby/Hubris/ZCode.hs",
- "Haskell/Language/Ruby/Wrappers.hs",
- "Haskell/Language/Ruby/testLib.hs",
- "Haskell/Setup.hs",
- "Haskell/cbits/rshim.c",
- "Haskell/cbits/rshim.h",
- "Haskell/hubris.cabal",
- "INSTALL",
- "Manifest.txt",
- "PostInstall.txt",
- "README.markdown",
- "Rakefile",
- "VERSION",
- "bin/ghc_builder",
- "bin/jhc_builder",
- "doc/CommonErrors.txt",
- "doc/CommonErrors.txt~HEAD",
- "doc/don_feedback.txt",
- "doc/haskell-hubris.tex",
- "doc/new_interface.rb",
- "doc/ruby-hubris.tex",
- "doc/wisdom_of_ancients.txt",
- "ext/stub/extconf.rb",
- "ext/stub/stub.c",
- "hubris.gemspec",
- "lib/Makefile",
- "lib/hubris.rb",
- "rspec.rake",
- "sample/Fibonacci.hs",
- "sample/config.ru",
- "script/ci.sh",
- "script/console",
- "spec/hubris_spec.rb",
- "spec/spec.opts",
- "spec/spec_helper.rb",
- "tasks/extconf.rake",
- "tasks/extconf/stub.rake"
- ]
- s.homepage = %q{http://github.com/mwotton/hubris}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
- s.summary = %q{a bridge between Haskell and Ruby}
- s.test_files = [
- "spec/hubris_spec.rb",
- "spec/spec_helper.rb"
- ]
+ s.rubyforge_project = "Hubris"
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+
+ s.require_paths = ["lib"]
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rspec>, ["= 1.3.0"])
- s.add_runtime_dependency(%q<open4>, [">= 0"])
- s.add_runtime_dependency(%q<rake-compiler>, [">= 0"])
- else
- s.add_dependency(%q<rspec>, ["= 1.3.0"])
- s.add_dependency(%q<open4>, [">= 0"])
- s.add_dependency(%q<rake-compiler>, [">= 0"])
- end
- else
- s.add_dependency(%q<rspec>, ["= 1.3.0"])
- s.add_dependency(%q<open4>, [">= 0"])
- s.add_dependency(%q<rake-compiler>, [">= 0"])
- end
+ s.add_dependency 'rake-compiler', '>= 0.7.6'
+ s.add_development_dependency 'rspec', '1.3.0'
+ s.add_dependency 'rake'
+ s.add_dependency 'open4'
+ s.extensions = 'Rakefile' # ext/mkrf_conf.rb'
+ # system "bundle exec rake compile"
+ # Rake::Task['compile'].invoke
end
-

0 comments on commit 3f9e869

Please sign in to comment.