- name: Remove existing install of {{ pkg }} when: - hyprgraphics.clean become: true loop: "{{ hyprgraphics.installed_files }}" loop_control: loop_var: file ansible.builtin.file: state: absent path: "{{ hyprland.prefix }}/{{ file }}" - name: Check for existing install {{ pkg }} register: stat_hyprgraphics_inst ansible.builtin.stat: path: "{{ hyprland.prefix }}/{{ lib_path }}/libhyprgraphics.so" - name: Build and install {{ pkg }} when: - not stat_hyprgraphics_inst.stat.exists block: - name: Clone git repository {{ pkg }} ansible.builtin.git: depth: 1 dest: "{{ hyprgraphics.git_path }}" repo: "{{ hyprgraphics.repo }}" version: "{{ hyprgraphics.vers }}" - name: Configure {{ pkg }} ansible.builtin.command: creates: "{{ hyprgraphics.git_path }}/build" chdir: "{{ hyprgraphics.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: "{{ hyprgraphics.git_path }}/build/libhyprgraphics.so" chdir: "{{ hyprgraphics.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 }}/hyprgraphics" chdir: "{{ hyprgraphics.git_path }}" argv: - cmake - --install - ./build