69 lines
1.7 KiB
YAML
69 lines
1.7 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
- name: Remove existing install {{ pkg }}
|
|
when:
|
|
- hyprutils.clean
|
|
become: true
|
|
loop: "{{ hyprutils.installed_files }}"
|
|
loop_control:
|
|
loop_var: file
|
|
ansible.builtin.file:
|
|
state: absent
|
|
path: "{{ hyprland.prefix }}/{{ file }}"
|
|
|
|
- name: Check for installed {{ pkg }}
|
|
register: stat_hyprutils_inst
|
|
ansible.builtin.stat:
|
|
path: "{{ hyprland.prefix }}/{{ lib_path }}/libhyprutils.so"
|
|
|
|
- name: Build and install {{ pkg }}
|
|
when:
|
|
- not stat_hyprutils_inst.stat.exists
|
|
block:
|
|
- name: Clone git repository {{ pkg }}
|
|
ansible.builtin.git:
|
|
force: true
|
|
depth: 1
|
|
dest: "{{ hyprutils.git_path }}"
|
|
repo: "{{ hyprutils.repo }}"
|
|
version: "{{ hyprutils.vers }}"
|
|
|
|
- name: Configure {{ pkg }}
|
|
ansible.builtin.command:
|
|
creates: "{{ hyprutils.git_path }}/build"
|
|
chdir: "{{ hyprutils.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: "{{ hyprutils.git_path }}/build/hyprutils.so"
|
|
chdir: "{{ hyprutils.git_path }}"
|
|
argv:
|
|
- cmake
|
|
- --build
|
|
- ./build
|
|
- --config
|
|
- Release
|
|
- --target
|
|
- all
|
|
- -j
|
|
- "{{ ansible_processor_nproc | int }}"
|
|
|
|
- name: Install {{ pkg }}
|
|
become: true
|
|
ansible.builtin.command:
|
|
creates: "{{ path.bin }}/hyprutils"
|
|
chdir: "{{ hyprutils.git_path }}"
|
|
argv:
|
|
- cmake
|
|
- --install
|
|
- ./build
|