Files
ansible_role_package/tasks/src/aquamarine.yml
2025-03-31 18:15:07 -06:00

77 lines
2.0 KiB
YAML

# vim: set filetype=yaml.ansible :
---
- name: Remove existing install {{ pkg }}
when:
- aquamarine.clean
become: true
loop: "{{ aquamarine.installed_files }}"
loop_control:
loop_var: file
ansible.builtin.file:
state: absent
path: "{{ hyprland.prefix }}/{{ file }}"
- name: Check for installed {{ pkg }}
register: stat_aquamarine_inst
ansible.builtin.stat:
path: "{{ hyprland.prefix }}/{{ lib_path }}/libaquamarine.so"
- name: Build and install {{ pkg }}
when:
- not stat_aquamarine_inst.stat.exists
block:
- name: Clone git repository {{ pkg }}
ansible.builtin.git:
depth: 1
dest: "{{ aquamarine.git_path }}"
repo: "{{ aquamarine.repo }}"
version: "{{ aquamarine.vers }}"
- name: Apply patch for alpine linux {{ pkg }}
when:
- ansible_os_family == 'Alpine'
ansible.posix.patch:
basedir: "{{ aquamarine.git_path }}"
src: aquamarine/Alpine.patch
state: present
strip: 1
- name: Configure {{ pkg }}
ansible.builtin.command:
creates: "{{ aquamarine.git_path }}/build"
chdir: "{{ aquamarine.git_path }}"
argv:
- cmake
- --no-warn-unused-cli
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX={{ hyprland.prefix }}
- -S
- .
- -B
- ./build
- name: Build {{ pkg }}
ansible.builtin.command:
creates: "{{ aquamarine.git_path }}/build/libaquamarine.so"
chdir: "{{ aquamarine.git_path }}"
argv:
- cmake
- --build
- ./build
- --config
- Release
- --target
- all
- -j
- "{{ ansible_processor_nproc | int }}"
- name: Install {{ pkg }}
become: true
ansible.builtin.command:
creates: "{{ hyprland.prefix }}/{{ lib_path }}/libaquamarine.so"
chdir: "{{ aquamarine.git_path }}"
argv:
- cmake
- --install
- ./build