151 lines
4.9 KiB
YAML
151 lines
4.9 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
#
|
|
## Package: alacritty
|
|
## Description: GPU accelerated terminal emulator written in rust
|
|
## Version: v0.16.1
|
|
## Methods: [source, system]
|
|
## Helpers: cargo_build
|
|
---
|
|
- name: Set alacritty default facts # {{{
|
|
ansible.builtin.set_fact:
|
|
alacritty_version: "{{ alacritty_version | default('v0.16.1') }}"
|
|
alacritty_build_flags: "{{ alacritty_build_flags | default( ['--release'] ) }}"
|
|
alacritty:
|
|
pkgname:
|
|
RedHat: alacritty
|
|
Debian: alacritty
|
|
Alpine: alacritty
|
|
install_methods:
|
|
- source
|
|
- system
|
|
git_repo: https://github.com/alacritty/alacritty
|
|
install_files:
|
|
- from: target/release/alacritty
|
|
to: bin/alacritty
|
|
mode: '0755'
|
|
- from: extra/logo/alacritty-term.svg
|
|
to: share/pixmaps/Alacritty.svg
|
|
mode: '0644'
|
|
- from: extra/linux/Alacritty.desktop
|
|
to: share/applications/Alacritty.desktop
|
|
mode: '0644'
|
|
pkg_deps:
|
|
- git
|
|
- cargo
|
|
- cmake
|
|
build_deps:
|
|
RedHat:
|
|
- fontconfig-devel
|
|
- freetype-devel
|
|
- g++
|
|
- libxcb-devel
|
|
- libxkbcommon-devel
|
|
- desktop-file-utils
|
|
Debian:
|
|
- g++
|
|
- pkg-config
|
|
- libfontconfig1-dev
|
|
- libxcb-xfixes0-dev
|
|
- libxkbcommon-dev
|
|
- python3
|
|
- libfreetype6-dev
|
|
- desktop-file-utils
|
|
Alpine:
|
|
- pkgconf
|
|
- freetype-dev
|
|
- fontconfig-dev
|
|
- python3
|
|
- libxcb-dev
|
|
- g++
|
|
- libxkbcommon-dev
|
|
- desktop-file-utils
|
|
Archlinux:
|
|
- freetype2
|
|
- fontconfig
|
|
- pkg-config
|
|
- make
|
|
- libxcb
|
|
- libxkbcommon
|
|
- python
|
|
- desktop-file-utils
|
|
FreeBSD:
|
|
- freetype2
|
|
- fontconfig
|
|
- pkgconf
|
|
- python3
|
|
- desktop-file-utils
|
|
# }}}
|
|
- name: Start alacritty configuration
|
|
when:
|
|
- "'alacritty' not in __configured"
|
|
block:
|
|
- name: Set alacritty install method
|
|
when:
|
|
- alacritty_install_method is undefined
|
|
block:
|
|
- name: Configure for RedHat enterprise linux 10
|
|
when:
|
|
- os_family == 'RedHat'
|
|
- ansible_distribution_major_version|int <= 10
|
|
ansible.builtin.set_fact:
|
|
alacritty_install_method: source
|
|
|
|
- name: Fallback configuration for alacritty
|
|
when:
|
|
- alacritty_install_method is undefined
|
|
ansible.builtin.set_fact:
|
|
alacritty_install_method: "{{ install_method if install_method in alacritty.install_methods else alacritty.install_methods[0] }}"
|
|
- name: Configure alacritty source install # {{{
|
|
when:
|
|
- alacritty_install_method == "source"
|
|
block:
|
|
- name: Set alacritty build facts
|
|
ansible.builtin.set_fact:
|
|
alacritty_src_install:
|
|
build_flags: "{{ alacritty_build_flags }}"
|
|
source_dir: "{{ d_cache.path }}/alacritty"
|
|
repo: "{{ alacritty.git_repo }}"
|
|
version: "{{ alacritty_version }}"
|
|
files: "{{ alacritty.install_files }}"
|
|
alacritty_build_deps: "{{ alacritty.build_deps[os_family] }}"
|
|
|
|
- name: Set alacritty install extra build deps
|
|
when:
|
|
- ansible_os_family == "RedHat"
|
|
- ansible_distribution_major_version|int <= 8
|
|
block:
|
|
- name: Add extra dependencies for EL7
|
|
when:
|
|
- ansible_distribution_major_version == 7
|
|
ansible.builtin.set_fact:
|
|
alacritty_build_deps: "{{ alacritty_build_deps + ['xcb-util-devel', '@Development Tools'] }}"
|
|
|
|
- name: Add extra dependencies for EL8
|
|
when:
|
|
- ansible_distribution_major_version == 8
|
|
ansible.builtin.set_fact:
|
|
alacritty_build_deps: "{{ alacritty_build_deps + ['@Development Tools'] }}"
|
|
|
|
- name: Configure pkg dependencies
|
|
loop: "{{ alacritty.pkg_deps }}"
|
|
loop_control:
|
|
loop_var: dep
|
|
ansible.builtin.include_tasks: "pkgs/{{ dep }}.yml"
|
|
|
|
- name: Append build dependencies and cargo config
|
|
ansible.builtin.set_fact:
|
|
pkg_sys: "{{ pkg_sys + alacritty_build_deps }}"
|
|
pkg_cargo_build: "{{ pkg_cargo_build + [alacritty_src_install] }}"
|
|
|
|
- name: Configure alacritty system install
|
|
when:
|
|
- alacritty_install_method == 'system'
|
|
block:
|
|
- name: Queue alacritty for installation
|
|
ansible.builtin.set_fact:
|
|
pkg_sys: "{{ pkg_sys + [ alacritty.pkgname[os_family] ] }}"
|
|
|
|
- name: Complete alacritty configuration
|
|
ansible.builtin.set_fact:
|
|
__configured: "{{ __configured | combine( { 'alacritty': alacritty_install_method } ) }}"
|