File: build.sh

package info (click to toggle)
darktable 1.0.4-1%2Bdeb7u2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 11,620 kB
  • sloc: ansic: 98,133; cpp: 26,859; xml: 2,202; lisp: 1,940; sh: 720; python: 274; awk: 89; makefile: 83; perl: 57; asm: 46
file content (53 lines) | stat: -rwxr-xr-x 1,093 bytes parent folder | download
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
#!/bin/sh

DT_SRC_DIR=`dirname "$0"`
DT_SRC_DIR=`cd "$DT_SRC_DIR"; pwd`

cd $DT_SRC_DIR;

INSTALL_PREFIX=$1
if [ "$INSTALL_PREFIX" =  "" ]; then
	INSTALL_PREFIX=/opt/darktable/
fi

BUILD_TYPE=$2
if [ "$BUILD_TYPE" =  "" ]; then
        BUILD_TYPE=Release
fi

echo Installing to $INSTALL_PREFIX for $BUILD_TYPE

if [ ! -d build/ ]; then
	mkdir build/
fi

cd build/

MAKE_TASKS=1
if [ `uname -s` = "SunOS" ]; then
	MAKE_TASKS=$( /usr/sbin/psrinfo |wc -l )
	MAKE=gmake
	PATH=/usr/gnu/bin:$PATH ; export PATH
else
	if [ -r /proc/cpuinfo ]; then
		MAKE_TASKS=$(grep -c "^processor" /proc/cpuinfo)
	elif [ -x /sbin/sysctl ]; then
		TMP_CORES=$(/sbin/sysctl -n hw.ncpu 2>/dev/null)
		if [ "$?" = "0" ]; then
			MAKE_TASKS=$TMP_CORES
		fi
	fi
	MAKE=make
fi

if [ "$(($MAKE_TASKS < 1))" -eq 1 ]; then
	MAKE_TASKS=1
fi

cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
	-DINSTALL_IOP_LEGACY=Off .. && $MAKE -j $MAKE_TASKS 

if [ $? = 0 ]; then
	echo "Darktable finished building, to actually install darktable you need to type:"
	echo "# cd build; sudo make install"
fi