70 lines
1.7 KiB
YAML
70 lines
1.7 KiB
YAML
# vim: set filetype=yaml.ansible :
|
|
---
|
|
- name: Remove existing install of {{ pkg }}
|
|
when:
|
|
- hyprland.clean
|
|
become: true
|
|
loop: "{{ hyprland.installed_files }}"
|
|
loop_control:
|
|
loop_var: file
|
|
ansible.builtin.file:
|
|
state: absent
|
|
path: "{{ hyprland.prefix }}/{{ file }}"
|
|
|
|
- name: Check for existing install of {{ pkg }}
|
|
register: stat_hyprland_bin
|
|
ansible.builtin.stat:
|
|
path: "{{ hyprland.prefix }}/bin/Hyprland"
|
|
|
|
- name: Build and install {{ pkg }}
|
|
when:
|
|
- not stat_hyprland_bin.stat.exists
|
|
block:
|
|
- name: Clone git repository
|
|
ansible.builtin.git:
|
|
force: true
|
|
depth: 1
|
|
dest: "{{ hyprland.git_path }}"
|
|
recursive: true
|
|
repo: "{{ hyprland.repo }}"
|
|
version: "{{ hyprland.vers }}"
|
|
|
|
- name: Configure {{ pkg }}
|
|
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={{ hyprland.prefix }}
|
|
- -S
|
|
- .
|
|
- -B
|
|
- ./build
|
|
|
|
- name: Build {{ pkg }}
|
|
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 {{ pkg }}
|
|
become: true
|
|
ansible.builtin.command:
|
|
creates: "{{ path.bin }}/hyprland"
|
|
chdir: "{{ hyprland.git_path }}"
|
|
argv:
|
|
- cmake
|
|
- --install
|
|
- ./build
|