From a0b08783ef2940d8ecc87266cf31cf6290537d1c Mon Sep 17 00:00:00 2001 From: Hiroshi Shirosaki Date: Thu, 6 Sep 2012 21:56:17 +0900 Subject: [PATCH] Add tcl/tk 8.5.12 recipe with patches --- ...w-with-powl-under-x86_64-w64-mingw32.patch | 54 +++++++++++++++++++ tcl/tcl-8.5.12.knapfile | 13 +++++ tk/tk-8.5.12.knapfile | 16 ++++++ 3 files changed, 83 insertions(+) create mode 100644 tcl/0001-Replace-pow-with-powl-under-x86_64-w64-mingw32.patch create mode 100644 tcl/tcl-8.5.12.knapfile create mode 100644 tk/tk-8.5.12.knapfile diff --git a/tcl/0001-Replace-pow-with-powl-under-x86_64-w64-mingw32.patch b/tcl/0001-Replace-pow-with-powl-under-x86_64-w64-mingw32.patch new file mode 100644 index 0000000..9edd6f6 --- /dev/null +++ b/tcl/0001-Replace-pow-with-powl-under-x86_64-w64-mingw32.patch @@ -0,0 +1,54 @@ +From a9a511fd4a5c7ae5c7570154a6a0eb636e4bc7d5 Mon Sep 17 00:00:00 2001 +From: Hiroshi Shirosaki +Date: Sat, 28 Jul 2012 10:00:32 +0900 +Subject: [PATCH] Replace pow() with powl() under x86_64-w64-mingw32 + +Replace pow() implementation because of broken pow() with mingw x64. +--- + win/tcl.m4 | 10 ++++++++++ + win/tclWin32Dll.c | 8 ++++++++ + 2 files changed, 18 insertions(+) + +diff --git a/win/tcl.m4 b/win/tcl.m4 +index 83a4ea3..e20e6af 100644 +--- a/win/tcl.m4 ++++ b/win/tcl.m4 +@@ -521,6 +521,16 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ + + EXTRA_CFLAGS="${extra_cflags}" + ++ AC_EGREP_CPP(yes, ++ [#ifdef __MINGW64__ ++ yes ++ #endif ++ ], is_mingw64=yes, is_mingw64=no) ++ ++ if test "$is_mingw64" = "yes"; then ++ EXTRA_CFLAGS="-fno-builtin-pow ${extra_cflags}" ++ fi ++ + CFLAGS_DEBUG=-g + CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" + CFLAGS_WARNING="-Wall" +diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c +index 6c863b9..35d0c39 100644 +--- a/win/tclWin32Dll.c ++++ b/win/tclWin32Dll.c +@@ -1232,6 +1232,14 @@ TclWinCPUID( + #endif + return status; + } ++ ++#ifdef __MINGW64__ ++#include ++double pow(double x, double y) ++{ ++ return powl(x, y); ++} ++#endif + + /* + * Local Variables: +-- +1.7.11.msysgit.1 + diff --git a/tcl/tcl-8.5.12.knapfile b/tcl/tcl-8.5.12.knapfile new file mode 100644 index 0000000..4f097c2 --- /dev/null +++ b/tcl/tcl-8.5.12.knapfile @@ -0,0 +1,13 @@ +recipe "tcl", "8.5.12" do + use :autotools + use :patch + + fetch "http://downloads.sourceforge.net/#{name}/#{name}#{version}-src.tar.gz", + :md5 => "174b2b4c619ba8f96875d8a051917703" + + before :configure do + run "cd win && sh -c \"autoconf\"" + options.configure = "win/configure" + options.configure_args << "--enable-threads" + end +end diff --git a/tk/tk-8.5.12.knapfile b/tk/tk-8.5.12.knapfile new file mode 100644 index 0000000..a7954f6 --- /dev/null +++ b/tk/tk-8.5.12.knapfile @@ -0,0 +1,16 @@ +recipe "tk", "8.5.12" do + use :autotools + + depends_on "tcl" + + fetch "http://downloads.sourceforge.net/tcl/#{name}#{version}-src.tar.gz", + :md5 => "a01640176845c1f654a412cfc9bab13b" + + before :configure do + run "cd win && sh -c \"autoconf\"" + options.configure = "win/configure" + options.configure_args << "--enable-threads" + tcl_path = Knapsack.work_path("tcl", version, platform) + options.configure_args << "--with-tcl=#{tcl_path}" + end +end