- name: Remove existing install 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 if hyprwayland-scanner is installed register: stat_hyprwayland_scanner_inst ansible.builtin.stat: path: "{{ hyprland.prefix }}/bin/hyprwayland-scanner" - name: Build and install hyprwayland-scanner 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 hyprwayland-scanner 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 hyprwayland-scanner 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 hyprwayland-scanner become: true ansible.builtin.command: creates: "{{ path.bin }}/hyprwayland-scanner" chdir: "{{ d_tempdir.path }}/hyprwayland-scanner" argv: - cmake - --install - build