Skip to content

Commit

Permalink
Multiple issues:
Browse files Browse the repository at this point in the history
  * #132: AlmaLinux support
  * #134: pathmung issue

Signed-off-by: Mike Detwiler <mike@detwiler.io>
  • Loading branch information
detwiler committed Dec 15, 2022
1 parent 26bf414 commit d6582ab
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 57 deletions.
15 changes: 15 additions & 0 deletions build-aux/install-buildreqs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,24 @@ test -r $OS_RELEASE_FILE || exit
. $OS_RELEASE_FILE

case $ID in
almalinux)
case $VERSION_ID in
8*)
enable_repos='plus powertools'
;;
9*)
enable_repos='plus crb'
;;
esac
$SUDO dnf --assumeyes config-manager --set-enabled $enable_repos
$SUDO dnf --assumeyes --refresh install epel-release
$SUDO dnf --assumeyes --refresh install --allowerasing $pkgs_common
;;
alpine)
$SUDO apk update
$SUDO apk add $pkgs_common
;;

centos)
case $VERSION_ID in
7)
Expand All @@ -43,6 +57,7 @@ case $ID in
$SUDO dnf --assumeyes --refresh install $repo_pkgs
$SUDO dnf --assumeyes --refresh install --allowerasing $pkgs_common $pkgs_centos
;;

debian|ubuntu)
$SUDO apt-get --assume-yes update
$SUDO apt-get --assume-yes install $pkgs_common
Expand Down
14 changes: 14 additions & 0 deletions build-aux/install-reqs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ test -r $OS_RELEASE_FILE || exit
. $OS_RELEASE_FILE

