Skip to content

Instantly share code, notes, and snippets.

@lloyd
Created December 3, 2009 20:52
Show Gist options
  • Save lloyd/248510 to your computer and use it in GitHub Desktop.
Save lloyd/248510 to your computer and use it in GitHub Desktop.
{
:url => 'http://download.github.com/lloyd-yajl-b78dd79.tar.gz',
:md5 => '1432f587bd8e5e4788b60a243bc8f1e9',
:configure => lambda { |c|
btstr = c[:build_type].to_s.capitalize
cmakeGen = nil
# on windows we must specify a generator, we'll get that from the
# passed in configuration
cmakeGen = "-G \"#{c[:cmake_generator]}\"" if c[:cmake_generator]
cmLine = "cmake -DCMAKE_BUILD_TYPE=\"#{btstr}\" " +
"-DCMAKE_INSTALL_PREFIX=\"#{c[:output_dir]}\" " +
"#{cmakeGen} " +
" \"#{c[:src_dir]}\""
system(cmLine)
},
:build => {
:Windows => lambda { |c|
buildStr = c[:build_type].to_s.capitalize
system("devenv YetAnotherJSONParser.sln /Build #{buildStr}")
},
[ :MacOSX, :Linux ] => "make"
},
:install => {
:Windows => lambda { |c|
Dir.glob(File.join(c[:build_dir], "yajl-1.0.7", "*")).each { |d|
FileUtils.cp_r(d , c[:output_dir])
}
},
[ :Linux, :MacOSX ] => "make install"
},
:post_install => {
[ :Linux, :MacOSX ] => lambda { |c|
system("make install")
# now let's move output to the appropriate place
# i.e. move from lib/libfoo.a to lib/debug/foo.a
Dir.glob(File.join(c[:output_dir], "lib", "*")).each { |f|
FileUtils.mv(f, c[:output_lib_dir]) if !File.directory? f
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment