working on alacritty source install
- adding cargo build helper
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Install neovim appimage
|
||||
become: true
|
||||
block:
|
||||
- name: Create install dir
|
||||
ansible.builin.file:
|
||||
state: directory
|
||||
mode: "0755"
|
||||
path: "{{ nvim.instdir }}"
|
||||
owner: "{{ pkgconfig_neovim.owner }}"
|
||||
group: "{{ pkgconfig_neovim.group }}"
|
||||
|
||||
- name: Get neovim appimage
|
||||
ansible.builtin.get_url:
|
||||
mode: "0755"
|
||||
decompress: false
|
||||
backup: true
|
||||
url: "{{ pkgconfig_neovim.appimage_url_pfx }}/{{ pkgconfig_neovim.version }}/nvim.appimage"
|
||||
checksum: "sha256:{{ pkgconfig_neovim.appimage_url_pfx }}/{{ pkgconfig_neovim.version }}/nvim.appimage.sha256sum"
|
||||
dest: "{{ pkgconfig_neovim.install_dir }}/nvim.appimage.{{ pkgconfig_neovim.version }}"
|
||||
owner: "{{ pkgconfig_neovim.owner }}"
|
||||
group: "{{ pkgconfig_neovim.group }}"
|
||||
|
||||
- name: Link neovim appimage
|
||||
ansible.builtin.file:
|
||||
state: link
|
||||
src: "{{ pkgconfig_neovim.install_dir }}/nvim.appimage.{{ pkgconfig_neovim.version }}"
|
||||
path: "{{ pkgconfig_neovim.install_prefix }}/bin/nvim"
|
||||
39
tasks/helpers/cargo_build.yml
Normal file
39
tasks/helpers/cargo_build.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Cargo source install helper
|
||||
when:
|
||||
- cargo_install_type == 'source'
|
||||
block:
|
||||
- name: Set build variables
|
||||
ansible.builtin.set_fact:
|
||||
git_path: "{{ d_tempdir.path }}/{{ name }}"
|
||||
git_repo: "{{ repo }}"
|
||||
git_depth: "{{ depth | default(1) }}"
|
||||
git_recursive: "{{ recursive | default(true) }}"
|
||||
git_version: "{{ version | default(omit) }}"
|
||||
|
||||
- name: Fetch git repo
|
||||
ansible.builtin.include_tasks:
|
||||
file: helpers/git.yml
|
||||
|
||||
- name: Build cargo release
|
||||
ansible.builtin.command:
|
||||
creates: "{{ bin_output }}"
|
||||
chdir: "{{ git_path }}"
|
||||
argv: "{{ [cargo, build] + cargo_build_flags }}"
|
||||
|
||||
- name: Install cargo release
|
||||
block:
|
||||
- name: Install binary
|
||||
when:
|
||||
- bin_name is defined
|
||||
- bin_output is defined
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
backup: false
|
||||
dest: "{{ install_prefix }}/bin/{{ bin_name }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
remote_src: true
|
||||
src: "{{ git_path }}/{{ bin_output }}"
|
||||
@@ -1,7 +1,10 @@
|
||||
- name: Clone git repository {{ src_pkg }}
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Clone git repository
|
||||
ansible.builtin.git:
|
||||
depth: 1
|
||||
force: true
|
||||
dest: "{{ src_path }}"
|
||||
repo: "{{ src_gitrepo }}"
|
||||
version: "{{ src_version | default(omit) }}"
|
||||
depth: "{{ git_depth | default(1) }}"
|
||||
dest: "{{ git_path }}"
|
||||
force: "{{ git_force | default(true) }}"
|
||||
recursive: "{{ git_recursive | default(true) }}"
|
||||
repo: "{{ git_repo }}"
|
||||
version: "{{ git_version | default(omit) }}"
|
||||
|
||||
@@ -1,23 +1,114 @@
|
||||
# vim: set filetype=yaml.ansible :
|
||||
---
|
||||
- name: Append alacritty
|
||||
- name: Configure alacritty # {{{
|
||||
block:
|
||||
- name: Load alacritty configuration
|
||||
ansible.builtin.include_tasks:
|
||||
file: config/alacritty.yml
|
||||
- name: Set basic variables
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_version: v0.16.1
|
||||
alacritty_git_repo: https://github.com/alacritty/alacritty
|
||||
alacritty_pkgname: alacritty
|
||||
- name: Set install type
|
||||
when:
|
||||
- alacritty_method is undefined or
|
||||
alacritty_method == ''
|
||||
block:
|
||||
- name: Install via system package manager
|
||||
when:
|
||||
- default_install_method == 'package'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_method: package
|
||||
|
||||
- name: Install via homebrew casks
|
||||
when:
|
||||
- ansible_os_family == 'Darwin' or
|
||||
default_install_method == 'homebrew'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_method: cask
|
||||
|
||||
- name: Install via source
|
||||
when:
|
||||
- default_install_method == 'source'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_method: source
|
||||
alacritty_src_install:
|
||||
cargo_install_type: source
|
||||
cargo_build_flags:
|
||||
- --release
|
||||
name: "{{ alacritty_pkgname }}"
|
||||
repo: "{{ alacritty_git_repo }}"
|
||||
version: "{{ alacritty_build_version }}"
|
||||
bin_output: "target/release/alacritty"
|
||||
bin_name: "alacritty"
|
||||
install_prefix: "/usr/local"
|
||||
install_files:
|
||||
share/pixmaps:
|
||||
- extra/logo/alacritty-term.svg
|
||||
desktop:
|
||||
- extra/linux/Alacritty.desktop
|
||||
|
||||
- name: Set alacritty install options
|
||||
block:
|
||||
- name: Set options for RedHat based Linux
|
||||
when: ansible_os_family == 'RedHat'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- fontconfig-devel
|
||||
- freetype-devel
|
||||
- g++
|
||||
- libxcb-devel
|
||||
- libxkbcommon-devel
|
||||
- desktop-file-utils
|
||||
- name: Set options for Debian based Linux
|
||||
when: ansible_os_family == 'Debian'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- libfontconfig1-dev
|
||||
- libfreetype6-dev
|
||||
- libxcb-xfixes0-dev
|
||||
- libxkbcommon-dev
|
||||
- pkg-config
|
||||
- python3
|
||||
- desktop-file-utils
|
||||
- name: Set options for Alpine based Linux
|
||||
when: ansible_os_family == 'Alpine'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- fontconfig-dev
|
||||
- freetype-dev
|
||||
- g++
|
||||
- libxcb-dev
|
||||
- libxkbcommon-dev
|
||||
- pkgconf
|
||||
- desktop-file-utils
|
||||
- name: Set options for FreeBSD
|
||||
when: ansible_os_family == 'FreeBSD'
|
||||
ansible.builtin.set_fact:
|
||||
alacritty_build_deps:
|
||||
- cmake
|
||||
- freetype2
|
||||
- fontconfig
|
||||
- pkgconf
|
||||
- python3
|
||||
- desktop-file-utils
|
||||
# }}}
|
||||
|
||||
- name: Append alacritty installation
|
||||
block:
|
||||
- name: Append alacritty to pkg_cargo
|
||||
when:
|
||||
- alacritty.method == 'cargo'
|
||||
- method == 'source'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_sys: "{{ pkg_sys + alacritty.build_deps }}"
|
||||
pkg_cargo: "{{ pkg_cargo + [alacritty.cargo] }}"
|
||||
pkg_sys: "{{ pkg_sys + alacritty_build_deps }}"
|
||||
pkg_cargo: "{{ pkg_cargo + [alacritty_src_install] }}"
|
||||
|
||||
- name: Append alacritty to pkg_cask
|
||||
when:
|
||||
- alacritty.method == 'cask'
|
||||
ansible.builtin.set_fact:
|
||||
pkg_cask: "{{ pkg_cask + ['alacritty'] }}"
|
||||
pkg_cask: "{{ pkg_cask + [alacritty_pkgname] }}"
|
||||
|
||||
- name: Set alacritty_configured
|
||||
ansible.builtin.set_fact:
|
||||
|
||||
Reference in New Issue
Block a user