|
3 | 3 | set -euo pipefail |
4 | 4 |
|
5 | 5 | CMAKE_PACKAGE_ROOT_ARGS="" |
| 6 | +rhelVersion=NONE |
6 | 7 |
|
7 | 8 | _versionCompare() { |
8 | 9 | local a b IFS=. ; set -f |
@@ -76,6 +77,8 @@ _installCommonDev() { |
76 | 77 | gtestChecksum="a1279c6fb5bf7d4a5e0d0b2a4adb39ac" |
77 | 78 | bisonVersion=3.8.2 |
78 | 79 | bisonChecksum="1e541a097cda9eca675d29dd2832921f" |
| 80 | + flexVersion=2.6.4 |
| 81 | + flexChecksum="2882e3179748cc9f9c23ec593d6adc8d" |
79 | 82 |
|
80 | 83 | rm -rf "${baseDir}" |
81 | 84 | mkdir -p "${baseDir}" |
@@ -116,6 +119,21 @@ _installCommonDev() { |
116 | 119 | fi |
117 | 120 | CMAKE_PACKAGE_ROOT_ARGS+=" -D bison_ROOT=$(realpath ${bisonPrefix}) " |
118 | 121 |
|
| 122 | + # Flex |
| 123 | + flexPrefix=${PREFIX:-"/usr/local"} |
| 124 | + if [[ ${rhelVersion} == 9 ]] && [ ! -f ${flexPrefix}/bin/flex ]; then |
| 125 | + cd "${baseDir}" |
| 126 | + eval wget https://github.com/westes/flex/releases/download/v${flexVersion}/flex-${flexVersion}.tar.gz |
| 127 | + md5sum -c <(echo "${flexChecksum} flex-${flexVersion}.tar.gz") || exit 1 |
| 128 | + tar xf flex-${flexVersion}.tar.gz |
| 129 | + cd flex-${flexVersion} |
| 130 | + ./configure --prefix=${flexPrefix} |
| 131 | + make -j $(nproc) |
| 132 | + make -j $(nproc) install |
| 133 | + else |
| 134 | + echo "Flex already installed." |
| 135 | + fi |
| 136 | + |
119 | 137 | # SWIG |
120 | 138 | swigPrefix=${PREFIX:-"/usr/local"} |
121 | 139 | swigBin=${swigPrefix}/bin/swig |
@@ -423,7 +441,7 @@ _installRHELPackages() { |
423 | 441 | yum -y update |
424 | 442 | yum -y install tzdata |
425 | 443 | yum -y install redhat-rpm-config rpm-build |
426 | | - yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm |
| 444 | + yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-${rhelVersion}.noarch.rpm |
427 | 445 | yum -y install \ |
428 | 446 | autoconf \ |
429 | 447 | automake \ |
@@ -452,17 +470,29 @@ _installRHELPackages() { |
452 | 470 | qt5-qtcharts-devel \ |
453 | 471 | qt5-qtimageformats \ |
454 | 472 | readline \ |
| 473 | + tcl-devel \ |
455 | 474 | tcl-tclreadline \ |
456 | 475 | tcl-tclreadline-devel \ |
457 | 476 | tcl-thread-devel \ |
458 | 477 | tcllib \ |
459 | 478 | wget \ |
460 | 479 | zlib-devel |
461 | 480 |
|
462 | | - yum install -y \ |
463 | | - https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/flex-2.6.4-9.el9.x86_64.rpm \ |
464 | | - https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/readline-devel-8.1-4.el9.x86_64.rpm \ |
465 | | - https://rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/tcl-devel-8.6.10-7.el9.x86_64.rpm |
| 481 | + if [[ ${rhelVersion} == 8 ]]; then |
| 482 | + yum install -y \ |
| 483 | + gcc-toolset-13 \ |
| 484 | + python3.12 \ |
| 485 | + python3.12-devel \ |
| 486 | + python3.12-pip |
| 487 | + alternatives --set python $(command -v python3.12) |
| 488 | + alternatives --set python3 $(command -v python3.12) |
| 489 | + fi |
| 490 | + if [[ ${rhelVersion} == 9 ]]; then |
| 491 | + yum install -y \ |
| 492 | + https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/flex-2.6.4-9.el9.x86_64.rpm \ |
| 493 | + https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/readline-devel-8.1-4.el9.x86_64.rpm \ |
| 494 | + https://rpmfind.net/linux/centos-stream/9-stream/AppStream/x86_64/os/Packages/tcl-devel-8.6.10-7.el9.x86_64.rpm |
| 495 | + fi |
466 | 496 |
|
467 | 497 | eval wget https://github.com/jgm/pandoc/releases/download/${pandocVersion}/pandoc-${pandocVersion}-linux-${arch}.tar.gz |
468 | 498 | tar xvzf pandoc-${pandocVersion}-linux-${arch}.tar.gz --strip-components 1 -C /usr/local/ |
@@ -902,21 +932,26 @@ case "${os}" in |
902 | 932 | elif [[ "${os}" == "Rocky Linux" ]]; then |
903 | 933 | rhelVersion=$(rpm -q --queryformat '%{VERSION}' rocky-release | cut -d. -f1) |
904 | 934 | fi |
905 | | - if [[ "${rhelVersion}" != "9" ]]; then |
906 | | - echo "ERROR: Unsupported ${rhelVersion} version. Only '9' is supported." |
| 935 | + if [[ "${rhelVersion}" != "8" ]] && [[ "${rhelVersion}" != "9" ]]; then |
| 936 | + echo "ERROR: Unsupported ${rhelVersion} version. Versions '8' and '9' are supported." |
907 | 937 | exit 1 |
908 | 938 | fi |
909 | 939 | if [[ ${CI} == "yes" ]]; then |
910 | 940 | echo "WARNING: Installing CI dependencies is only supported on Ubuntu 22.04" >&2 |
911 | 941 | fi |
912 | 942 | if [[ "${option}" == "base" || "${option}" == "all" ]]; then |
913 | 943 | _checkIsLocal |
914 | | - _installRHELPackages |
| 944 | + _installRHELPackages "${rhelVersion}" |
915 | 945 | _installRHELCleanUp |
916 | 946 | fi |
917 | 947 | if [[ "${option}" == "common" || "${option}" == "all" ]]; then |
918 | 948 | _installCommonDev |
919 | | - _installOrTools "rockylinux" "9" "amd64" |
| 949 | + if [[ "${rhelVersion}" == "8" ]]; then |
| 950 | + _installOrTools "AlmaLinux" "8.10" "x86_64" |
| 951 | + fi |
| 952 | + if [[ "${rhelVersion}" == "9" ]]; then |
| 953 | + _installOrTools "rockylinux" "9" "amd64" |
| 954 | + fi |
920 | 955 | fi |
921 | 956 | ;; |
922 | 957 | "Darwin" ) |
|
0 commit comments