Add Alma Linux and Rocky Linux runners (#7424)
* Add RHEL image * Use Fedora config for RHEL * Use script to activate RHEL * Mirror mount args * Set RHEL username and password * Pass RHEL build args * Pass RHEL login by file * Use RHEL 9 for newer Python * Source RHEL login * Add case for RHEL Python deps * Add `--deactivate` * Do PIP user install * Upgrade PIP * Add RHEL config * Introduce 'command-pre' * Inherit fedora deps for RHEL and only strip sudo on non-empty command * Add RHEL 9 runner * Use RHEL 9 codeready * Add AlmaLinux EL9 * Add support for RHEL-like * Add EPEL for Alma * Enable power tools on Alma * Fix missing semicolon * Install EPEL before power tools * Inherit Alma deps from RHEL * Switch from `powertools` to `crb` * Abandon RHEL for now (no Qt 6 support) * Don't pass required when getting distro key * Correct key name for Rocky Linux * Add Repology badge * Restore original `build-push-action` * Exclude unsupported Repology entries * Update ChangeLog
This commit is contained in:
parent
ea36b902f4
commit
ef29c090af
9 changed files with 133 additions and 41 deletions
12
.github/workflows/build-containers.yml
vendored
12
.github/workflows/build-containers.yml
vendored
|
|
@ -68,6 +68,18 @@ jobs:
|
||||||
base-image: fedora:39
|
base-image: fedora:39
|
||||||
platform: amd64
|
platform: amd64
|
||||||
|
|
||||||
|
- name: rockylinux-9-amd64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
config-dir: fedora
|
||||||
|
base-image: rockylinux:9
|
||||||
|
platform: amd64
|
||||||
|
|
||||||
|
- name: almalinux-9-amd64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
config-dir: fedora
|
||||||
|
base-image: almalinux:9
|
||||||
|
platform: amd64
|
||||||
|
|
||||||
- name: opensuse-amd64
|
- name: opensuse-amd64
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
config-dir: opensuse
|
config-dir: opensuse
|
||||||
|
|
|
||||||
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
|
@ -248,6 +248,14 @@ jobs:
|
||||||
container: symless/synergy-core:opensuse-amd64
|
container: symless/synergy-core:opensuse-amd64
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
- name: rockylinux-9-amd64
|
||||||
|
container: symless/synergy-core:rockylinux-9-amd64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
- name: almalinux-9-amd64
|
||||||
|
container: symless/synergy-core:almalinux-9-amd64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
- name: archlinux-amd64
|
- name: archlinux-amd64
|
||||||
container: symless/synergy-core:archlinux-amd64
|
container: symless/synergy-core:archlinux-amd64
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ Enhancements:
|
||||||
- #7419 Introduce 'Advanced' tab to Preferences window
|
- #7419 Introduce 'Advanced' tab to Preferences window
|
||||||
- #7422 Handle empty value for computer name setting
|
- #7422 Handle empty value for computer name setting
|
||||||
- #7423 Refactor local/global save/load and show dev thanks message
|
- #7423 Refactor local/global save/load and show dev thanks message
|
||||||
|
- #7424 Add Alma Linux and Rocky Linux runners
|
||||||
|
|
||||||
# 1.14.6
|
# 1.14.6
|
||||||
|
|
||||||
|
|
|
||||||
12
README.md
12
README.md
|
|
@ -55,3 +55,15 @@ cmake --build build -j8
|
||||||
```
|
```
|
||||||
./build/bin/unittests
|
./build/bin/unittests
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Packages
|
||||||
|
|
||||||
|
To get Synergy, either your favorite package manager to install:
|
||||||
|
- `synergy` for Synergy 1 (this repo)
|
||||||
|
- `synergy3` for Synergy 3 (non-free)
|
||||||
|
|
||||||
|
Alternatively, use the [official packages](https://symless.com/synergy/download).
|
||||||
|
|
||||||
|
Synergy 2 is no longer in development and should not be provided.
|
||||||
|
|
||||||
|
[](https://repology.org/project/synergy/versions)
|
||||||
|
|
|
||||||
36
config.yaml
36
config.yaml
|
|
@ -23,7 +23,8 @@ config:
|
||||||
linux:
|
linux:
|
||||||
debian: &debian
|
debian: &debian
|
||||||
dependencies:
|
dependencies:
|
||||||
command: sudo apt-get update; \
|
command-pre: sudo apt-get update
|
||||||
|
command: |
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
cmake \
|
cmake \
|
||||||
make \
|
make \
|
||||||
|
|
@ -45,8 +46,9 @@ config:
|
||||||
<<: *debian
|
<<: *debian
|
||||||
|
|
||||||
fedora: &fedora
|
fedora: &fedora
|
||||||
dependencies:
|
dependencies: &fedora_deps
|
||||||
command: sudo dnf check-update; \
|
command-pre: sudo dnf check-update
|
||||||
|
command: |
|
||||||
sudo dnf install -y \
|
sudo dnf install -y \
|
||||||
cmake \
|
cmake \
|
||||||
make \
|
make \
|
||||||
|
|
@ -59,14 +61,34 @@ config:
|
||||||
libxkbfile-devel \
|
libxkbfile-devel \
|
||||||
qt6-qtbase-devel \
|
qt6-qtbase-devel \
|
||||||
qt6-qttools-devel \
|
qt6-qttools-devel \
|
||||||
qt6-qt5compat-devel \
|
|
||||||
gtk3-devel \
|
gtk3-devel \
|
||||||
rpm-build
|
rpm-build
|
||||||
|
|
||||||
|
# RHEL is not actually supported yet, since it doesn't have Qt6 libs.
|
||||||
|
# We simply use it as a base for Alma Linux and Rocky Linux.
|
||||||
|
rhel: &rhel
|
||||||
|
<<: *fedora
|
||||||
|
dependencies: &rhel_deps
|
||||||
|
<<: *fedora_deps
|
||||||
|
command-pre: |
|
||||||
|
sudo dnf check-update;
|
||||||
|
sudo dnf install -y epel-release;
|
||||||
|
dnf config-manager --set-enabled crb
|
||||||
|
|
||||||
|
rocky:
|
||||||
|
<<: *rhel
|
||||||
|
dependencies:
|
||||||
|
<<: *rhel_deps
|
||||||
|
|
||||||
|
almalinux:
|
||||||
|
<<: *rhel
|
||||||
|
dependencies:
|
||||||
|
<<: *rhel_deps
|
||||||
|
|
||||||
opensuse-tumbleweed: &opensuse-tumbleweed
|
opensuse-tumbleweed: &opensuse-tumbleweed
|
||||||
dependencies:
|
dependencies:
|
||||||
command: sudo zypper refresh; \
|
command-pre: sudo zypper refresh
|
||||||
sudo zypper install -y --force-resolution \
|
command: sudo zypper install -y --force-resolution \
|
||||||
cmake \
|
cmake \
|
||||||
make \
|
make \
|
||||||
gcc-c++ \
|
gcc-c++ \
|
||||||
|
|
@ -78,7 +100,6 @@ config:
|
||||||
libxkbfile-devel \
|
libxkbfile-devel \
|
||||||
qt6-base-devel \
|
qt6-base-devel \
|
||||||
qt6-tools-devel \
|
qt6-tools-devel \
|
||||||
qt6-qt5compat-devel \
|
|
||||||
gtk3-devel \
|
gtk3-devel \
|
||||||
rpm-build
|
rpm-build
|
||||||
|
|
||||||
|
|
@ -96,7 +117,6 @@ config:
|
||||||
libxkbfile \
|
libxkbfile \
|
||||||
qt6-base \
|
qt6-base \
|
||||||
qt6-tools \
|
qt6-tools \
|
||||||
qt6-5compat \
|
|
||||||
gtk3
|
gtk3
|
||||||
|
|
||||||
manjaro:
|
manjaro:
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ class Dependencies:
|
||||||
edit_config, skip_packages = self.config.get_windows_ci_config()
|
edit_config, skip_packages = self.config.get_windows_ci_config()
|
||||||
choco.remove_from_config(edit_config, skip_packages)
|
choco.remove_from_config(edit_config, skip_packages)
|
||||||
|
|
||||||
command = self.config.get_deps_command()
|
command = self.config.get_os_deps_command()
|
||||||
choco.install(command, self.ci_env)
|
choco.install(command, self.ci_env)
|
||||||
|
|
||||||
def mac(self):
|
def mac(self):
|
||||||
|
|
@ -112,7 +112,7 @@ class Dependencies:
|
||||||
env_vars_set += mac.set_env_var(cmake_prefix_env_var, qt_dir)
|
env_vars_set += mac.set_env_var(cmake_prefix_env_var, qt_dir)
|
||||||
env_vars_set += mac.set_env_var(path_env_var, qt_bin_dir)
|
env_vars_set += mac.set_env_var(path_env_var, qt_bin_dir)
|
||||||
|
|
||||||
command = self.config.get_os_deps_value("command")
|
command = self.config.get_os_deps_command()
|
||||||
cmd_utils.run(command, shell=True, print_cmd=True)
|
cmd_utils.run(command, shell=True, print_cmd=True)
|
||||||
|
|
||||||
if env_vars_set:
|
if env_vars_set:
|
||||||
|
|
@ -120,25 +120,29 @@ class Dependencies:
|
||||||
|
|
||||||
def linux(self):
|
def linux(self):
|
||||||
"""Installs dependencies on Linux."""
|
"""Installs dependencies on Linux."""
|
||||||
|
import lib.linux as linux
|
||||||
|
|
||||||
distro, _distro_like, _distro_version = env.get_linux_distro()
|
distro, distro_like, _distro_version = env.get_linux_distro()
|
||||||
if not distro:
|
if not distro:
|
||||||
raise RuntimeError("Unable to detect Linux distro")
|
raise RuntimeError("Unable to detect Linux distro")
|
||||||
|
|
||||||
command = self.config.get_linux_deps_command(distro)
|
command_pre = self.config.get_os_deps_command_pre(
|
||||||
|
linux_distro=distro, required=False
|
||||||
|
)
|
||||||
|
if command_pre:
|
||||||
|
print("Running dependencies prerequisites command")
|
||||||
|
|
||||||
has_sudo = cmd_utils.has_command("sudo")
|
check = True
|
||||||
if "sudo" in command and not has_sudo:
|
if distro_like and "fedora" in distro_like:
|
||||||
# assume we're running as root if sudo is not found (common on older distros).
|
print("Fedora-like detected, ignoring return code")
|
||||||
# a space char is intentionally added after "sudo" for intentionality.
|
# On Fedora, dnf update returns code 100 when updates are available.
|
||||||
# possible limitation with stripping "sudo" is that if any packages with "sudo" in the
|
check = False
|
||||||
# name are added to the list (probably very unlikely), this will have undefined behavior.
|
|
||||||
print("The 'sudo' command was not found, stripping sudo from command")
|
|
||||||
command = command.replace("sudo ", "").strip()
|
|
||||||
|
|
||||||
# On Fedora, dnf update returns code 100 when updates are available, but the last command
|
linux.run_command(command_pre, check)
|
||||||
# run should be dnf install, so the return code should always be 0.
|
|
||||||
cmd_utils.run(command, shell=True, print_cmd=True)
|
command = self.config.get_os_deps_command(linux_distro=distro)
|
||||||
|
print("Running dependencies command")
|
||||||
|
linux.run_command(command, check=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ import lib.cmd_utils as cmd_utils
|
||||||
config_file = "config.yaml"
|
config_file = "config.yaml"
|
||||||
root_key = "config"
|
root_key = "config"
|
||||||
deps_key = "dependencies"
|
deps_key = "dependencies"
|
||||||
|
command_key = "command"
|
||||||
|
command_pre_key = "command-pre"
|
||||||
|
arrow = " ➤ "
|
||||||
|
|
||||||
|
|
||||||
class ConfigKeyError(RuntimeError):
|
class ConfigKeyError(RuntimeError):
|
||||||
|
|
@ -20,7 +23,7 @@ def _get(dict, key, key_parent=None, required=True):
|
||||||
value = dict.get(key)
|
value = dict.get(key)
|
||||||
|
|
||||||
if required and not value:
|
if required and not value:
|
||||||
key_path = f"{root_key}:{key_parent}:{key}" if key_parent else key
|
key_path = f"{root_key}{arrow}{key_parent}{arrow}{key}" if key_parent else key
|
||||||
raise ConfigKeyError(config_file, key_path)
|
raise ConfigKeyError(config_file, key_path)
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
@ -40,14 +43,19 @@ class Config:
|
||||||
root = _get(data, root_key)
|
root = _get(data, root_key)
|
||||||
self.os = _get(root, self.os_name)
|
self.os = _get(root, self.os_name)
|
||||||
|
|
||||||
def get_os_value(self, key):
|
def get_os_value(self, key, required=True, linux_distro=None):
|
||||||
return _get(self.os, key, self.os_name)
|
if linux_distro:
|
||||||
|
# recurse with the linux distro as the key parameter to get the base distro key.
|
||||||
|
distro = self.get_os_value(key=linux_distro)
|
||||||
|
return _get(distro, key, f"{self.os_name}{arrow}{linux_distro}", required)
|
||||||
|
else:
|
||||||
|
return _get(self.os, key, self.os_name, required)
|
||||||
|
|
||||||
def get_qt_config(self):
|
def get_qt_config(self):
|
||||||
qt_key = "qt"
|
qt_key = "qt"
|
||||||
qt = self.get_os_deps_value(qt_key)
|
qt = self.get_os_deps_value(qt_key)
|
||||||
|
|
||||||
parent_key = f"{self.os_name}:{deps_key}"
|
parent_key = f"{self.os_name}{arrow}{deps_key}"
|
||||||
mirror_url = _get(qt, "mirror", parent_key)
|
mirror_url = _get(qt, "mirror", parent_key)
|
||||||
version = _get(qt, "version", parent_key)
|
version = _get(qt, "version", parent_key)
|
||||||
base_dir = _get(qt, "base-dir", parent_key)
|
base_dir = _get(qt, "base-dir", parent_key)
|
||||||
|
|
@ -55,26 +63,29 @@ class Config:
|
||||||
|
|
||||||
return mirror_url, version, base_dir, modules
|
return mirror_url, version, base_dir, modules
|
||||||
|
|
||||||
def get_os_deps_value(self, key):
|
def get_os_deps_value(self, key, required=True, linux_distro=None):
|
||||||
deps = self.get_os_value(deps_key)
|
deps = self.get_os_value(deps_key, required, linux_distro)
|
||||||
return _get(deps, key, f"{self.os_name}:{deps_key}")
|
if linux_distro:
|
||||||
|
key_parent = f"{self.os_name}{arrow}{linux_distro}{arrow}{deps_key}"
|
||||||
|
else:
|
||||||
|
key_parent = f"{self.os_name}{arrow}{deps_key}"
|
||||||
|
return _get(deps, key, key_parent, required)
|
||||||
|
|
||||||
def get_deps_command(self):
|
def get_os_deps_command(self, key=command_key, required=True, linux_distro=None):
|
||||||
deps = self.get_os_value(deps_key)
|
command = self.get_os_deps_value(key, required, linux_distro)
|
||||||
command = _get(deps, "command", f"{self.os_name}:{deps_key}")
|
if command:
|
||||||
return cmd_utils.strip_continuation_sequences(command)
|
return cmd_utils.strip_continuation_sequences(command)
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
def get_linux_deps_command(self, distro):
|
def get_os_deps_command_pre(self, required=True, linux_distro=None):
|
||||||
distro_data = self.get_os_value(distro)
|
return self.get_os_deps_command(command_pre_key, required, linux_distro)
|
||||||
deps = _get(distro_data, deps_key, f"{self.os_name}:{distro}")
|
|
||||||
command = _get(deps, "command", f"{self.os_name}:{distro}:{deps_key}")
|
|
||||||
return cmd_utils.strip_continuation_sequences(command)
|
|
||||||
|
|
||||||
def get_windows_ci_config(self):
|
def get_windows_ci_config(self):
|
||||||
choco_ci_key = "ci"
|
choco_ci_key = "ci"
|
||||||
choco_ci = self.get_os_deps_value(choco_ci_key)
|
choco_ci = self.get_os_deps_value(choco_ci_key)
|
||||||
|
|
||||||
choco_ci_path = f"{self.os_name}:{deps_key}:{choco_ci_key}"
|
choco_ci_path = f"{self.os_name}{arrow}{deps_key}{arrow}{choco_ci_key}"
|
||||||
edit_config = _get(choco_ci, "edit-config", choco_ci_path)
|
edit_config = _get(choco_ci, "edit-config", choco_ci_path)
|
||||||
skip_packages = _get(choco_ci, "skip-packages", choco_ci_path)
|
skip_packages = _get(choco_ci, "skip-packages", choco_ci_path)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,13 @@ def install_requirements():
|
||||||
|
|
||||||
check_dependencies(raise_error=True)
|
check_dependencies(raise_error=True)
|
||||||
|
|
||||||
|
print("Updating pip...")
|
||||||
|
cmd_utils.run(
|
||||||
|
[sys.executable, "-m", "pip", "install", "--upgrade", "pip"],
|
||||||
|
shell=False,
|
||||||
|
print_cmd=True,
|
||||||
|
)
|
||||||
|
|
||||||
print("Installing required modules...")
|
print("Installing required modules...")
|
||||||
cmd_utils.run(
|
cmd_utils.run(
|
||||||
[sys.executable, "-m", "pip", "install", "-e", "scripts"],
|
[sys.executable, "-m", "pip", "install", "-e", "scripts"],
|
||||||
|
|
@ -182,7 +189,10 @@ def ensure_dependencies():
|
||||||
|
|
||||||
update_cmd = None
|
update_cmd = None
|
||||||
install_cmd = None
|
install_cmd = None
|
||||||
if "debian" in distro_like:
|
if distro == "rhel" or "rhel" in distro_like:
|
||||||
|
update_cmd = "yum check-update"
|
||||||
|
install_cmd = "yum install -y python3-pip" # rhel-like has venv already
|
||||||
|
elif "debian" in distro_like:
|
||||||
update_cmd = "apt update"
|
update_cmd = "apt update"
|
||||||
install_cmd = "apt install -y python3-pip python3-venv"
|
install_cmd = "apt install -y python3-pip python3-venv"
|
||||||
elif "fedora" in distro_like:
|
elif "fedora" in distro_like:
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,20 @@ package_name = "synergy"
|
||||||
test_cmd = "synergys --version"
|
test_cmd = "synergys --version"
|
||||||
|
|
||||||
|
|
||||||
|
def run_command(command, check=True):
|
||||||
|
|
||||||
|
has_sudo = cmd_utils.has_command("sudo")
|
||||||
|
if "sudo" in command and not has_sudo:
|
||||||
|
# assume we're running as root if sudo is not found (common on older distros).
|
||||||
|
# a space char is intentionally added after "sudo" for intentionality.
|
||||||
|
# possible limitation with stripping "sudo" is that if any packages with "sudo" in the
|
||||||
|
# name are added to the list (probably very unlikely), this will have undefined behavior.
|
||||||
|
print("The 'sudo' command was not found, stripping sudo from command")
|
||||||
|
command = command.replace("sudo ", "").strip()
|
||||||
|
|
||||||
|
cmd_utils.run(command, check, shell=True, print_cmd=True)
|
||||||
|
|
||||||
|
|
||||||
def package(filename_base, package_type: PackageType):
|
def package(filename_base, package_type: PackageType):
|
||||||
|
|
||||||
extension, cmd = get_package_info(package_type)
|
extension, cmd = get_package_info(package_type)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue