37 lines
1.2 KiB
YAML
37 lines
1.2 KiB
YAML
# 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.builtin.include_tasks: helpers/archive.yml
|
|
|
|
- name: Ensure facts are set
|
|
ansible.builtin.set_fact:
|
|
zbf: "{{ pkg.build_flags | default([]) }}"
|
|
|
|
- name: Zig build and install
|
|
ansible.builtin.command:
|
|
argv: "{{ ['zig', 'build' '-p', install_prefix] + zbf }}"
|
|
chdir: "{{ pkg.source_path }}"
|