Files
ansible_role_package/tasks/src/hyprwayland_scanner.yml
2025-03-16 20:17:28 -06:00

58 lines
1.6 KiB
YAML

- name: Remove existing install {{ pkg }}
when:
- hyprland_clean
become: "{{ ext_become }}"
loop: "{{ hyprwayland_scanner.installed_files }}"
loop_control:
loop_var: file
ansible.builtin.file:
state: absent
path: "{{ hyprland.prefix }}/{{ file }}"
- name: Check for installed {{ pkg }}
register: stat_hyprwayland_scanner_inst
ansible.builtin.stat:
path: "{{ hyprland.prefix }}/bin/hyprwayland-scanner"
- name: Build and install {{ pkg }}
when:
- not stat_hyprwayland_scanner_inst.stat.exists
block:
- name: Clone git repository
ansible.builtin.git:
depth: 1
dest: "{{ d_tempdir.path }}/hyprwayland-scanner"
repo: "{{ hyprwayland_scanner.repo }}"
version: "{{ hyprwayland_scanner.vers }}"
- name: Configure {{ pkg }}
ansible.builtin.command:
creates: "{{ d_tempdir.path }}/hyprwayland-scanner/build"
chdir: "{{ d_tempdir.path }}/hyprwayland-scanner"
argv:
- cmake
- -DCMAKE_INSTALL_PREFIX={{ hyprland.prefix }}
- -B
- build
- name: Build {{ pkg }}
ansible.builtin.command:
creates: "{{ d_tempdir.path }}/hyprwayland-scanner/build/hyprwayland-scanner"
chdir: "{{ d_tempdir.path }}/hyprwayland-scanner"
argv:
- cmake
- --build
- build
- -j
- "{{ ansible_processor_nproc|int }}"
- name: Install {{ pkg }}
become: true
ansible.builtin.command:
creates: "{{ path.bin }}/hyprwayland-scanner"
chdir: "{{ d_tempdir.path }}/hyprwayland-scanner"
argv:
- cmake
- --install
- build