Diff

Differences From Artifact [374386d172]:

To Artifact [6de0efa651]:


1
2
3
4
5

6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
21

22
23

24
25
26
27
28
29

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

67
68
69
70

71
72
73
74
75
76
77
78
79
80

81
82
83
84
85
86
87
88

89
90

91
92
93
94
95
96
97

98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
1
2



3




4



5








6


7






8

































9



10




11

12








13








14


15




16


17



























-
-
-
+
-
-
-
-

-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
+
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

-
-
-
+
-
-
-
-
+
-

-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
+
-
-
-
-

-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#! /usr/bin/env bash

if [ ! -f 'build.sh' ]; then
	echo 'ERROR: This script must be run from the directory it is in' >&2

# BuildCompatible: KitCreator
	exit 1
fi
if [ -z "${TCLVERS}" ]; then
	echo 'ERROR: The TCLVERS environment variable is not set' >&2

	exit 1
fi

pkg='dbus'
# Preparation

rm -rf 'build' 'out' 'inst'
mkdir 'build' 'out' 'inst' || exit 1

# The dbus package

DBUSVERS="2.0"
version="2.0"
SRC="src/dbus-${DBUSVERS}.tar.gz"
SRCURL="http://sourceforge.net/projects/dbus-tcl/files/dbus/${DBUSVERS}/dbus-${DBUSVERS}.tar.gz/download"
url="http://sourceforge.net/projects/dbus-tcl/files/dbus/${version}/dbus-${version}.tar.gz"
SRCHASH='-'
BUILDDIR="$(pwd)/build/dbus-${DBUSVERS}"
OUTDIR="$(pwd)/out"
INSTDIR="$(pwd)/inst"
export DBUSVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR

sha256='428b4045d395b0d26255730ce7c0d14850e45abb3c7cc6d9d48c1d2b723bb16a'
# Set configure options for this sub-project
LDFLAGS="${LDFLAGS} ${KC_DBUS_LDFLAGS}"
CFLAGS="${CFLAGS} ${KC_DBUS_CFLAGS}"
CPPFLAGS="${CPPFLAGS} ${KC_DBUS_CPPFLAGS}"
LIBS="${LIBS} ${KC_DBUS_LIBS}"
export LDFLAGS CFLAGS CPPFLAGS LIBS

if [ ! -f "${SRC}" ]; then
	mkdir 'src' >/dev/null 2>/dev/null

	if [ ! -d 'buildsrc' ]; then
		download "${SRCURL}" "${SRC}" "${SRCHASH}" || exit 1
	fi
fi

(
	cd 'build' || exit 1

	if [ ! -d '../buildsrc' ]; then
		gzip -dc "../${SRC}" | tar -xf -
	else    
		cp -rp ../buildsrc/* './'
	fi

	cd "${BUILDDIR}" || exit 1
	echo "Running: ./configure --prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
	./configure --prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA}

	echo "Running: ${MAKE:-make}"
	${MAKE:-make} || exit 1

	echo "Running: ${MAKE:-make} install"
	${MAKE:-make} install

	mkdir "${OUTDIR}/lib" || exit 1
	cp -r "${INSTDIR}/lib"/dbus* "${OUTDIR}/lib/"

function postinstall() {
        "${STRIP:-strip}" -g "${OUTDIR}"/lib/dbus-*/*.so >/dev/null 2>/dev/null
	exit 0
) || exit 1

	local archive
# The dbif module

DBIFVERS="1.0"
SRC="src/dbif-${DBIFVERS}.tar.gz"
SRCURL="http://sourceforge.net/projects/dbus-tcl/files/dbif/${DBIFVERS}/dbif-${DBIFVERS}.tar.gz/download"
BUILDDIR="$(pwd)/build/dbif-${DBIFVERS}"
OUTDIR="$(pwd)/out"
INSTDIR="$(pwd)/inst"
export DBIFVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR

	archive="$(find "${installdir}" -name '*.a' | head -n 1)"
# Set configure options for this sub-project
LDFLAGS="${KC_DBIF_LDFLAGS}"
CFLAGS="${KC_DBIF_CFLAGS}"
CPPFLAGS="${KC_DBIF_CPPFLAGS}"
LIBS="${KC_DBIF_LIBS}"
export LDFLAGS CFLAGS CPPFLAGS LIBS

if [ ! -f "${SRC}" ]; then
	if [ -n "${archive}" ]; then
	mkdir 'src' >/dev/null 2>/dev/null

		echo '-ldbus-1' > "${archive}.linkadd"
	if [ ! -d 'buildsrc' ]; then
		rm -f "${SRC}.tmp"
		wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
		mv "${SRC}.tmp" "${SRC}"
	fi
fi

}
(
	cd 'build' || exit 1

	if [ ! -d '../buildsrc' ]; then
		gzip -dc "../${SRC}" | tar -xf -
	else    
		cp -rp ../buildsrc/* './'
	fi

	cd "${BUILDDIR}" || exit 1
	echo "Running: ./configure --prefix=\"${INSTDIR}\" moduledir=\"${INSTDIR}/lib/tcl8/8.5\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
	./configure --prefix="${INSTDIR}" moduledir="${INSTDIR}/lib/tcl8/8.5" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA}

	echo "Running: ${MAKE:-make}"
	${MAKE:-make} || exit 1

	echo "Running: ${MAKE:-make} install"
	${MAKE:-make} install

	mkdir -p "${OUTDIR}/lib/tcl8/8.5" || exit 1
	cp -r "${INSTDIR}/lib/tcl8/8.5/"dbif*.tm "${OUTDIR}/lib/tcl8/8.5/"
	exit 0
) || exit 1

exit 0