|
From: <ai...@us...> - 2013-11-05 00:48:43
|
Revision: 12648
http://sourceforge.net/p/plplot/code/12648
Author: airwin
Date: 2013-11-05 00:48:39 +0000 (Tue, 05 Nov 2013)
Log Message:
-----------
Initial commit of iwidgets-4.0.1 build configuration.
Tested by Alan W. Irwin <ai...@us...> on Linux using
the -DBUILD_THE_BUILDTOOLS=ON cmake option for build_projects and
the build_iwidgets4.0 target. The build and install succeeded without
obvious issues and "package require Iwidgets 4.0" worked fine afterwards
under wish.
Modified Paths:
--------------
trunk/cmake/build_projects/CMakeLists.txt
Added Paths:
-----------
trunk/cmake/build_projects/iwidgets4.0/
trunk/cmake/build_projects/iwidgets4.0/bp.cmake
trunk/cmake/build_projects/iwidgets4.0/iwidgets4.0_build_system.patch
Modified: trunk/cmake/build_projects/CMakeLists.txt
===================================================================
--- trunk/cmake/build_projects/CMakeLists.txt 2013-11-04 00:53:10 UTC (rev 12647)
+++ trunk/cmake/build_projects/CMakeLists.txt 2013-11-05 00:48:39 UTC (rev 12648)
@@ -298,6 +298,8 @@
itcl3
# itk version 3 is an independent project
itk3
+ # iwidgets version 4.0 is an independent project
+ iwidgets4.0
)
else(BUILD_THE_BUILDTOOLS)
# List of all configurations. Order doesn't matter because multiple
Added: trunk/cmake/build_projects/iwidgets4.0/bp.cmake
===================================================================
--- trunk/cmake/build_projects/iwidgets4.0/bp.cmake (rev 0)
+++ trunk/cmake/build_projects/iwidgets4.0/bp.cmake 2013-11-05 00:48:39 UTC (rev 12648)
@@ -0,0 +1,134 @@
+# iwidgets4.0/bp.cmake
+# CMakeLists.txt file to configure the build of iwidgets4.0.
+
+# Copyright (C) 2013 Alan W. Irwin
+
+# This file is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this file; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# The top-level CMakeLists.txt file that includes this file should
+# have run "include(ExternalProject)" and set EP_BASE variable (and
+# corresponding directory property) as well as various BP variables
+# used below that configure how the External_Project functions
+# operate.
+
+# Protect against configuring a build twice in one CMake call
+if(iwidgets4.0_configured)
+ return()
+endif(iwidgets4.0_configured)
+set(iwidgets4.0_configured ON)
+
+# List of dependencies (most of which are build tools) which should be
+# ignored.
+set(BP_ignored_dependencies_LIST ${extra_ignored_dependencies_list})
+
+set(iwidgets4.0_dependencies_LIST itk3 itcl3 tk tcl)
+# Remove dependencies that should be ignored.
+if(iwidgets4.0_dependencies_LIST)
+ list(REMOVE_ITEM iwidgets4.0_dependencies_LIST ${BP_ignored_dependencies_LIST})
+endif(iwidgets4.0_dependencies_LIST)
+
+set(iwidgets4.0_dependencies_targets)
+foreach(build_configuration ${iwidgets4.0_dependencies_LIST})
+ if(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
+ include(${build_configuration}/bp.cmake)
+ list(APPEND iwidgets4.0_dependencies_targets build_${build_configuration})
+ else(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
+ message(STATUS "Warning: A build_configuration for ${build_configuration} does not exist so it is assumed this dependency of iwidgets4.0 has been installed another way.")
+ endif(EXISTS ${CMAKE_SOURCE_DIR}/${build_configuration}/bp.cmake)
+endforeach(build_configuration ${iwidgets4.0_dependences_LIST})
+
+# This can be safely done only after above includes.
+set(BP_PACKAGE iwidgets4.0)
+
+# Data that is related to downloads.
+set(IWIDGETS4.0_VERSION 4.0.1)
+set(IWIDGETS4.0_LIBVERSION 4.0)
+set(${BP_PACKAGE}_URL http://downloads.sourceforge.net/project/incrtcl/%5bIncr%20Widgets%5d/${IWIDGETS4.0_VERSION}/iwidgets${IWIDGETS4.0_VERSION}.tar.gz)
+set(${BP_PACKAGE}_DOWNLOAD_HASH_TYPE MD5)
+set(${BP_PACKAGE}_DOWNLOAD_HASH 0e9c140e81ea6015b56130127c7deb03)
+
+# Data that is related to the PATH that must be used.
+if(MSYS_PLATFORM)
+ #set(BP_PATH_NODLL "${BP_PATH}")
+ #set(BP_PATH "${EP_BASE}/Build/build_${BP_PACKAGE}/dll;${BP_PATH_NODLL}")
+ determine_msys_path(BP_PATH "${BP_PATH}")
+ # Must have all elements of env command in MSYS platform form
+ determine_msys_path(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}")
+ set(${BP_PACKAGE}_SET_CFLAGS "CFLAGS=$ENV{CFLAGS}")
+else(MSYS_PLATFORM)
+ set(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}")
+ set(${BP_PACKAGE}_SET_CFLAGS "CFLAGS=$ENV{CFLAGS}")
+endif(MSYS_PLATFORM)
+#message(STATUS "modified BP_PATH for ${BP_PACKAGE} = ${BP_PATH}")
+
+# Eliminate this option which gives bad results for this package.
+string(REGEX REPLACE "-fvisibility=hidden" "" ${BP_PACKAGE}_SET_CFLAGS "${${BP_PACKAGE}_SET_CFLAGS}")
+
+ExternalProject_Add(
+ build_${BP_PACKAGE}
+ DEPENDS ${${BP_PACKAGE}_dependencies_targets}
+ URL ${${BP_PACKAGE}_URL}
+ URL_HASH ${${BP_PACKAGE}_DOWNLOAD_HASH_TYPE}=${${BP_PACKAGE}_DOWNLOAD_HASH}
+ # Because of severe Itcl/Itk bit rot since 2002 the iwidgets4.0 build system
+ # is substantially broken so must patch it. This patch taken from
+ # the Debian build of iwidgets4.0.
+ PATCH_COMMAND ${PATCH_EXECUTABLE} -p1 < ${CMAKE_SOURCE_DIR}/${BP_PACKAGE}/${BP_PACKAGE}_build_system.patch
+ # Order of CPPFLAGS is important since want to access the version 3
+ # itcl header.
+ CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${${BP_PACKAGE}_SET_CFLAGS} "CPPFLAGS=-I${INCRTCL3_PREFIX}/include/itcl${ITCL3_LIBVERSION} -I${BP_CMAKE_INSTALL_PREFIX}/include" ${source_PATH}/configure --prefix=${INCRTCL3_PREFIX} --exec-prefix=${INCRTCL3_PREFIX} --includedir=${INCRTCL3_PREFIX}/include/itcl${ITCL3_LIBVERSION} --mandir=${INCRTCL3_PREFIX}/share/man --with-tcl=${BP_CMAKE_INSTALL_PREFIX}/lib --with-tk=${BP_CMAKE_INSTALL_PREFIX}/lib
+ # Possible make race conditions so use non-parallel make
+ BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_MAKE_COMMAND}
+ INSTALL_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_MAKE_COMMAND} install
+ )
+
+add_custom_command(
+ OUTPUT
+ ${EP_BASE}/Stamp/build_${BP_PACKAGE}/build_${BP_PACKAGE}-patch
+ COMMAND echo "Permissions fixup after patch"
+ COMMAND ${CHMOD_EXECUTABLE} -v ugo+x ${EP_BASE}/Source/build_${BP_PACKAGE}/mkinstalldirs
+ APPEND
+ )
+
+if(0)
+add_custom_command(
+ OUTPUT
+ ${EP_BASE}/Stamp/build_${BP_PACKAGE}/build_${BP_PACKAGE}-build
+ COMMAND echo "Replace build-tree locations by install-tree locations"
+ COMMAND ${SED_EXECUTABLE}
+ # Cover two different patterns of uppercasing.
+ -e "s@^\\(itk_SRC_DIR='\\).*@\\1${INCRTCL3_PREFIX}/include/itcl${ITCL3_LIBVERSION}'@"
+ -e "s@^\\(ITK_SRC_DIR='\\).*@\\1${INCRTCL3_PREFIX}/include/itcl${ITCL3_LIBVERSION}'@"
+ # Cover two different patterns of uppercasing.
+ -e "/itk_B/s@='\\(-L\\)\\?.*build_itk3@='\\1${INCRTCL3_PREFIX}/lib/itk${ITK3_LIBVERSION}@"
+ -e "/ITK_B/s@='\\(-L\\)\\?.*build_itk3@='\\1${INCRTCL3_PREFIX}/lib/itk${ITK3_LIBVERSION}@"
+ # Overwrite original file.
+ -i itkConfig.sh
+ APPEND
+ )
+
+add_custom_command(
+ OUTPUT
+ ${EP_BASE}/Stamp/build_${BP_PACKAGE}/build_${BP_PACKAGE}-install
+ COMMAND echo "Install-tree fixups"
+ COMMAND ${CHMOD_EXECUTABLE} -v ${SO_NUMERICAL_PERMISSIONS} ${INCRTCL3_PREFIX}/lib/itk${ITK3_LIBVERSION}/libitk${ITK3_LIBVERSION}.so
+ APPEND
+ )
+endif(0)
+
+
+list(APPEND build_target_LIST build_${BP_PACKAGE})
+# Restore BP_PATH to original state.
+set(BP_PATH "${BP_ORIGINAL_NATIVE_PATH}")
+#message(STATUS "${BP_PACKAGE} restored original BP_PATH = ${BP_PATH}")
Added: trunk/cmake/build_projects/iwidgets4.0/iwidgets4.0_build_system.patch
===================================================================
--- trunk/cmake/build_projects/iwidgets4.0/iwidgets4.0_build_system.patch (rev 0)
+++ trunk/cmake/build_projects/iwidgets4.0/iwidgets4.0_build_system.patch 2013-11-05 00:48:39 UTC (rev 12648)
@@ -0,0 +1,263 @@
+--- iwidgets4-4.0.1.orig/mkinstalldirs
++++ iwidgets4-4.0.1/mkinstalldirs
+@@ -0,0 +1,32 @@
++#! /bin/sh
++# mkinstalldirs --- make directory hierarchy
++# Author: Noah Friedman <fri...@pr...>
++# Created: 1993-05-16
++# Last modified: 1994-03-25
++# Public domain
++
++errstatus=0
++
++for file in ${1+"$@"} ; do
++ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
++ shift
++
++ pathcomp=
++ for d in ${1+"$@"} ; do
++ pathcomp="$pathcomp$d"
++ case "$pathcomp" in
++ -* ) pathcomp=./$pathcomp ;;
++ esac
++
++ if test ! -d "$pathcomp"; then
++ echo "mkdir $pathcomp" 1>&2
++ mkdir "$pathcomp" || errstatus=$?
++ fi
++
++ pathcomp="$pathcomp/"
++ done
++done
++
++exit $errstatus
++
++# mkinstalldirs ends here
+--- iwidgets4-4.0.1.orig/configure.in
++++ iwidgets4-4.0.1/configure.in
+@@ -63,18 +63,18 @@
+ ITCL_LIB_DIR=""
+ if test -r $itcl_search/itcl/library/itcl.tcl; then
+ if test -r $itcl_search/itk/library/itk.tcl; then
+- if test -r $itcl_search/config/mkinstalldirs; then
+- ITCL_LIB_DIR=$itcl_search/itcl/library
+- ITCL_SRC_DIR=$itcl_search/itcl
+- ITK_LIB_DIR=$itcl_search/itk/library
+- ITK_SRC_DIR=$itcl_search/itk
+- fi
++ ITCL_LIB_DIR=$itcl_search/itcl/library
++ ITCL_SRC_DIR=$itcl_search/itcl
++ ITK_LIB_DIR=$itcl_search/itk/library
++ ITK_SRC_DIR=$itcl_search/itk
+ fi
+ fi
+
+-if test -z "$ITCL_LIB_DIR"; then
+- AC_MSG_ERROR(Can't find Itcl source. Use --with-itcl to specify the the toplevel [incr Tcl] directory on your system. (This directory should contain itcl/library/itcl.tcl, itk/library/itk.tcl, and config/mkinstalldirs.))
+-fi
++# Quick hack, comment out following, breaks tests, but oh well.
++#if test -z "$ITCL_LIB_DIR"; then
++# AC_MSG_ERROR(Can't find Itcl source. Use --with-itcl to specify the the toplevel [incr Tcl] directory on your system. (This directory should contain itcl/library/itcl.tcl, itk/library/itk.tcl.))
++#fi
++
+
+
+ #--------------------------------------------------------------------
+--- iwidgets4-4.0.1.orig/configure
++++ iwidgets4-4.0.1/configure
+@@ -808,18 +808,18 @@
+ ITCL_LIB_DIR=""
+ if test -r $itcl_search/itcl/library/itcl.tcl; then
+ if test -r $itcl_search/itk/library/itk.tcl; then
+- if test -r $itcl_search/config/mkinstalldirs; then
+- ITCL_LIB_DIR=$itcl_search/itcl/library
+- ITCL_SRC_DIR=$itcl_search/itcl
+- ITK_LIB_DIR=$itcl_search/itk/library
+- ITK_SRC_DIR=$itcl_search/itk
+- fi
++ ITCL_LIB_DIR=$itcl_search/itcl/library
++ ITCL_SRC_DIR=$itcl_search/itcl
++ ITK_LIB_DIR=$itcl_search/itk/library
++ ITK_SRC_DIR=$itcl_search/itk
+ fi
+ fi
+
+-if test -z "$ITCL_LIB_DIR"; then
+- { echo "configure: error: Can't find Itcl source. Use --with-itcl to specify the the toplevel incr Tcl directory on your system. (This directory should contain itcl/library/itcl.tcl, itk/library/itk.tcl, and config/mkinstalldirs.)" 1>&2; exit 1; }
+-fi
++# Quick hack, comment out following, breaks tests, but oh well.
++#if test -z "$ITCL_LIB_DIR"; then
++# AC_MSG_ERROR(Can't find Itcl source. Use --with-itcl to specify the the toplevel [incr Tcl] directory on your system. (This directory should contain itcl/library/itcl.tcl, itk/library/itk.tcl.))
++#fi
++
+
+
+ #--------------------------------------------------------------------
+--- iwidgets4-4.0.1.orig/Makefile.in
++++ iwidgets4-4.0.1/Makefile.in
+@@ -50,12 +50,6 @@
+ # Top-level directory in which to install manual entries:
+ MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man/mann
+
+-# Directory containing Tcl source code (for library used during test):
+-TCL_SRC_DIR = @TCL_SRC_DIR@
+-
+-# Directory containing Tk source code (for library used during test):
+-TK_SRC_DIR = @TK_SRC_DIR@
+-
+ # Itcl libraries can be found here:
+ ITCL_LIB_DIR = @ITCL_LIB_DIR@
+
+@@ -78,11 +72,11 @@
+ # modify any of this stuff by hand.
+ #----------------------------------------------------------------
+
+-INSTALL = $(TCLSH_PROG) `$(CYGPATH) $(ITCL_SRC_DIR)/../config/installFile.tcl` -c
++INSTALL = $(TCLSH_PROG) `$(CYGPATH) $(srcdir)/installFile.tcl` -c
+ INSTALL_PROGRAM = $(INSTALL)
+ INSTALL_DATA = $(INSTALL) -m 644
+ INSTALL_SCRIPT = $(INSTALL) -m 555
+-MKINSTALLDIRS = $(ITCL_SRC_DIR)/../config/mkinstalldirs
++MKINSTALLDIRS = $(srcdir)/mkinstalldirs
+ RANLIB = @RANLIB@
+ LN_S = ln -s
+ TOP_DIR = $(srcdir)
+@@ -109,14 +103,11 @@
+ install: install-libraries install-doc install-demos
+
+ test:
+- LD_LIBRARY_PATH=$(ITCL_LIB_DIR):$(ITK_LIB_DIR):$(LD_LIBRARY_PATH); export LD_LIBRARY_PATH ; \
+- TCL_LIBRARY=$(TCL_SRC_DIR)/library; export TCL_LIBRARY; \
++# removed LD_LIBRARY_PATH - if you have to set that, your system is broken
+ ITCL_LIBRARY=$(ITCL_LIB_DIR); export ITCL_LIBRARY; \
+- TK_LIBRARY=$(TK_SRC_DIR)/library; export TK_LIBRARY; \
+ ITK_LIBRARY=$(ITK_LIB_DIR); export ITK_LIBRARY; \
+ IWIDGETS_LIBRARY=@IWIDGETS_SRC_DIR@; export IWIDGETS_LIBRARY; \
+- $(TCLSH_PROG) `@CYGPATH@ $(srcdir)/tests/all.tcl` \
+- -exedir `@CYGPATH@ $(TK_SRC_DIR)/unix` $(TESTFLAGS)
++ $(TCLSH_PROG) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
+
+ install-libraries:
+ @$(MKINSTALLDIRS) $(SCRIPT_INSTALL_DIR) $(LIB_INSTALL_DIR)
+--- iwidgets4-4.0.1.orig/installFile.tcl
++++ iwidgets4-4.0.1/installFile.tcl
+@@ -0,0 +1,119 @@
++#!/bin/sh
++#
++# installFile.tcl - a Tcl version of install-sh
++# that copies a file and preserves its permission bits.
++# This also optimizes out installation of existing files
++# that have the same size and time stamp as the source.
++#
++# \
++exec tclsh "$0" ${1+"$@"}
++
++set doCopy 0 ;# Rename files instead of copy
++set doStrip 0 ;# Strip the symbols from installed copy
++set verbose 0
++set src ""
++set dst ""
++
++# Process command line arguments, compatible with install-sh
++
++for {set i 0} {$i < $argc} {incr i} {
++ set arg [lindex $argv $i]
++ switch -- $arg {
++ -c {
++ set doCopy 1
++ }
++ -m {
++ incr i
++ # Assume UNIX standard "644", etc, so force Tcl to think octal
++ set permissions 0[lindex $argv $i]
++ }
++ -o {
++ incr i
++ set owner [lindex $argv $i]
++ }
++ -g {
++ incr i
++ set group [lindex $argv $i]
++ }
++ -s {
++ set doStrip 1
++ }
++ -v {
++ set verbose 1
++ }
++ default {
++ set src $arg
++ incr i
++ set dst [lindex $argv $i]
++ break
++ }
++ }
++}
++if {[string length $src] == 0} {
++ puts stderr "$argv0: no input file specified"
++ exit 1
++}
++if {[string length $dst] == 0} {
++ puts stderr "$argv0: no destination file specified"
++ exit 1
++}
++
++# Compatibility with CYGNUS-style pathnames
++regsub {^/(cygdrive)?/(.)/(.*)} $src {\2:/\3} src
++regsub {^/(cygdrive)?/(.)/(.*)} $dst {\2:/\3} dst
++
++if {$verbose && $doStrip} {
++ puts stderr "Ignoring -s (strip) option for $dst"
++}
++if {[file isdirectory $dst]} {
++ set dst [file join $dst [file tail $src]]
++}
++
++# Temporary file name
++
++set dsttmp [file join [file dirname $dst] #inst.[pid]#]
++
++# Optimize out install if the file already exists
++
++set actions ""
++if {[file exists $dst] &&
++ ([file mtime $src] == [file mtime $dst]) &&
++ ([file size $src] == [file size $dst])} {
++
++ # Looks like the same file, so don't bother to copy.
++ # Set dsttmp in case we still need to tweak mode, group, etc.
++
++ set dsttmp $dst
++ lappend actions "already installed"
++} else {
++ file copy -force $src $dsttmp
++ lappend actions copied
++}
++
++# At this point "$dsttmp" is installed, but might not have the
++# right permissions and may need to be renamed.
++
++
++foreach attrName {owner group permissions} {
++ upvar 0 $attrName attr
++
++ if {[info exists attr]} {
++ if {![catch {file attributes $dsttmp -$attrName} dstattr]} {
++
++ # This system supports "$attrName" kind of attributes
++
++ if {($attr != $dstattr)} {
++ file attributes $dsttmp -$attrName $attr
++ lappend actions "set $attrName to $attr"
++ }
++ }
++ }
++}
++
++if {[string compare $dst $dsttmp] != 0} {
++ file rename -force $dsttmp $dst
++}
++if {$verbose} {
++ puts stderr "$dst: [join $actions ", "]"
++}
++exit 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|