Changeset 32008 for main/trunk
- Timestamp:
- 2017-09-28T20:34:52+13:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/makegs2.sh
r32007 r32008 39 39 40 40 if [[ "x$getgnomelib" == "x" && "x$getimagick" == "x" ]]; then 41 echo " No recognised args provided"41 echo "Launching with no args" 42 42 fi 43 43 … … 85 85 echo "****************************************" 86 86 87 # Get the imagemagick precompiled binary for the OS system if compilation was successful 88 if [[ "$status" == "0" && "x$getimagick" == "ximagemagick" ]]; then 87 89 88 imgpkg=89 if [ "x$getimagick" = "ximagemagick" ]; then 90 os=`uname`90 imgpkg= 91 92 os=`uname` 91 93 92 94 if [ "x$os" = "xDarwin" ]; then 93 # by default, resort to the Mac Leopard (10.5) imagemagick binary 94 imgpkg=http://trac.greenstone.org/export/head/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz 95 # The imagemagick binary built on El Capitan (10.11) was made backwards compatible up to and including Mountain Lion (10.8) using the mmacosx-version-min flag. 96 # The kernel version of Mountain Lion is 12.6.0. For El Capitan it's 15.6.0 97 # So any kernel version less than 12, we'll use the Leopard (10.5) imagemagick binary, and for greater, we'll use the El Capitan imgmagick binary 98 99 # by default on Macs, will resort to the MountainLion-and-later compatible ElCapitan binary 100 imgpkg=http://trac.greenstone.org/export/head/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.11.tar.gz 95 101 96 102 kernelVersion=`uname -r` 103 104 # kernel version is something like 15.6.0, need the major version number to do integer (not float) comparisons 105 106 # https://stackoverflow.com/questions/20348097/bash-extract-string-before-a-colon 107 # doesn't work, even when put into backticks: 108 # majorKernelVersion=sed 's/\..*//' 109 110 # Using pure bash solution to substring before first period mark 111 # NOTE: two percent signs gets chars up to the first occurrence of period mark. Single percent sign gets chars up to last period mark. 112 majorKernelVersion=${kernelVersion%%\.*} 113 echo "MacOS major kernel version: $majorKernelVersion" 114 115 # bash evaluates string as integer/vice-versa depending on context 116 # https://unix.stackexchange.com/questions/232384/argument-string-to-integer-in-bash 117 # http://tldp.org/LDP/abs/html/comparison-ops.html 118 97 119 # El Capitan is MacOS version 10.11 but its kernelVersion is 15.6.0 98 if [ "x$kernelVersion" = "x15.6.0" ]; then 99 echo "Getting imagemagick built for El Capitan" 100 imgpkg=http://trac.greenstone.org/export/head/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.11.tar.gz 120 # For MacOS versions older than Mountain Lion/10.8 (kernel 12.6.0) use the Mac Leopard (10.5) imagemagick binary 121 if [ "$majorKernelVersion" -lt "12" ]; then 122 echo "Getting imagemagick built on Mac Leopard" 123 imgpkg=http://trac.greenstone.org/export/head/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.5.tar.gz 101 124 else 102 echo "Getting imagemagick built on Mac Leopard"125 echo "Getting imagemagick built for El Capitan 10.11 (15.6.0) that's compatible with Mountain Lion 10.8 (kernel v 12.6.0) and onwards" 103 126 fi 104 127 105 128 pushd ext 106 129 curl $imgpkg > imagemagick.tar.gz 107 tar -xvzf imagemagick.tar.gz 130 tar -xzf imagemagick.tar.gz 131 rm -rf ../bin/darwin/imagemagick 108 132 mv imagemagick/darwin ../bin/darwin/imagemagick 109 133 popd … … 115 139 echo "Getting 64 bit imagemagick precompiled binary" 116 140 wget http://trac.greenstone.org/export/head/gs2-extensions/imagemagick/trunk/imagemagick-linux-x64.tar.gz 117 tar -x vzf imagemagick-linux-x64.tar.gz141 tar -xzf imagemagick-linux-x64.tar.gz 118 142 else 119 143 echo "Getting 32 bit imagemagick precompiled binary" 120 144 wget http://trac.greenstone.org/export/head/gs2-extensions/imagemagick/trunk/imagemagick-linux.tar.gz 121 tar -x vzf imagemagick-linux.tar.gz145 tar -xzf imagemagick-linux.tar.gz 122 146 fi 123 147 148 rm -rf ../bin/linux/imagemagick 124 149 mv imagemagick/linux ../bin/linux/imagemagick 125 150 popd
Note:
See TracChangeset
for help on using the changeset viewer.