Check-in [cb3b1b20ff]
Overview
Comment:Started adding TkImg support, seems broken so far
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | feature-tkimg
Files: files | file ages | folders
SHA1:cb3b1b20ffee5bf2b70987f7e94b57791331e0a8
User & Date: rkeene on 2014-09-02 17:25:27
Other Links: manifest | tags
Context
2014-09-02
17:25
Started adding TkImg support, seems broken so far Leaf check-in: cb3b1b20ff user: rkeene tags: feature-tkimg
17:24
Clarified STATICMK4 notes in KitDLL check-in: fdef98f710 user: rkeene tags: trunk
Changes

Modified .fossil-settings/ignore-glob from [5261fbbc36] to [3cebc8d371].

   101    101   tls/build.log
   102    102   tls/inst
   103    103   tls/inst/*
   104    104   tls/out
   105    105   tls/out/*
   106    106   tls/src
   107    107   tls/src/*
          108  +tkimg/build
          109  +tkimg/build/*
          110  +tkimg/build.log
          111  +tkimg/inst
          112  +tkimg/inst/*
          113  +tkimg/out
          114  +tkimg/out/*
          115  +tkimg/src
          116  +tkimg/src/*
   108    117   kitdll/buildsrc/kitdll-0.0/starpack.vfs
   109    118   kitdll/buildsrc/kitdll-0.0/starpack.vfs/*
   110    119   kitdll/buildsrc/kitdll-0.0/test
   111    120   kitdll/buildsrc/kitdll-0.0/configure
   112    121   kitdll/buildsrc/kitdll-0.0/libtcl*.so
   113    122   kitdll/buildsrc/kitdll-0.0/Makefile
   114    123   kitdll/buildsrc/kitdll-0.0/*.o

Added tkimg/build.sh version [e78262e2c7].

            1  +#! /usr/bin/env bash
            2  +
            3  +if [ ! -f 'build.sh' ]; then
            4  +	echo 'ERROR: This script must be run from the directory it is in' >&2
            5  +
            6  +	exit 1
            7  +fi
            8  +if [ -z "${TCLVERS}" ]; then
            9  +	echo 'ERROR: The TCLVERS environment variable is not set' >&2
           10  +
           11  +	exit 1
           12  +fi
           13  +
           14  +TKIMGVERS="1.4.2"
           15  +TKIMGVERS_SHORT="$(echo "${TKIMGVERS}" | cut -f 1-2 -d '.')"
           16  +SRC="src/tkimg-${TKIMGVERS}.tar.gz"
           17  +SRCURL="http://sourceforge.net/projects/tkimg/files/tkimg/${TKIMGVERS_SHORT}/tkimg${TKIMGVERS}.tar.gz/download"
           18  +BUILDDIR="$(pwd)/build/tkimg${TKIMGVERS_SHORT}"
           19  +OUTDIR="$(pwd)/out"
           20  +INSTDIR="$(pwd)/inst"
           21  +PATCHDIR="$(pwd)/patches"
           22  +TKCONFIGDIR="$(find ../tk/build -name tkConfig.sh 2>/dev/null | sed 's@/tkConfig\.sh$@@')"
           23  +TKCONFIGDIR="$(cd "${TKCONFIGDIR}" 2>/dev/null && pwd)"
           24  +export TKIMGVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR PATCHDIR
           25  +
           26  +if [ -z "${TKCONFIGDIR}" ]; then
           27  +	echo "Unable to find Tk, aborting." >&2
           28  +
           29  +	exit 1
           30  +fi
           31  +
           32  +
           33  +# Set configure options for this sub-project
           34  +LDFLAGS="${LDFLAGS} ${KC_TKIMG_LDFLAGS}"
           35  +CFLAGS="${CFLAGS} ${KC_TKIMG_CFLAGS}"
           36  +CPPFLAGS="${CPPFLAGS} ${KC_TKIMG_CPPFLAGS}"
           37  +LIBS="${LIBS} ${KC_TKIMG_LIBS}"
           38  +export LDFLAGS CFLAGS CPPFLAGS LIBS
           39  +
           40  +rm -rf 'build' 'out' 'inst'
           41  +mkdir 'build' 'out' 'inst' || exit 1
           42  +
           43  +TCL_VERSION="unknown"
           44  +if [ -f "${TCLCONFIGDIR}/tclConfig.sh" ]; then
           45  +        source "${TCLCONFIGDIR}/tclConfig.sh"
           46  +fi
           47  +export TCL_VERSION
           48  +
           49  +# Source Tk config so we know how Tk is configured
           50  +source "${TKCONFIGDIR}/tkConfig.sh"
           51  +
           52  +if [ ! -f "${SRC}" ]; then
           53  +	mkdir 'src' >/dev/null 2>/dev/null
           54  +
           55  +	if [ ! -d 'buildsrc' ]; then
           56  +		rm -f "${SRC}.tmp"
           57  +		wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
           58  +		mv "${SRC}.tmp" "${SRC}"
           59  +	fi
           60  +fi
           61  +
           62  +(
           63  +	cd 'build' || exit 1
           64  +
           65  +	if [ ! -d '../buildsrc' ]; then
           66  +		gzip -dc "../${SRC}" | tar -xf -
           67  +	else    
           68  +		cp -rp ../buildsrc/* './'
           69  +	fi
           70  +
           71  +	# Apply required patches
           72  +	cd "${BUILDDIR}" || exit 1
           73  +
           74  +	for patch in "${PATCHDIR}/all"/tkimg-${TKIMGVERS}-*.diff "${PATCHDIR}/${TCL_VERSION}"/tkimg-${TKIMGVERS}-*.diff; do
           75  +		if [ ! -f "${patch}" ]; then
           76  +			continue
           77  +		fi
           78  +
           79  +		echo "Applying: ${patch}"
           80  +		${PATCH:-patch} -p1 < "${patch}"
           81  +	done
           82  +
           83  +	# Try to build as a shared object if requested
           84  +	if [ "${STATICTKIMG}" = "0" ]; then
           85  +		tryopts="--enable-shared --disable-shared"
           86  +	elif [ "${STATICTKIMG}" = "-1" ]; then
           87  +		# Require shared object if requested
           88  +		tryopts="--enable-shared"
           89  +	else
           90  +		# Default to building statically
           91  +		tryopts="--disable-shared"
           92  +	fi
           93  +
           94  +	SAVE_CFLAGS="${CFLAGS}"
           95  +	for tryopt in $tryopts __fail__; do
           96  +		# Clean up, if needed
           97  +		make distclean >/dev/null 2>/dev/null
           98  +		rm -rf "${INSTDIR}"
           99  +		mkdir "${INSTDIR}"
          100  +
          101  +		if [ "${tryopt}" = "__fail__" ]; then
          102  +			exit 1
          103  +		fi
          104  +
          105  +		if [ "${tryopt}" == "--enable-shared" ]; then
          106  +			isshared="1"
          107  +		else
          108  +			isshared="0"
          109  +		fi
          110  +
          111  +		# If build a static tkimg for KitDLL, ensure that we use PIC
          112  +		# so that it can be linked into the shared object
          113  +		if [ "${isshared}" = "0" -a "${KITTARGET}" = "kitdll" ]; then
          114  +			CFLAGS="${SAVE_CFLAGS} -fPIC"
          115  +		else
          116  +			CFLAGS="${SAVE_CFLAGS}"
          117  +		fi
          118  +
          119  +		find . -name configure | while IFS='' read -r configure; do
          120  +			if [ "${isshared}" = '0' ]; then
          121  +				sed 's@USE_TCL_STUBS@XXX_TCL_STUBS@g' "${configure}" > "${configure}.new"
          122  +			else
          123  +				sed 's@XXX_TCL_STUBS@USE_TCL_STUBS@g' "${configure}" > "${configure}.new"
          124  +			fi
          125  +			cat "${configure}.new" > "${configure}"
          126  +			rm -f "${configure}.new"
          127  +
          128  +			if [ "${TK_SHARED_BUILD}" = '1' ]; then
          129  +				sed 's@XXX_TK_STUBS@USE_TK_STUBS@g' "${configure}" > "${configure}.new"
          130  +			else
          131  +				sed 's@USE_TK_STUBS@XXX_TK_STUBS@g' "${configure}" > "${configure}.new"
          132  +			fi
          133  +			cat "${configure}.new" > "${configure}"
          134  +			rm -f "${configure}.new"
          135  +		done
          136  +
          137  +		(
          138  +			echo "Running: ./configure $tryopt --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" --with-tk=\"${TKCONFIGDIR}\" ${CONFIGUREEXTRA}"
          139  +			./configure $tryopt --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" --with-tk="${TKCONFIGDIR}" ${CONFIGUREEXTRA}
          140  +
          141  +			echo "Running: ${MAKE:-make}"
          142  +			${MAKE:-make} || exit 1
          143  +
          144  +			echo "Running: ${MAKE:-make} install"
          145  +			${MAKE:-make} install || exit 1
          146  +		) || continue
          147  +
          148  +		break
          149  +	done
          150  +
          151  +	# Create VFS-insert
          152  +	cp -r "${INSTDIR}/lib" "${OUTDIR}" || exit 1
          153  +	find "${OUTDIR}" -name '*.a' -type f | xargs rm -f
          154  +
          155  +	exit 0
          156  +) || exit 1
          157  +
          158  +exit 0

Added tkimg/patches/all/tkimg-1.4.2-fixinstall.diff version [930a9166fd].

            1  +diff -uNr tkimg1.4.orig/Makefile.in tkimg1.4-fixinstall/Makefile.in
            2  +--- tkimg1.4.orig/Makefile.in	2013-11-21 16:03:12.000000000 -0600
            3  ++++ tkimg1.4-fixinstall/Makefile.in	2014-08-31 20:03:21.960077999 -0500
            4  +@@ -141,9 +141,9 @@
            5  + 		cat Img/exec_prefix/lib/Img/pkgIndex.tcl >> pkgIndex.tcl ; \
            6  + 		fi ; \
            7  + 	done
            8  +-	chmod ugo+w     Img/exec_prefix/lib/Img/pkgIndex.tcl
            9  +-	mv pkgIndex.tcl Img/exec_prefix/lib/Img/pkgIndex.tcl
           10  +-	chmod ugo+w     Img/exec_prefix/lib/Img/pkgIndex.tcl
           11  ++	if test "$(SHARED_BUILD)" = "1"; then chmod ugo+w     Img/exec_prefix/lib/Img/pkgIndex.tcl; fi
           12  ++	if test "$(SHARED_BUILD)" = "1"; then mv pkgIndex.tcl Img/exec_prefix/lib/Img/pkgIndex.tcl; fi
           13  ++	if test "$(SHARED_BUILD)" = "1"; then chmod ugo+w     Img/exec_prefix/lib/Img/pkgIndex.tcl; fi
           14  + 	for p in Img/exec_prefix/lib/*.sh ; do \
           15  + 		sed -e 's#$(libdir)/[^/ ]*\([/ ]\)#$(LIB_RUNTIME_DIR)\1#' \
           16  + 			$$p > $$p.1 && mv -f $$p.1 $$p ; \