Squash merge move_to_single_file_pkgs into main
This commit is contained in:
@@ -1,51 +1,157 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
#
|
||||
## Package: ghostty
|
||||
## Description: HW accelerated terminal emulator made with zig
|
||||
## Version: 1.3.1
|
||||
## Methods: [system, source, appimage]
|
||||
## Helpers: [zig, repo, appimage]
|
||||
---
|
||||
- name: Add ghostty
|
||||
- name: Set ghostty default facts # {{{
|
||||
ansible.builtin.set_fact:
|
||||
ghostty:
|
||||
version: 1.3.1
|
||||
base_url: https://releases.files.ghostty.org
|
||||
# install methods per distribution
|
||||
default:
|
||||
methods:
|
||||
- source
|
||||
pkg_deps: &pkgdeps
|
||||
- zig
|
||||
build_deps:
|
||||
- gtk4
|
||||
- libadwaita
|
||||
- gtk4-layer-shell
|
||||
- pkgconf
|
||||
- gettext
|
||||
Redhat: &redhat
|
||||
methods:
|
||||
- source
|
||||
- appimage
|
||||
pkg_deps: *pkgdeps
|
||||
build_deps:
|
||||
- gtk4-devel
|
||||
- gtk4-layer-shell-devel
|
||||
- libadwaita-devel
|
||||
- gettext
|
||||
AlmaLinux: *redhat
|
||||
CentOS: *redhat
|
||||
Rocky: *redhat
|
||||
Debian: &debian
|
||||
methods:
|
||||
- source
|
||||
- appimage
|
||||
pkg_deps: *pkgdeps
|
||||
build_deps:
|
||||
- libgtk-4-dev
|
||||
- libgtk4-layer-shell-dev
|
||||
- libadwaita-1-dev
|
||||
- gettext
|
||||
- libxml2-utils
|
||||
Ubuntu: *debian
|
||||
Raspbian: *debian
|
||||
Linux Mint: *debian
|
||||
Archlinux: &arch
|
||||
methods:
|
||||
- system
|
||||
- source
|
||||
- appimage
|
||||
pkg_deps: *pkgdeps
|
||||
build_deps:
|
||||
- gtk4
|
||||
- gtk4-layer-shell
|
||||
- libadwaita
|
||||
- gettext
|
||||
pkgname: ghostty
|
||||
Majaro: *arch
|
||||
Fedora:
|
||||
methods:
|
||||
- source
|
||||
- appimage
|
||||
pkg_deps: *pkgdeps
|
||||
build_deps:
|
||||
- gtk4-devel
|
||||
- gtk4-layer-shell-devel
|
||||
- libadwaita-devel
|
||||
- gettext
|
||||
Alpine:
|
||||
methods:
|
||||
- system
|
||||
- source
|
||||
- appimage
|
||||
pkg_deps: *pkgdeps
|
||||
build_deps:
|
||||
- gtk4.0-dev
|
||||
- libadwaita-dev
|
||||
- pkgconf
|
||||
- ncurses
|
||||
- gettext
|
||||
pkgname: ghostty
|
||||
# }}}
|
||||
- name: Set ghostty facts
|
||||
ansible.builtin.set_fact:
|
||||
ghostty:
|
||||
version: "{{ ghostty_version | default(ghostty.version) }}"
|
||||
methods: "{{ ghostty[distribution].methods | default(_methods['default']) }}"
|
||||
source_url: "{{ ghostty.base_url }}/{{ ghostty.version }}/ghostty-{{ ghostty.version }}.tar.gz"
|
||||
archive: "ghostty-{{ ghostty.version }}.tar.gz"
|
||||
pkg_deps: "{{ ghostty[distribution].pkg_deps | default(omit) }}"
|
||||
build_deps: "{{ ghostty[distribution].build_deps | default(ghostty.default.build_deps) }}"
|
||||
|
||||
- name: Configure ghostty
|
||||
block:
|
||||
- name: Load ghostty config
|
||||
ansible.builtin.include_tasks:
|
||||
file: config/ghostty.yml
|
||||
|
||||
- name: Append ghostty to pkg_src
|
||||
- name: Set ghostty install method
|
||||
when:
|
||||
- ghostty.method == 'src'
|
||||
- ghostty_imethod is undefined
|
||||
ansible.builtin.set_fact:
|
||||
pkg_src: "{{ pkg_src + ghostty.pkg }}"
|
||||
pkg_sys: "{{ pkg_sys + ghostty.build_deps }}"
|
||||
ghostty_imethod: "{{ imethod if imethod in ghostty.methods else ghostty.methods[0] }}"
|
||||
|
||||
- name: Append ghostty to pkg_appimage
|
||||
- name: Configure ghostty source install
|
||||
when:
|
||||
- ghostty.method == 'appimage'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_appimage: "{{ pkg_appimage + ghostty }}"
|
||||
|
||||
- name: Install ghostty via package manager
|
||||
when:
|
||||
- ghostty.method == 'sys'
|
||||
- ghostty_imethod == 'source'
|
||||
block:
|
||||
- name: Enable repo for ghostty
|
||||
- name: Add ghostty package dependencies
|
||||
when:
|
||||
- ansible_distribution == 'Fedora'
|
||||
changed_when: true
|
||||
ansible.builtin.get_url:
|
||||
mode: '0644'
|
||||
decompress: false
|
||||
backup: false
|
||||
url: "{{ ghostty.pkg_repo.url }}"
|
||||
dest: "{{ ghostty.pkg_repo.dest }}"
|
||||
- ghostty.pkg_deps is defined
|
||||
- ghostty.pkg_deps|length > 0
|
||||
loop: "{{ ghostty.pkg_deps }}"
|
||||
loop_control:
|
||||
loop_var: dep
|
||||
ansible.builtin.include_tasks: pkgs/{{ dep }}.yml
|
||||
|
||||
- name: Append ghostty to pkg_sys
|
||||
- name: Add ghostty system dependencies
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + ghostty.build_deps }}"
|
||||
|
||||
- name: Configure ghostty zig install
|
||||
ansible.builtin.set_fact:
|
||||
ghostty_source_install:
|
||||
name: ghostty
|
||||
source_path: "{{ path_archive }}/ghostty/ghostty-{{ ghostty.version }}"
|
||||
archive:
|
||||
extract_to: "{{ path_archive }}/ghostty"
|
||||
name: "{{ ghostty.archive }}"
|
||||
url: "{{ ghostty.source_url }}"
|
||||
build_flags:
|
||||
- "-Doptimize=ReleaseFast"
|
||||
|
||||
- name: Configure ghostty appimage install
|
||||
when:
|
||||
- ghostty_imethod == 'appimage'
|
||||
block:
|
||||
- name: Append ghostty to pkg_appimage
|
||||
when:
|
||||
- ansible_distriubtion
|
||||
- ghostty.method == 'appimage'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_appimage: "{{ pkg_appimage + ghostty }}"
|
||||
|
||||
- name: Configure ghostty system install
|
||||
when:
|
||||
- ghostty_imethod == 'system'
|
||||
block:
|
||||
- name: Queue ghostty to pkg_sys
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + ghostty.pkg }}"
|
||||
|
||||
- name: Append ghostty to pkg_cask
|
||||
when:
|
||||
- ghostty.method == 'cask'
|
||||
- name: Finalise ghostty configuration
|
||||
ansible.builtin.set_fact:
|
||||
pkg_cask: "{{ pkg_cask + ghostty.pkg }}"
|
||||
|
||||
- name: Set ghostty_configured
|
||||
ansible.builtin.set_fact:
|
||||
ghostty_configured: true
|
||||
__configured: "{{ __configured | combine( { 'ghostty': ghostty_install } ) }}"
|
||||
|
||||
Reference in New Issue
Block a user