forked from wrljet/hercules-helper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helper-build-regina-netbsd.sh
executable file
·95 lines (70 loc) · 2.43 KB
/
helper-build-regina-netbsd.sh
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env bash
# helper-build-regina-netbsd.sh
#
# Helper to build Regina REXX on NetBSD
#
# The most recent version of this project can be obtained with:
# git clone https://github.com/wrljet/hercules-helper.git
# or:
# wget https://github.com/wrljet/hercules-helper/archive/master.zip
#
# Please report errors in this to me so everyone can benefit.
#
# Bill Lewis bill@wrljet.com
#
#-----------------------------------------------------------------------------
#
# This works for me, but should be considered just an example
# NOT YET READY FOR USE!
msg="$(basename "$0"):
This script will build and install Regina REXX on NetBSD.
Your sudo password will be required.
"
echo "$msg"
read -p "Ctrl+C to abort here, or hit return to continue"
#-----------------------------------------------------------------------------
# 'realpath' doesn't exist on MacOS or BSDs
# SCRIPT_PATH=$(dirname $(realpath -s $0))
# FIXME: this doesn't work if this script is running off a symlink
SCRIPT_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")
SCRIPT_DIR="$(dirname $SCRIPT_PATH)"
WORK_DIR="$(pwd)"
if test "$WORK_DIR" = "$SCRIPT_DIR"; then
# echo "Cannot build in the script directory"
printf "\033[1;31merror: \033[0mCannot build in the script directory\n"
exit 1
fi
msg="
$(basename "$0"):
This script will download, build and install Regina-REXX 3.9.3 on NetBSD.
Run this from the directory where you want the Regina sources.
It will install locally.
"
echo "$msg"
echo "SCRIPT_PATH = $SCRIPT_PATH"
echo "SCRIPT_DIR = $SCRIPT_DIR"
echo "WORK_DIR = $WORK_DIR"
echo "which -a regina"
which -a regina
echo #
read -p "Ctrl+C to abort here, or hit return to continue"
# Building Regina REXX
wget "http://www.wrljet.com/ibm360/regina-rexx-3.9.3.tar.gz"
tar xfz regina-rexx-3.9.3.tar.gz
cd regina-rexx-3.9.3
cp $SCRIPT_DIR/patches/config.* common/
# Patch configure
patch -u configure -i "$SCRIPT_DIR/patches/regina-rexx-3.9.3.patch"
CFLAGS="-Wno-error=implicit-function-declaration" ./configure --enable-64bit --prefix=$WORK_DIR/rexx
gmake clean
gmake
# install
gmake install
cd ..
# these must be added to the bash profile
export PATH="$WORK_DIR/rexx/bin:$PATH"
export LD_LIBRARY_PATH="$WORK_DIR/rexx/lib:$LD_LIBRARY_PATH"
export CPPFLAGS="$CPPFLAGS -I $WORK_DIR/rexx/include"
# test the installation
which regina
regina -v