diff --git a/tasks/helpers/archive.yml b/tasks/helpers/archive.yml index ac66a29..4edc6cd 100644 --- a/tasks/helpers/archive.yml +++ b/tasks/helpers/archive.yml @@ -1,4 +1,11 @@ # vim: set filetype=yaml.ansible : +# +## Helpers: archive.yml +## Description: extract and symlink archives +## Variables: dict of key:value pairs +## extract_to: path to extract archive to +## name: filename of the archive +## url: download url of the archive --- - name: Ensure requirements met when: diff --git a/tasks/helpers/zig.yml b/tasks/helpers/zig.yml new file mode 100644 index 0000000..104dd21 --- /dev/null +++ b/tasks/helpers/zig.yml @@ -0,0 +1,27 @@ +# vim : set filetype=yaml.ansible : +# +## Helper: zig.yml +## Description: build and install zig based packages +## Variables: dict of key:value pairs +## source_path: Destination path when cloning/extracting +## git: passed into helpers/git.yml if present. See that for required dict keys +## archive: passed into helpers/archive.yml to extract if present. See that for required dict keys +## prefix: install prefix +## flags: flags to pass to zig build +--- +- name: Clone git repository if it exists + when: + - pkg.git is defined + vars: + path: "{{ pkg.source_path }}" + repo: "{{ pkg.git.repo }}" + depth: "{{ pkg.git.depth | default(omit) }}" + force: "{{ pkg.git.force | default(omit) }}" + recursive: "{{ pkg.git.recursive | default(omit) }}" + version: "{{ pkg.version | default(omit) }}" + ansible.builtin.include_tasks: helpers/git.yml + +- name: Download and extract source archive + when: + - pkg.archive is defined + ansible.bulitin.include_tasks: helpers/archive.yml diff --git a/tasks/pkgs/ghostty.yml b/tasks/pkgs/ghostty.yml index 8017405..422ebba 100644 --- a/tasks/pkgs/ghostty.yml +++ b/tasks/pkgs/ghostty.yml @@ -93,6 +93,8 @@ methods: "{{ ghostty[distribution].methods | default(_methods['default']) }}" source_url: "{{ ghostty.base_url }}/{{ ghostty.version }}/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: Set ghostty install method @@ -105,11 +107,23 @@ when: - ghostty_imethod == 'source' block: - - name: Append ghostty to pkg_src + - name: Add ghostty package dependencies + when: + - ghostty.pkg_deps is defined + - ghostty.pkg_deps|length > 0 + loop: "{{ ghostty.pkg_deps }}" + loop_control: + loop_var: dep + ansible.bulitin.include_tasks: pkgs/{{ dep }}.yml + + - name: Add ghostty system dependencies ansible.builtin.set_fact: - pkg_src: "{{ pkg_src + ghostty.pkg }}" pkg_sys: "{{ pkg_sys + ghostty.build_deps }}" + - name: Configure ghostty zig install + ansible.builtin.set_fact: + + - name: Configure ghostty appimage install when: - ghostty_imethod == 'appimage'