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