Diff

Differences From Artifact [374386d172]:

To Artifact [6de0efa651]:


     1      1   #! /usr/bin/env bash
     2      2   
     3         -if [ ! -f 'build.sh' ]; then
     4         -	echo 'ERROR: This script must be run from the directory it is in' >&2
            3  +# BuildCompatible: KitCreator
     5      4   
     6         -	exit 1
     7         -fi
     8         -if [ -z "${TCLVERS}" ]; then
     9         -	echo 'ERROR: The TCLVERS environment variable is not set' >&2
            5  +pkg='dbus'
            6  +version="2.0"
            7  +url="http://sourceforge.net/projects/dbus-tcl/files/dbus/${version}/dbus-${version}.tar.gz"
            8  +sha256='428b4045d395b0d26255730ce7c0d14850e45abb3c7cc6d9d48c1d2b723bb16a'
    10      9   
    11         -	exit 1
    12         -fi
           10  +function postinstall() {
           11  +	local archive
    13     12   
    14         -# Preparation
    15         -
    16         -rm -rf 'build' 'out' 'inst'
    17         -mkdir 'build' 'out' 'inst' || exit 1
    18         -
    19         -# The dbus package
    20         -
    21         -DBUSVERS="2.0"
    22         -SRC="src/dbus-${DBUSVERS}.tar.gz"
    23         -SRCURL="http://sourceforge.net/projects/dbus-tcl/files/dbus/${DBUSVERS}/dbus-${DBUSVERS}.tar.gz/download"
    24         -SRCHASH='-'
    25         -BUILDDIR="$(pwd)/build/dbus-${DBUSVERS}"
    26         -OUTDIR="$(pwd)/out"
    27         -INSTDIR="$(pwd)/inst"
    28         -export DBUSVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR
    29         -
    30         -# Set configure options for this sub-project
    31         -LDFLAGS="${LDFLAGS} ${KC_DBUS_LDFLAGS}"
    32         -CFLAGS="${CFLAGS} ${KC_DBUS_CFLAGS}"
    33         -CPPFLAGS="${CPPFLAGS} ${KC_DBUS_CPPFLAGS}"
    34         -LIBS="${LIBS} ${KC_DBUS_LIBS}"
    35         -export LDFLAGS CFLAGS CPPFLAGS LIBS
    36         -
    37         -if [ ! -f "${SRC}" ]; then
    38         -	mkdir 'src' >/dev/null 2>/dev/null
    39         -
    40         -	if [ ! -d 'buildsrc' ]; then
    41         -		download "${SRCURL}" "${SRC}" "${SRCHASH}" || exit 1
           13  +	archive="$(find "${installdir}" -name '*.a' | head -n 1)"
           14  +	if [ -n "${archive}" ]; then
           15  +		echo '-ldbus-1' > "${archive}.linkadd"
    42     16   	fi
    43         -fi
    44         -
    45         -(
    46         -	cd 'build' || exit 1
    47         -
    48         -	if [ ! -d '../buildsrc' ]; then
    49         -		gzip -dc "../${SRC}" | tar -xf -
    50         -	else    
    51         -		cp -rp ../buildsrc/* './'
    52         -	fi
    53         -
    54         -	cd "${BUILDDIR}" || exit 1
    55         -	echo "Running: ./configure --prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
    56         -	./configure --prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA}
    57         -
    58         -	echo "Running: ${MAKE:-make}"
    59         -	${MAKE:-make} || exit 1
    60         -
    61         -	echo "Running: ${MAKE:-make} install"
    62         -	${MAKE:-make} install
    63         -
    64         -	mkdir "${OUTDIR}/lib" || exit 1
    65         -	cp -r "${INSTDIR}/lib"/dbus* "${OUTDIR}/lib/"
    66         -
    67         -        "${STRIP:-strip}" -g "${OUTDIR}"/lib/dbus-*/*.so >/dev/null 2>/dev/null
    68         -	exit 0
    69         -) || exit 1
    70         -
    71         -# The dbif module
    72         -
    73         -DBIFVERS="1.0"
    74         -SRC="src/dbif-${DBIFVERS}.tar.gz"
    75         -SRCURL="http://sourceforge.net/projects/dbus-tcl/files/dbif/${DBIFVERS}/dbif-${DBIFVERS}.tar.gz/download"
    76         -BUILDDIR="$(pwd)/build/dbif-${DBIFVERS}"
    77         -OUTDIR="$(pwd)/out"
    78         -INSTDIR="$(pwd)/inst"
    79         -export DBIFVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR
    80         -
    81         -# Set configure options for this sub-project
    82         -LDFLAGS="${KC_DBIF_LDFLAGS}"
    83         -CFLAGS="${KC_DBIF_CFLAGS}"
    84         -CPPFLAGS="${KC_DBIF_CPPFLAGS}"
    85         -LIBS="${KC_DBIF_LIBS}"
    86         -export LDFLAGS CFLAGS CPPFLAGS LIBS
    87         -
    88         -if [ ! -f "${SRC}" ]; then
    89         -	mkdir 'src' >/dev/null 2>/dev/null
    90         -
    91         -	if [ ! -d 'buildsrc' ]; then
    92         -		rm -f "${SRC}.tmp"
    93         -		wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
    94         -		mv "${SRC}.tmp" "${SRC}"
    95         -	fi
    96         -fi
    97         -
    98         -(
    99         -	cd 'build' || exit 1
   100         -
   101         -	if [ ! -d '../buildsrc' ]; then
   102         -		gzip -dc "../${SRC}" | tar -xf -
   103         -	else    
   104         -		cp -rp ../buildsrc/* './'
   105         -	fi
   106         -
   107         -	cd "${BUILDDIR}" || exit 1
   108         -	echo "Running: ./configure --prefix=\"${INSTDIR}\" moduledir=\"${INSTDIR}/lib/tcl8/8.5\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
   109         -	./configure --prefix="${INSTDIR}" moduledir="${INSTDIR}/lib/tcl8/8.5" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA}
   110         -
   111         -	echo "Running: ${MAKE:-make}"
   112         -	${MAKE:-make} || exit 1
   113         -
   114         -	echo "Running: ${MAKE:-make} install"
   115         -	${MAKE:-make} install
   116         -
   117         -	mkdir -p "${OUTDIR}/lib/tcl8/8.5" || exit 1
   118         -	cp -r "${INSTDIR}/lib/tcl8/8.5/"dbif*.tm "${OUTDIR}/lib/tcl8/8.5/"
   119         -	exit 0
   120         -) || exit 1
   121         -
   122         -exit 0
           17  +}