updated on Sun Jan 22 16:00:49 UTC 2012
[aur-mirror.git] / path64-git / PKGBUILD
blob6924d5016562c2b047727b442431ea662a11faae
1 # Contributor: Martin Peres <martin.peres@ensi-bourges.fr>
2 pkgname=path64-git
3 pkgver=20101018
4 pkgrel=3
5 pkgdesc="Path64 AMD64 optimized C/C++/Fortran compiler"
6 arch=('x86_64')
7 url="http://www.path64.org"
8 license=('GPL')
9 groups=()
10 depends=('gcc42')
11 makedepends=()
12 provides=()
13 conflicts=()
14 replaces=()
15 backup=()
16 options=()
17 install=
18 source=('pathcc' 'pathCC' 'pathf90' 'pathf95')
19 noextract=()
20 md5sums=('79ef420a20168d9d159f50f5ba8fe6cc'
21          '0b4a20d924e384c568b384f7be5d5f8c'
22          'e213571bf1dacccd94e3556b1a091e62'
23          '5386cd97a53de154fe8747ef5d0fe2d1')
25 _gitroot="http://github.com/path64/compiler.git"
26 _gitname="path64"
28 build() {
29   cd "$srcdir"
30   msg "Connecting to GIT server...."
32   if [ -d $_gitname ] ; then
33     cd $_gitname && git pull origin
34     msg "The local files are updated."
35   else
36     git clone $_gitroot $_gitname
37   fi
39   msg "GIT checkout done or server timeout"
40   msg "Starting make..."
42   # Release
43   rm -rf "$srcdir/$_gitname-build"
44   git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
46   mkdir "$srcdir/$_gitname-build/build"
47   cd "$srcdir/$_gitname-build/build"
48   
49   # Debug
50   #cd "$srcdir/$_gitname/build"
51   
52   unset CFLAGS
53   unset CXXFLAGS
54   unset LDFLAGS
56   LDFLAGS="-s"
58   cmake -DCMAKE_BUILD_TYPE=Debug \
59         -DPATH64_ENABLE_TARGETS="x86_64" \
60         -DPATH64_ENABLE_MATHLIBS=ON \
61         -DPATH64_ENABLE_FORTRAN=ON \
62         -DPSC_CRT_PATH_x86_64=/usr/lib \
63         -DPSC_DYNAMIC_LINKER_x86_64=/lib/ld-linux-x86-64.so.2 \
64         -DPSC_LIBSUPCPP_PATH_x86_64=/usr/lib/gcc/x86_64-linux-gnu/4.2.4 \
65         -DPSC_LIBSTDCPP_PATH_x86_64=/usr/lib/gcc/x86_64-linux-gnu/4.2.4 \
66         -DPSC_LIBGCC_PATH_x86_64=/usr/lib/gcc/x86_64-linux-gnu/4.2.4 \
67         -DPSC_LIBGCC_EH_PATH_x86_64=/usr/lib/gcc/x86_64-linux-gnu/4.2.4 \
68         -DPSC_LIBGCC_S_PATH_x86_64=/usr/lib/gcc/x86_64-linux-gnu/4.2.4 \
69         -DCMAKE_Fortran_COMPILER=/usr/bin/gfortran-4.2 \
70         -DCMAKE_C_COMPILER=/usr/bin/gcc-4.2 \
71         -DCMAKE_CXX_COMPILER=/usr/bin/g++-4.2 .. 
74   make PATHGPP=/usr/bin/g++-4.2 || return 1
75   make DESTDIR="$pkgdir/" install || return 1
77   # Python fixes
78   sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
79          -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" "$pkgdir/opt/path64/bin/explain"
80         
81   # Install the wrapper in /usr/bin
82   mkdir -p "$pkgdir/usr/bin/"
83   cp "$srcdir/pathcc" "$pkgdir/usr/bin/"
84   cp "$srcdir/pathCC" "$pkgdir/usr/bin/"
85   cp "$srcdir/pathf90" "$pkgdir/usr/bin/"
86   cp "$srcdir/pathf95" "$pkgdir/usr/bin/"