diff --git a/zlib/zlib-1.2.8.knapfile b/zlib/zlib-1.2.8.knapfile new file mode 100644 index 0000000..22b693a --- /dev/null +++ b/zlib/zlib-1.2.8.knapfile @@ -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