Skip to content

Commit

Permalink
Add zlib 1.2.8 recipe
Browse files Browse the repository at this point in the history
Use official .tar.gz instead of .bz2 since is no longer provided.
  • Loading branch information
luislavena committed Jun 6, 2014
1 parent e9e64ef commit 232a52e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions zlib/zlib-1.2.8.knapfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
recipe "zlib", "1.2.8" do
use :autotools

fetch "http://distfiles.openknapsack.org/#{name}/#{name}-#{version}.tar.gz",
:md5 => "44d667c142d7cda120332623eab69f40"

action :configure do
if platform.mingw?
# win32/Makefile.gcc needs to be adjusted
options.makefile = "win32/Makefile.gcc"
work_makefile = work_path(options.makefile)
mk = File.read work_makefile
File.open work_makefile, "wb" do |f|
f.puts "BINARY_PATH = #{install_path('bin')}"
f.puts "INCLUDE_PATH = #{install_path('include')}"
f.puts "LIBRARY_PATH = #{install_path('lib')}"

# TODO: change PREFIX if cross-compiling
unless platform.native?
mg.sub!(/^PREFIX\s*=\s*$/, "PREFIX = #{platform.host}-")
end

# enable shared object
mk.sub!(/^SHARED_MODE\s*=\d*$/, "SHARED_MODE = 1")

# write the original Makefile content
f.puts mk
end
else
# run will chdir into work_path prior executing the command
run "sh configure --prefix=#{install_path}"
end
end
end

0 comments on commit 232a52e

Please sign in to comment.