Skip to content

Commit

Permalink
Additional Distro Support (#135)
Browse files Browse the repository at this point in the history
* Closes #131
* Closes #132
* Closes #134
* Closes #133 

Signed-off-by: Mike Detwiler <mike@detwiler.io>
  • Loading branch information
detwiler authored Dec 18, 2022
1 parent 0b053eb commit aa72ff0
Show file tree
Hide file tree
Showing 29 changed files with 292 additions and 130 deletions.
54 changes: 32 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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 .
Expand All @@ -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
Expand All @@ -113,7 +135,7 @@ jobs:

steps:
- name: Download Distribution Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: distribution-artifacts

Expand All @@ -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
2 changes: 1 addition & 1 deletion .gnulib
Submodule .gnulib updated 1099 files
19 changes: 17 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand All @@ -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) \
Expand All @@ -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 $@
Expand Down Expand Up @@ -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)/$@ $@
Expand All @@ -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) && \
Expand All @@ -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) || \
Expand Down
4 changes: 2 additions & 2 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions bootstrap-funclib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand Down
38 changes: 33 additions & 5 deletions build-aux/install-buildreqs
Original file line number Diff line number Diff line change
Expand Up @@ -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
42 changes: 36 additions & 6 deletions build-aux/install-reqs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ vim

pkgs_centos='
awscli
clang-tools-extra
clang
ctags
gcc-c++
platform-python-devel
python3-pip
vim-enhanced
'
Expand Down Expand Up @@ -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
Loading

0 comments on commit aa72ff0

Please sign in to comment.