From 13704b34137e3fd8e082ec5edc2cb2d00bd3d51a Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Thu, 23 Feb 2012 19:57:18 -0300 Subject: [PATCH] Import of recipes and patches from knap-build --- c-ares/c-ares-1.7.5.knapfile | 6 +++ libcurl/libcurl-7.24.0.knapfile | 31 ++++++++++++++ ...s-should-go-in-includedir-not-libdir.patch | 42 +++++++++++++++++++ ...library-for-x86_64-mingw-configure-ac.diff | 18 ++++++++ ...ed-library-for-x86_64-mingw-configure.diff | 18 ++++++++ libffi/libffi-3.0.10.knapfile | 7 ++++ libiconv/libiconv-1.14.knapfile | 6 +++ ...Proper-mingw-YAML_DECLARE-definition.patch | 27 ++++++++++++ libyaml/libyaml-0.1.4.knapfile | 7 ++++ openssl/openssl-1.0.0g.knapfile | 37 ++++++++++++++++ ragel/ragel-6.7.knapfile | 6 +++ sqlite/sqlite-3.7.10.knapfile | 12 ++++++ zlib/zlib-1.2.5.knapfile | 38 +++++++++++++++++ zlib/zlib-1.2.6.knapfile | 34 +++++++++++++++ 14 files changed, 289 insertions(+) create mode 100644 c-ares/c-ares-1.7.5.knapfile create mode 100644 libcurl/libcurl-7.24.0.knapfile create mode 100644 libffi/0001-Includes-should-go-in-includedir-not-libdir.patch create mode 100644 libffi/0002-build-shared-library-for-x86_64-mingw-configure-ac.diff create mode 100644 libffi/0002-build-shared-library-for-x86_64-mingw-configure.diff create mode 100644 libffi/libffi-3.0.10.knapfile create mode 100644 libiconv/libiconv-1.14.knapfile create mode 100644 libyaml/0001-Proper-mingw-YAML_DECLARE-definition.patch create mode 100644 libyaml/libyaml-0.1.4.knapfile create mode 100644 openssl/openssl-1.0.0g.knapfile create mode 100644 ragel/ragel-6.7.knapfile create mode 100644 sqlite/sqlite-3.7.10.knapfile create mode 100644 zlib/zlib-1.2.5.knapfile create mode 100644 zlib/zlib-1.2.6.knapfile diff --git a/c-ares/c-ares-1.7.5.knapfile b/c-ares/c-ares-1.7.5.knapfile new file mode 100644 index 0000000..89888f4 --- /dev/null +++ b/c-ares/c-ares-1.7.5.knapfile @@ -0,0 +1,6 @@ +recipe "c-ares", "1.7.5" do + use :autotools + + fetch "http://distfiles.openknapsack.org/#{name}/#{name}-#{version}.tar.gz", + :md5 => "800875fc23cd8e1924d8af9172ed33e7" +end diff --git a/libcurl/libcurl-7.24.0.knapfile b/libcurl/libcurl-7.24.0.knapfile new file mode 100644 index 0000000..32f18c9 --- /dev/null +++ b/libcurl/libcurl-7.24.0.knapfile @@ -0,0 +1,31 @@ +recipe "libcurl", "7.24.0" do + use :autotools + + fetch "http://distfiles.openknapsack.org/#{name}/curl-#{version}.tar.bz2", + :md5 => "f912221d75eb8d8fe08900eaf011b023" + + depends_on "c-ares" + depends_on "openssl" + depends_on "zlib" + + before :configure do + options.configure_args << "--enable-ares" + options.configure_args << "--enable-ssl" + options.configure_args << "--enable-zlib" + end + + before :compile do + # only libcurl is required + options.make_args << "-C lib" + end + + action :install do + # we only need libs, headers and docs + %w(lib include docs).each do |dir| + run "make -f #{options.makefile} -C #{dir} install" + end + + # also install pkg-config information + run "make -f #{options.makefile} install-pkgconfigDATA" + end +end diff --git a/libffi/0001-Includes-should-go-in-includedir-not-libdir.patch b/libffi/0001-Includes-should-go-in-includedir-not-libdir.patch new file mode 100644 index 0000000..a591ace --- /dev/null +++ b/libffi/0001-Includes-should-go-in-includedir-not-libdir.patch @@ -0,0 +1,42 @@ +From b1184c2c41de4efc26866e6fb93cb9c694f14f8f Mon Sep 17 00:00:00 2001 +From: Luis Lavena +Date: Sat, 3 Jul 2010 12:48:20 -0300 +Subject: [PATCH] Includes should go in includedir, not libdir. + +This patch corrects the installation of ffi.h and ffitarget.h +to properly put in $(includedir) instead of $(libdir) + +It also avoids prepending package name and version to it, causing +issues by development tools trying to find it. +--- + include/Makefile.am | 2 +- + include/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/Makefile.am b/include/Makefile.am +index fd28024..15301d6 100644 +--- a/include/Makefile.am ++++ b/include/Makefile.am +@@ -5,5 +5,5 @@ AUTOMAKE_OPTIONS=foreign + DISTCLEANFILES=ffitarget.h + EXTRA_DIST=ffi.h.in ffi_common.h + +-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include ++includesdir = $(includedir) + nodist_includes_HEADERS = ffi.h ffitarget.h +diff --git a/include/Makefile.in b/include/Makefile.in +index f370697..c62d6c4 100644 +--- a/include/Makefile.in ++++ b/include/Makefile.in +@@ -204,7 +204,7 @@ top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = foreign + DISTCLEANFILES = ffitarget.h + EXTRA_DIST = ffi.h.in ffi_common.h +-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include ++includesdir = $(includedir) + nodist_includes_HEADERS = ffi.h ffitarget.h + all: all-am + +-- +1.7.1.msysgit.0 + diff --git a/libffi/0002-build-shared-library-for-x86_64-mingw-configure-ac.diff b/libffi/0002-build-shared-library-for-x86_64-mingw-configure-ac.diff new file mode 100644 index 0000000..4b19fb6 --- /dev/null +++ b/libffi/0002-build-shared-library-for-x86_64-mingw-configure-ac.diff @@ -0,0 +1,18 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -182,6 +182,15 @@ + + x86_64-*-cygwin* | x86_64-*-mingw*) + TARGET=X86_WIN64; TARGETDIR=x86 ++ # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. ++ # We must also check with_cross_host to decide if this is a native ++ # or cross-build and select where to install dlls appropriately. ++ if test -n "$with_cross_host" && ++ test x"$with_cross_host" != x"no"; then ++ AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"'; ++ else ++ AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"'; ++ fi + ;; + + x86_64-*-*) diff --git a/libffi/0002-build-shared-library-for-x86_64-mingw-configure.diff b/libffi/0002-build-shared-library-for-x86_64-mingw-configure.diff new file mode 100644 index 0000000..df90817 --- /dev/null +++ b/libffi/0002-build-shared-library-for-x86_64-mingw-configure.diff @@ -0,0 +1,18 @@ +--- a/configure ++++ b/configure +@@ -13164,6 +13164,15 @@ + + x86_64-*-cygwin* | x86_64-*-mingw*) + TARGET=X86_WIN64; TARGETDIR=x86 ++ # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. ++ # We must also check with_cross_host to decide if this is a native ++ # or cross-build and select where to install dlls appropriately. ++ if test -n "$with_cross_host" && ++ test x"$with_cross_host" != x"no"; then ++ AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"'; ++ else ++ AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"'; ++ fi + ;; + + x86_64-*-*) diff --git a/libffi/libffi-3.0.10.knapfile b/libffi/libffi-3.0.10.knapfile new file mode 100644 index 0000000..9ce6b02 --- /dev/null +++ b/libffi/libffi-3.0.10.knapfile @@ -0,0 +1,7 @@ +recipe "libffi", "3.0.10" do + use :autotools + use :patch + + fetch "http://distfiles.openknapsack.org/#{name}/#{name}-#{version}.tar.gz", + :md5 => "79390673f5d07a8fb342bc09b5055b6f" +end diff --git a/libiconv/libiconv-1.14.knapfile b/libiconv/libiconv-1.14.knapfile new file mode 100644 index 0000000..ffb8726 --- /dev/null +++ b/libiconv/libiconv-1.14.knapfile @@ -0,0 +1,6 @@ +recipe "libiconv", "1.14" do + use :autotools + + fetch "http://distfiles.openknapsack.org/#{name}/#{name}-#{version}.tar.gz", + :md5 => "e34509b1623cec449dfeb73d7ce9c6c6" +end diff --git a/libyaml/0001-Proper-mingw-YAML_DECLARE-definition.patch b/libyaml/0001-Proper-mingw-YAML_DECLARE-definition.patch new file mode 100644 index 0000000..33fdbb5 --- /dev/null +++ b/libyaml/0001-Proper-mingw-YAML_DECLARE-definition.patch @@ -0,0 +1,27 @@ +From 37a8ce4e439887f7856ad70ca71e2fe6820e37fd Mon Sep 17 00:00:00 2001 +From: Bosko Ivanisevic +Date: Wed, 6 Jul 2011 09:22:29 +0200 +Subject: [PATCH] Proper mingw YAML_DECLARE definition + +--- + include/yaml.h | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/include/yaml.h b/include/yaml.h +index 400cae1..c6e8b71 100644 +--- a/include/yaml.h ++++ b/include/yaml.h +@@ -26,7 +26,9 @@ extern "C" { + + /** The public API declaration. */ + +-#ifdef _WIN32 ++#if defined(__MINGW32__) ++# define YAML_DECLARE(type) type ++#elif defined(_WIN32) + # if defined(YAML_DECLARE_STATIC) + # define YAML_DECLARE(type) type + # elif defined(YAML_DECLARE_EXPORT) +-- +1.7.0.2.msysgit.0 + diff --git a/libyaml/libyaml-0.1.4.knapfile b/libyaml/libyaml-0.1.4.knapfile new file mode 100644 index 0000000..5b202ce --- /dev/null +++ b/libyaml/libyaml-0.1.4.knapfile @@ -0,0 +1,7 @@ +recipe "libyaml", "0.1.4" do + use :autotools + use :patch + + fetch "http://distfiles.openknapsack.org/#{name}/yaml-#{version}.tar.gz", + :md5 => "36c852831d02cf90508c29852361d01b" +end diff --git a/openssl/openssl-1.0.0g.knapfile b/openssl/openssl-1.0.0g.knapfile new file mode 100644 index 0000000..51347bd --- /dev/null +++ b/openssl/openssl-1.0.0g.knapfile @@ -0,0 +1,37 @@ +recipe "openssl", "1.0.0g" do + use :autotools + + fetch "http://distfiles.openknapsack.org/#{name}/#{name}-#{version}.tar.gz", + :md5 => "07ecbe4324f140d157478637d6beccf1" + + depends_on "zlib" + + before :extract do + # ignore symlink errors from package + if platform.mingw? + options.ignore_extract_errors = true + end + end + + action :configure do + cmd = ["perl"] + if platform.posix? + cmd << "config" + else + cmd << "Configure" + end + + if platform.mingw? + if platform.x64? + cmd << "mingw64" + else + cmd << "mingw" + end + end + + cmd << "zlib-dynamic shared" + cmd << "--prefix=#{install_path}" + + run cmd.join(" ") + end +end diff --git a/ragel/ragel-6.7.knapfile b/ragel/ragel-6.7.knapfile new file mode 100644 index 0000000..fc88510 --- /dev/null +++ b/ragel/ragel-6.7.knapfile @@ -0,0 +1,6 @@ +recipe "ragel", "6.7" do + use :autotools + + fetch "http://distfiles.openknapsack.org/#{name}/#{name}-#{version}.tar.gz", + :md5 => "f4423e0d8a6538dd4e61498fcfad3cec" +end diff --git a/sqlite/sqlite-3.7.10.knapfile b/sqlite/sqlite-3.7.10.knapfile new file mode 100644 index 0000000..6ed031c --- /dev/null +++ b/sqlite/sqlite-3.7.10.knapfile @@ -0,0 +1,12 @@ +recipe "sqlite", "3.7.10" do + use :autotools + + fetch "http://distfiles.openknapsack.org/#{name}/#{name}-autoconf-3071000.tar.gz", + :md5 => "9ed2ca93577b58cfa0d01f64b9312ab9" + + before :configure do + cflags = "-O2 -DSQLITE_ENABLE_COLUMN_METADATA" + cflags << " -fPIC" if platform.x64? && !platform.mingw? + options.configure_args << "CFLAGS='#{cflags}'" + end +end diff --git a/zlib/zlib-1.2.5.knapfile b/zlib/zlib-1.2.5.knapfile new file mode 100644 index 0000000..9c14f4c --- /dev/null +++ b/zlib/zlib-1.2.5.knapfile @@ -0,0 +1,38 @@ +recipe "zlib", "1.2.5" do + use :autotools + + fetch "http://distfiles.openknapsack.org/#{name}/#{name}-#{version}.tar.bz2", + :md5 => "be1e89810e66150f5b0327984d8625a0" + + 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") + + # ensure IMPLIB is libz.dll.a + # (so linking with -lz will prefer shared instead of static) + mk.sub!(/^IMPLIB\s*=.*$/, "IMPLIB = libz.dll.a") + + # 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 diff --git a/zlib/zlib-1.2.6.knapfile b/zlib/zlib-1.2.6.knapfile new file mode 100644 index 0000000..b70b67b --- /dev/null +++ b/zlib/zlib-1.2.6.knapfile @@ -0,0 +1,34 @@ +recipe "zlib", "1.2.6" do + use :autotools + + fetch "http://distfiles.openknapsack.org/#{name}/#{name}-#{version}.tar.bz2", + :md5 => "dc2cfa0d2313ca77224b4d932b2911e9" + + 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