From 75772d76790856c96195d088247834247050e74f Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 13 Nov 2007 12:58:45 +0000 Subject: [PATCH] Add a script to install TkImg Signed-off-by: Johannes Schindelin --- src/tcltk/fileList-tkImg.txt | 0 .../0001-fix-compilation-on-MinGW.patch | 79 +++++++++++++++ src/tcltk/release-tkImg.sh | 111 +++++++++++++++++++++ 3 files changed, 190 insertions(+) create mode 100644 src/tcltk/fileList-tkImg.txt create mode 100644 src/tcltk/patches-tkImg/0001-fix-compilation-on-MinGW.patch create mode 100644 src/tcltk/release-tkImg.sh diff --git a/src/tcltk/fileList-tkImg.txt b/src/tcltk/fileList-tkImg.txt new file mode 100644 index 00000000..e69de29b diff --git a/src/tcltk/patches-tkImg/0001-fix-compilation-on-MinGW.patch b/src/tcltk/patches-tkImg/0001-fix-compilation-on-MinGW.patch new file mode 100644 index 00000000..bd796602 --- /dev/null +++ b/src/tcltk/patches-tkImg/0001-fix-compilation-on-MinGW.patch @@ -0,0 +1,79 @@ +From e874100b4ce7ef4bb137d54d864269e5140f06b2 Mon Sep 17 00:00:00 2001 +From: Johannes Schindelin +Date: Fri, 1 Jun 2007 18:37:00 +0100 +Subject: [PATCH] fix compilation on MinGW + +A couple of includes are needed, jconfig.h is not copied properly +(probably because of the lack of symlinks on MinGW), include paths +are hated by MinGW when they end with "/.", and you have to link +with the tk libs even when building a shared library. + +Signed-off-by: Johannes Schindelin +--- + + With this, the build runs through on my machine. + + Of course, you have to generate the configure files (for some + reasons, this is not done automatically). + + bmp/bmp.c | 1 + + tclconfig/img.m4 | 4 ++++ + tclconfig/tcl.m4 | 2 +- + tiff/tiffJpeg.c | 2 +- + 5 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/bmp/bmp.c b/bmp/bmp.c +index 3528fe8..949e8f6 100644 +--- a/bmp/bmp.c ++++ b/bmp/bmp.c +@@ -14,6 +14,7 @@ + * Generic initialization code, parameterized via CPACKAGE and PACKAGE. + */ + ++#include + #include "init.c" + + /* +diff --git a/tclconfig/img.m4 b/tclconfig/img.m4 +index ac30ac0..4b12c68 100644 +--- a/tclconfig/img.m4 ++++ b/tclconfig/img.m4 +@@ -11,6 +11,10 @@ AC_DEFUN(IMG_SRCPATH, [ + case [$]$1_SRC_DIR in + /*) $1_SRC_PATH=[$]$1_SRC_DIR + ;; ++.) ++ # SRC_DIR current dir, replace by BUILD_PATH ++ $1_SRC_PATH="`dirname [$]$1_BUILD_STUB_LIB_PATH`" ++ ;; + *) # SRC_DIR relative, splice with BUILD_PATH + $1_SRC_PATH="`dirname [$]$1_BUILD_STUB_LIB_PATH`/[$]$1_SRC_DIR" + esac +diff --git a/tclconfig/tcl.m4 b/tclconfig/tcl.m4 +index 3b1f478..99ba384 100644 +--- a/tclconfig/tcl.m4 ++++ b/tclconfig/tcl.m4 +@@ -3153,7 +3153,7 @@ AC_DEFUN(TEA_MAKE_LIB, [ + MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(\[$](PACKAGE)stub_OBJECTS)" + else + MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(\[$](PACKAGE)_OBJECTS)" +- MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(\[$](PACKAGE)_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS}" ++ MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(\[$](PACKAGE)_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS} \${TK_LIBS}" + MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(\[$](PACKAGE)stub_OBJECTS)" + fi + +diff --git a/tiff/tiffJpeg.c b/tiff/tiffJpeg.c +index 413e95b..7027c38 100644 +--- a/tiff/tiffJpeg.c ++++ b/tiff/tiffJpeg.c +@@ -1520,7 +1520,7 @@ JPEGVGetField(tif, tag, ap) + case TIFFTAG_JPEGTABLES: + /* u_short is bogus --- should be uint32 ??? */ + /* TIFFWriteNormalTag needs fixed XXX */ +- *va_arg(ap, u_short*) = (u_short) sp->jpegtables_length; ++ *va_arg(ap, unsigned short*) = (unsigned short) sp->jpegtables_length; + *va_arg(ap, void**) = sp->jpegtables; + break; + case TIFFTAG_JPEGQUALITY: +-- +1.5.2.2663.gd77e7-dirty diff --git a/src/tcltk/release-tkImg.sh b/src/tcltk/release-tkImg.sh new file mode 100644 index 00000000..0fdc9440 --- /dev/null +++ b/src/tcltk/release-tkImg.sh @@ -0,0 +1,111 @@ +#!/bin/sh + +# This is a package updating script for msysGit + +cd "$(dirname "$0")" || { + echo "Could not switch to $(dirname "$0")" + exit 1 +} + +package=TkImg +list=fileList-tkImg.txt +version=1.3 +dir=tkimg$version +tar=tkimg$version.tar.bz2 +taropt=-j +url=http://kent.dl.sourceforge.net/sourceforge/tkimg/$tar + +patch_tkImg () { + init_git && + git rev-parse --verify HEAD^ || { + perl -i.bak -pe "s/(MP-RAS.*relid)\'/\\1/" \ + $(find -name configure) && + perl -i.bak -pe "s/EXTERN (int TkimgInitUtilities)/\\1/" \ + base/tkimg.c && + git commit -m "fix configure" -a + } +} + +patch=patch_tkImg + +configure_extra=--srcdir=$(pwd)/$dir + +premake_tkImg () { + perl -i.bak -pe "s/-L(\\S+) -l(tkimgstub\S+)/\\1\/\\2.a/" \ + $(find -name Makefile) +} + +premake=premake_tkImg + +# The functions (overridable by setting $fetch, $unpack, $compile or $install) + +fetch_it () { + test -f $tar || curl $url > $tar +} + +test -z "$fetch" && fetch=fetch_it + +unpack_it () { + test -d $dir || tar -xv $taropt -f $tar +} + +test -z "$unpack" && unpack=unpack_it + +test -z "$premake" && premake=true + +compile_it () { + test -f Makefile || { + ./configure --prefix=/mingw $configure_extra && + $premake && + make + } +} + +test -z "$compile" && compile=compile_it + +install_it () { + make install +} + +test -z "$install" && install=install_it + +init_git () { + test -d .git || { + git init && + git add . && + git commit -m "imported $package $version" + } +} + +# Do the real work + +$fetch && + +$unpack && + +(cd $dir && + + $patch && + + $compile +) && + +# Install + +index=$(/share/msysGit/pre-install.sh) && + +# Remove old files stored in the file list +cat $list | (cd / && xargs -r git rm) && + +(cd $dir && $install) && + +/share/msysGit/post-install.sh $index "Install $package $version" && + +git diff --diff-filter=AM --name-only HEAD^! | +sed -e "s/^/\//" > $list && +git commit -C HEAD --amend $list || +exit + +echo "Successfully built and installed $package $version" +echo "After checking the result, please commit (possibly with --amend)" +echo -- 2.11.4.GIT