summaryrefslogtreecommitdiff
path: root/Tools/portbuild/scripts/makeparallel
blob: 621d1ef0abbd5968364a1583ce3018f6e998b69c (plain) (blame)
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
#!/bin/sh

pb=/var/portbuild

if [ $# -ne 2 ]; then
	echo "usage: makeparallel arch branch"
	exit 1
fi

arch=$1
branch=$2

. ${pb}/${arch}/portbuild.conf
. ${pb}/scripts/buildenv

buildenv ${pb} ${arch} ${branch}

# packages that take a long time to build or have very deep dependency
# trees and tend to stall the rest of the cluster waiting for them.
# We try to start these as early as possible.

quickports="lang/ghc x11/XFree86-4 editors/openoffice-1.1 x11/gnome2 x11/kde3 editors/openoffice-1.0 chinese/openoffice-1.0-zh_CN chinese/openoffice-1.0-zh_TW editors/openoffice-1.0 editors/openoffice-1.0-ar editors/openoffice-1.0-dk editors/openoffice-1.0-es editors/openoffice-1.0-gr editors/openoffice-1.0-it editors/openoffice-1.0-nl editors/openoffice-1.0-se editors/openoffice-1.0-tr french/openoffice-1.0 german/openoffice-1.0 japanese/openoffice-1.0 korean/openoffice-1.0 polish/openoffice-1.0 portuguese/openoffice-1.0 russian/openoffice-1.0 math/atlas math/atlas-devel java/jdk14"

cd ${PORTSDIR}
subdir=$(make -V SUBDIR)
makefile=${pb}/${arch}/${branch}/Makefile
rm ${makefile}

SUBDIR=$(make -V SUBDIR)
(for dir in ${SUBDIR}; do
	[ -r ${dir}/Makefile ] && echo "all: ${dir}-all" || true
done
env arch=${arch} branch=${branch} awk -F '|' '{me=$1; here=$2; bdep=$8; rdep=$9
	edep=$11; pdep=$12; fdep=$13
	sufx=ENVIRON["PKGSUFFIX"]
	arch=ENVIRON["arch"]
	branch=ENVIRON["branch"]
	split(here, tmp, "/")
	if (edep != "") { gsub("$", sufx, edep); gsub(" ", sufx " ", edep) }
	if (pdep != "") { gsub("$", sufx, pdep); gsub(" ", sufx " ", pdep) }
	if (fdep != "") { gsub("$", sufx, fdep); gsub(" ", sufx " ", fdep) }
	if (bdep != "") { gsub("$", sufx, bdep); gsub(" ", sufx " ", bdep) }
	if (rdep != "") { gsub("$", sufx, rdep); gsub(" ", sufx " ", rdep) }
	print tmp[4] "-all: " me sufx
	print me ": " me sufx
	print me sufx ": " edep " " pdep " " fdep " "  bdep " " rdep
	printf("\t@/usr/bin/env XXX=\"\" ")
	if (edep != "") printf(" ED=\"%s\"", edep)
	if (pdep != "") printf(" PD=\"%s\"", pdep)
	if (fdep != "") printf(" FD=\"%s\"", fdep)
	if (bdep != "") printf(" BD=\"%s\"", bdep)
	if (rdep != "") printf(" RD=\"%s\"", rdep)
	printf(" /var/portbuild/scripts/pdispatch %s %s /var/portbuild/scripts/portbuild %s%s %s\n",
	    arch, branch, me, sufx, here)
	}' < ${INDEXFILE}) > ${makefile}

for i in ${quickports}; do
  if [ -d $i ]; then
    quickpkg="$(cd $i; make package-name)${PKGSUFFIX}"
    echo "quickports: $quickpkg" >> ${makefile}
  else
    echo "quick port directory \"$i\" does not exist -- skipping"
  fi
done