Squash merge move_to_single_file_pkgs into main
This commit is contained in:
@@ -1,24 +1,162 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
#
|
||||
## Package: alacritty
|
||||
## Description: GPU accelerated terminal emulator written in rust
|
||||
## Version: 0.16.1
|
||||
## Methods: [source, system]
|
||||
## Helpers: cargo_build
|
||||
---
|
||||
- name: Append alacritty
|
||||
- name: Set alacritty default facts # {{{
|
||||
ansible.builtin.set_fact:
|
||||
alacritty:
|
||||
methods:
|
||||
- source
|
||||
- system
|
||||
build_flags: "{{ alacritty_build_flags | default( ['--release'] ) }}"
|
||||
version: "{{ alacritty_version | default('0.16.1') }}"
|
||||
pkgname:
|
||||
RedHat: alacritty
|
||||
Debian: alacritty
|
||||
Alpine: alacritty
|
||||
git:
|
||||
repo: https://github.com/alacritty/alacritty
|
||||
version: "{{ alacritty_version | default('v0.16.1') }}"
|
||||
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
|
||||
bds:
|
||||
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: Load alacritty configuration
|
||||
ansible.builtin.include_tasks:
|
||||
file: config/alacritty.yml
|
||||
|
||||
- name: Append alacritty to pkg_cargo
|
||||
- name: Set alacritty install method
|
||||
when:
|
||||
- alacritty.method == 'cargo'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + alacritty.build_deps }}"
|
||||
pkg_cargo: "{{ pkg_cargo + [alacritty.cargo] }}"
|
||||
- alacritty_imethod 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_imethod: source
|
||||
|
||||
- name: Append alacritty to pkg_cask
|
||||
- name: Fallback configuration for alacritty
|
||||
when:
|
||||
- alacritty_imethod is undefined
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_imethod: "{{ imethod if imethod in alacritty.methods else alacritty.methods[0] }}"
|
||||
|
||||
- name: Configure alacritty source install # {{{
|
||||
when:
|
||||
- alacritty.method == 'cask'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_cask: "{{ pkg_cask + ['alacritty'] }}"
|
||||
- alacritty_imethod == "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"
|
||||
git: "{{ alacritty.git }}"
|
||||
version: "{{ alacritty.version }}"
|
||||
files: "{{ alacritty.install_files }}"
|
||||
name: alacritty
|
||||
alacritty_bds: "{{ alacritty.bds[os_family] }}"
|
||||
|
||||
- name: Set alacritty_configured
|
||||
- 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_bds: "{{ alacritty_bds + ['xcb-util-devel', '@Development Tools'] }}"
|
||||
|
||||
- name: Add extra dependencies for EL8
|
||||
when:
|
||||
- ansible_distribution_major_version == 8
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_bds: "{{ alacritty_bds + ['@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_bds }}"
|
||||
pkg_cargo_build: "{{ pkg_cargo_build + [alacritty_src_install] }}"
|
||||
|
||||
- name: Finalise alacritty source install
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_install: "{{ alacritty_imethod }}={{ alacritty_src_install }}+{{ alacritty_bds }}"
|
||||
|
||||
- name: Configure alacritty system install
|
||||
when:
|
||||
- alacritty_imethod == 'system'
|
||||
block:
|
||||
- name: Queue alacritty for installation
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + [ alacritty.pkgname[os_family] ] }}"
|
||||
|
||||
- name: Finalise alacritty system install
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_install: "{{ alacritty_imethod }}={{ alacritty.pkgname[os_family] ]}}"
|
||||
|
||||
- name: Complete alacritty configuration
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_configured: true
|
||||
__configured: "{{ __configured | combine( { 'alacritty': alacritty_install } ) }}"
|
||||
|
||||
Reference in New Issue
Block a user