Debian Codegraph @

tools/build-freac

raw symbols SCIP
1 #!/usr/bin/env bash
2
3 # Exit on error
4 set -e
5
6 # Query OS and machine
7 uname=`uname`
8 machine=`gcc -dumpmachine`
9
10 # Number of parallel jobs
11 if [[ $uname == *MINGW* ]]; then
12 jobs=$NUMBER_OF_PROCESSORS
13 elif [[ $uname == Darwin ]]; then
14 jobs=$(sysctl -n hw.activecpu)
15 elif [[ $uname == *FreeBSD* ]]; then
16 jobs=$(sysctl -n hw.ncpu)
17 else
18 jobs=$(nproc)
19 fi
20
21 # Set x86-64 environment
22 if [[ $uname == Darwin ]]; then
23 x86_64=true
24 elif [[ $uname == *MINGW* ]] && [[ $BUILD_X86_64 == True ]]; then
25 x86_64=true
26 elif [[ $uname != *MINGW* ]]; then
27 if [[ $machine == *amd64* ]] || [[ $machine == *x86_64* ]]; then
28 x86_64=true
29 fi
30 fi
31
32 # Set make tool
33 if [[ $uname != *FreeBSD* ]]; then
34 export MAKE=make
35 else
36 export MAKE=gmake
37 fi
38
39 # Set sudo tool
40 if [[ $uname == Haiku ]]; then
41 export SUDO=
42 elif [[ $uname == *MINGW* ]]; then
43 export SUDO=true
44 else
45 export SUDO=sudo
46 fi
47
48 # Set download tool
49 if [[ $uname != Darwin ]]; then
50 export DL="wget -O"
51 else
52 export DL="curl -L -o"
53 fi
54
55 # Package locations
56 smooth_location=https://github.com/enzo1982/smooth/archive/master.zip
57 boca_location=https://github.com/enzo1982/boca/archive/master.zip
58 freac_location=https://github.com/enzo1982/freac/archive/master.zip
59
60 # Build smooth
61 $DL smooth-master.zip $smooth_location
62
63 rm -fr smooth-master
64 unzip smooth-master.zip
65
66 cd smooth-master
67 config=$1
68 if [[ $uname != *MINGW* ]] && [[ $uname != Darwin ]]; then
69 config=$config,bundledlibbz2,bundledlibfribidi,bundledlibjpeg,bundledlibpng,bundledlibxml2,bundledzlib
70
71 if [[ $uname == Haiku ]]; then
72 config=$config,bundledlibiconv
73 fi
74 fi
75 $MAKE config=$config -j$jobs
76 $SUDO $MAKE config=$config install -j$jobs
77 cd ..
78
79 # Build BoCA
80 $DL boca-master.zip $boca_location
81
82 rm -fr BoCA-master
83 unzip boca-master.zip
84
85 cp smooth-master/include/smooth.h BoCA-master/include
86
87 cp -R smooth-master/include/smooth BoCA-master/include
88 cp -R smooth-master/include/smooth-js BoCA-master/include
89
90 if [[ $uname == *MINGW* ]]; then
91 if [[ $x86_64 != true ]]; then
92 mkdir BoCA-master/lib
93 cp smooth-master/lib/libsmooth* BoCA-master/lib
94 else
95 mkdir BoCA-master/lib64
96 cp smooth-master/lib64/libsmooth* BoCA-master/lib64
97 fi
98 fi
99
100 cd BoCA-master
101 config=$1
102 if [[ $uname != *MINGW* ]] && [[ $uname != Darwin ]]; then
103 config=$config,bundledlibexpat,bundledliburiparser,bundledzlib
104 fi
105 $MAKE config=$config -j$jobs
106 $SUDO $MAKE config=$config install -j$jobs
107 if [[ $uname == Linux ]]; then
108 cd components/output/alsa
109 $MAKE config=$config -j$jobs
110 $SUDO $MAKE config=$config install -j$jobs
111 cd ../../..
112 fi
113 cd ..
114
115 # Build fre:ac
116 $DL freac-master.zip $freac_location
117
118 rm -fr freac-master
119 unzip freac-master.zip
120
121 mkdir freac-master/cdk
122
123 cp -R BoCA-master/include freac-master/cdk
124
125 if [[ $uname == *MINGW* ]]; then
126 if [[ $x86_64 != true ]]; then
127 cp -R BoCA-master/lib freac-master/cdk
128 else
129 cp -R BoCA-master/lib64 freac-master/cdk
130 fi
131 fi
132
133 cd freac-master
134 config=$1
135 $MAKE config=$config -j$jobs
136 $SUDO $MAKE config=$config install -j$jobs
137 cd ..