case $ID in
almalinux)
pkgs_centos="$pkgs_centos clang-tools-extra platform-python-devel"
case $VERSION_ID in
8*)
enable_repos='plus powertools'
;;
9*)
enable_repos='plus crb'
;;
esac
$SUDO dnf --assumeyes config-manager --set-enabled $enable_repos
$SUDO dnf --assumeyes --refresh install epel-release
$SUDO dnf --assumeyes --refresh install --allowerasing $pkgs_common $pkgs_centos
;;
alpine)
$SUDO apk add $pkgs_common $pkgs_alpine
;;
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ QH_VAR_ENSURE([PS1_AWS_COLOR], [bash prompt aws profile color], [$_ec_ps1_aws_d
#
# cmake3 #
AC_ARG_VAR([CMAKE], [cmake program])
AC_CHECK_PROGS([CMAKE], [cmake3 cmake], [cmake])
AC_CHECK_PROGS([CMAKE], [cmake cmake3], [no])
AM_CONDITIONAL([HAVE_CMAKE3], [test "x$CMAKE" = xcmake3])
AM_COND_IF([HAVE_CMAKE3], [AC_CONFIG_FILES([data/bash/common/bashrc.d/cmake3.sh])])

Expand Down
6 changes: 0 additions & 6 deletions data/bash/common/.bash_profile.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,4 @@ if [ -f "@pkgconfdir@/$_toolbox_name/profile" ]; then
source "@pkgconfdir@/$_toolbox_name/profile"
fi

# Set PATH so it includes user's private bin dirs if they exist
if type -t pathmung &>/dev/null; then
pathmung @bindir@
pathmung @sbindir@
fi

unset _toolbox_name
1 change: 1 addition & 0 deletions data/bash/common/profile.d/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ info.sh
python.sh
scl.sh
vim.sh
zz-path.sh
5 changes: 4 additions & 1 deletion data/bash/common/profile.d/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ macosx = macosx.sh
python = python.sh
scl = scl.sh
vim = vim.sh
zz_path = zz-path.sh

# static data/scripts (not generated; require explicit distribution)
static_data = $(bash_completion) \
Expand Down Expand Up @@ -49,7 +50,8 @@ DISTCLEANFILES = $(conf_data)
make_data = $(go) \
$(info) \
$(python) \
$(vim)
$(vim) \
$(zz_path)

if ENABLE_CONAN
make_data += $(conan)
Expand Down Expand Up @@ -83,4 +85,5 @@ EDIT = -e 's:@bindir[@]:$(bindir):g' \
-e 's:@GOPATH[@]:$(GOPATH):g' \
-e 's:@infodir[@]:$(infodir):g' \
-e 's:@prefix[@]:$(prefix):g' \
-e 's:@sbindir[@]:$(sbindir):g' \
-e 's:@vimdir[@]:$(vimdir):g'
3 changes: 3 additions & 0 deletions data/bash/common/profile.d/zz-path.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Set PATH so it includes user's private bin dirs if they exist
pathmung @bindir@
pathmung @sbindir@
109 changes: 60 additions & 49 deletions m4/envconf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ AS_VAR_SET_IF([$1],
QH_OS_RELEASE
AS_ECHO_N(['setting $1 to computed value... '])
AS_CASE([$ID],
[alpine], [AS_VAR_SET([$1], [detwiler])],
[centos], [AS_CASE([$VERSION_ID],
[7|8], [AS_VAR_SET([$1], [detwiler])],
[AS_VAR_SET([$1], [ycm-core])])],
[ubuntu], [AS_CASE([$VERSION_ID],
[18.04], [AS_VAR_SET([$1], [detwiler])],
[AS_VAR_SET([$1], [ycm-core])])],
[AS_VAR_SET([$1], [ycm-core])])
[almalinux], [AS_CASE([$VERSION_ID],
[8*], [AS_VAR_SET([$1], [detwiler])],
[AS_VAR_SET([$1], [ycm-core])])],
[alpine], [AS_VAR_SET([$1], [detwiler])],
[centos], [AS_CASE([$VERSION_ID],
[7|8], [AS_VAR_SET([$1], [detwiler])],
[AS_VAR_SET([$1], [ycm-core])])],
[ubuntu], [AS_CASE([$VERSION_ID],
[18.04], [AS_VAR_SET([$1], [detwiler])],
[AS_VAR_SET([$1], [ycm-core])])],
[AS_VAR_SET([$1], [ycm-core])])
AS_VAR_COPY([VERSION], [_ec_version])
AC_MSG_RESULT([$$1])])
]) # EC_VIM_YCM_OWNER
Expand All @@ -46,19 +49,22 @@ AS_VAR_SET_IF([$1],
QH_OS_RELEASE
AS_ECHO_N(['setting $1 to computed value... '])
AS_CASE([$ID],
[alpine], [AS_CASE([$VERSION_ID],
[3.13*], [AS_VAR_SET([$1], [llvm-10])],
[3.14*], [AS_VAR_SET([$1], [llvm-11])],
[3.15*], [AS_VAR_SET([$1], [llvm-12])],
[AS_VAR_SET([$1], [master])])],
[centos], [AS_CASE([$VERSION_ID],
[7], [AS_VAR_SET([$1], [vim-7.4.143])],
[8], [AS_VAR_SET([$1], [vim-7.4.1578])],
[AS_VAR_SET([$1], [master])])],
[ubuntu], [AS_CASE([$VERSION_ID],
[18.04], [AS_VAR_SET([$1], [vim-7.4.1578])],
[AS_VAR_SET([$1], [master])])],
[AS_VAR_SET([$1], [master])])
[almalinux], [AS_CASE([$VERSION_ID],
[8*], [AS_VAR_SET([$1], [vim-7.4.1578])],
[AS_VAR_SET([$1], [master])])],
[alpine], [AS_CASE([$VERSION_ID],
[3.13*], [AS_VAR_SET([$1], [llvm-10])],
[3.14*], [AS_VAR_SET([$1], [llvm-11])],
[3.15*], [AS_VAR_SET([$1], [llvm-12])],
[AS_VAR_SET([$1], [master])])],
[centos], [AS_CASE([$VERSION_ID],
[7], [AS_VAR_SET([$1], [vim-7.4.143])],
[8], [AS_VAR_SET([$1], [vim-7.4.1578])],
[AS_VAR_SET([$1], [master])])],
[ubuntu], [AS_CASE([$VERSION_ID],
[18.04], [AS_VAR_SET([$1], [vim-7.4.1578])],
[AS_VAR_SET([$1], [master])])],
[AS_VAR_SET([$1], [master])])
AS_VAR_COPY([VERSION], [_ec_version])
AC_MSG_RESULT([$$1])])
]) # EC_VIM_YCM_REF
Expand All @@ -80,18 +86,21 @@ AS_VAR_SET_IF([$1],
QH_OS_RELEASE
AS_ECHO_N(['setting $1 to computed value... '])
AS_CASE([$ID],
[alpine], [AS_CASE([$VERSION_ID],
[3.13*], [AS_VAR_SET([$1], [--clangd-completer])],
[3.14*], [AS_VAR_SET([$1], [--clangd-completer])],
[AS_VAR_SET([$1], ['--clangd-completer --force-sudo'])])],
[centos], [AS_CASE([$VERSION_ID],
[7], [AS_VAR_SET([$1], [--clang-completer])],
[8], [AS_VAR_SET([$1], [--clangd-completer])],
[AS_VAR_SET([$1], ['--clangd-completer --force-sudo'])])],
[ubuntu], [AS_CASE([$VERSION_ID],
[18.04], [AS_VAR_SET([$1], [--clangd-completer])],
[AS_VAR_SET([$1], ['--clangd-completer --force-sudo'])])],
[AS_VAR_SET([$1], ['--clangd-completer --force-sudo'])])
[almalinux], [AS_CASE([$VERSION_ID],
[8*], [AS_VAR_SET([$1], [--clangd-completer])],
[AS_VAR_SET([$1], ['--clangd-completer --force-sudo'])])],
[alpine], [AS_CASE([$VERSION_ID],
[3.13*], [AS_VAR_SET([$1], [--clangd-completer])],
[3.14*], [AS_VAR_SET([$1], [--clangd-completer])],
[AS_VAR_SET([$1], ['--clangd-completer --force-sudo'])])],
[centos], [AS_CASE([$VERSION_ID],
[7], [AS_VAR_SET([$1], [--clang-completer])],
[8], [AS_VAR_SET([$1], [--clangd-completer])],
[AS_VAR_SET([$1], ['--clangd-completer --force-sudo'])])],
[ubuntu], [AS_CASE([$VERSION_ID],
[18.04], [AS_VAR_SET([$1], [--clangd-completer])],
[AS_VAR_SET([$1], ['--clangd-completer --force-sudo'])])],
[AS_VAR_SET([$1], ['--clangd-completer --force-sudo'])])
AS_VAR_COPY([VERSION], [_ec_version])
AC_MSG_RESULT([$$1])])
]) # EC_VIM_YCM_ARGS
Expand Down Expand Up @@ -146,28 +155,30 @@ QH_OS_RELEASE
AS_CASE([$TERM],
[*256*], [AS_CASE([$_ec_user_id],
[0], [AS_VAR_SET([_ec_ps1_user_default], ['38;5;9'])],
[AS_VAR_SET([_ec_ps1_user_default], ['38;5;28'])])
[AS_VAR_SET([_ec_ps1_user_default], ['38;5;28'])])
AS_CASE([$ID],
[alpine], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;24'])],
[centos], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;214'])],
[debian], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;161'])],
[fedora], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;33'])],
[rhel], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;196'])],
[ubuntu], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;202'])],
[AS_VAR_SET([_ec_ps1_host_default], ['38;5;6'])])
[almalinux], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;214'])],
[alpine], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;24'])],
[centos], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;214'])],
[debian], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;161'])],
[fedora], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;33'])],
[rhel], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;196'])],
[ubuntu], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;202'])],
[AS_VAR_SET([_ec_ps1_host_default], ['38;5;6'])])
AS_VAR_SET([_ec_ps1_git_default], ['38;5;202'])
AS_VAR_SET([_ec_ps1_aws_default], ['38;5;214'])],
[AS_CASE([$_ec_user_id],
[0], [AS_VAR_SET([_ec_ps1_user_default], [31])],
[AS_VAR_SET([_ec_ps1_user_default], [32])])
[AS_VAR_SET([_ec_ps1_user_default], [32])])
AS_CASE([$ID],
[alpine], [AS_VAR_SET([_ec_ps1_host_default], [36])],
[centos], [AS_VAR_SET([_ec_ps1_host_default], [33])],
[debian], [AS_VAR_SET([_ec_ps1_host_default], [35])],
[fedora], [AS_VAR_SET([_ec_ps1_host_default], [34])],
[rhel], [AS_VAR_SET([_ec_ps1_host_default], [31])],
[ubuntu], [AS_VAR_SET([_ec_ps1_host_default], [35])],
[AS_VAR_SET([_ec_ps1_host_default], [32])])
[almalinux], [AS_VAR_SET([_ec_ps1_host_default], [33])],
[alpine], [AS_VAR_SET([_ec_ps1_host_default], [36])],
[centos], [AS_VAR_SET([_ec_ps1_host_default], [33])],
[debian], [AS_VAR_SET([_ec_ps1_host_default], [35])],
[fedora], [AS_VAR_SET([_ec_ps1_host_default], [34])],
[rhel], [AS_VAR_SET([_ec_ps1_host_default], [31])],
[ubuntu], [AS_VAR_SET([_ec_ps1_host_default], [35])],
[AS_VAR_SET([_ec_ps1_host_default], [32])])
AS_VAR_SET([_ec_ps1_git_default], [31])
AS_VAR_SET([_ec_ps1_aws_default], [33])])
AS_VAR_COPY([VERSION], [_ec_version])
Expand Down

0 comments on commit d6582ab

Please sign in to comment.