- name: Remove existing install when: - hyprland_clean become: "{{ ext_become }}" loop: "{{ hyprland.installed_files }}" loop_control: loop_var: file ansible.builtin.file: state: absent path: "{{ path.prefix }}/{{ file }}" - name: Check if hyprland is installed register: stat_hyprland_bin ansible.builtin.stat: path: "{{ path.bin }}/Hyprland" - name: Build and install hyprland when: - not stat_hyprland_bin.stat.exists block: - name: Clone git repository ansible.builtin.git: depth: 1 dest: "{{ hyprland.git_path }}" recursive: true repo: "{{ hyprland.repo }}" version: "{{ hyprland.vers }}" - name: Configure hyprland ansible.builtin.command: creates: "{{ hyprland.git_path }}/build" chdir: "{{ hyprland.git_path }}" argv: - cmake - --no-warn-unused-cli - -DCMAKE_BUILD_TYPE:STRING=Release - -DCMAKE_INSTALL_PREFIX:PATH={{ path.prefix }} - -S - . - -B - ./build - name: Build hyprland ansible.builtin.command: creates: "{{ hyprland.git_path }}/build/Hyprland" chdir: "{{ hyprland.git_path }}" argv: - cmake - --build - ./build - --config - Release - --target - all - -j - "{{ ansible_processor_nproc|int }}" - name: Install hyprland become: "{{ ext_become }}" ansible.builtin.command: creates: "{{ path.bin }}/hyprland" chdir: "{{ hyprland.git_path }}" argv: - cmake - --install - ./build