summaryrefslogtreecommitdiffstats
path: root/release/scripts/X11/build_x.sh
blob: a3930603b350f87d0ba2d86332fbe191583ba0fb (plain)
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
#!/bin/sh
#
# Builds X from the port and stores it under the specified directory.

# usage information
#
usage() {
	echo "$0 <output dir>"
	echo
	echo "Where <output dir> is the base directory to install X into.  This"
	echo "script also assumes that it can checkout XFree86 into "
	echo `dirname $0`"/XFree86, that it can get the distfiles from"
	echo "/usr/ports/distfiles (or fetch them into that directory), and"
	echo "that the file "`dirname $0`"/configure exists and replaces the"
	echo "scripts/configure script used in the XFree86 port."
	echo
	echo "Also, this should really be run as root."
	exit 1
}

# check the command line
if [ $# -ne 1 ]; then
	usage
fi

# setup the output dir
output_dir=$1
case $output_dir in
	/*)
		;;
	*)
		output_dir=`pwd`/${output_dir}
		;;
esac
if ! mkdir -p $1; then
	echo "Could not create ${output_dir}!"
	echo
	usage
fi

# extract the directory this script lives in
home_dir=`dirname $0`

# check out the XFree86 and XFree86-contrib ports and set them up
if ! ( cd $home_dir && cvs -R -d ${CVSROOT} co -P XFree86 XFree86-contrib && \
		cd XFree86 && patch < ../XF86.patch ); then
	echo "Could not checkout the XFree86 port!"
	echo
	usage
fi

# actually build X
if ! ( cd $home_dir/XFree86 && \
		make DISTDIR=/usr/ports/distfiles DESTDIR=${output_dir} \
		NO_PKG_REGISTER=yes all install ); then
	echo "Could not build XFree86!"
	echo
	usage
fi
if ! ( cd $home_dir/XFree86-contrib && \
		make DISTDIR=/usr/ports/distfiles DESTDIR=${output_dir} \
		NO_PKG_REGISTER=yes all install ); then
	echo "Could not build XFree86-contrib!"
	echo
	usage
fi
OpenPOWER on IntegriCloud