port hyprgraphics to using helpers

This commit is contained in:
Matthew Stobbs
2025-04-01 03:53:23 -06:00
parent f045cbfa85
commit 8814ff5bc7
3 changed files with 49 additions and 53 deletions

View File

@@ -3,13 +3,10 @@
- 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 }}"
vars:
file_list: "{{ srcconfig.hyprcursor.build_installed_files }}"
ansible.builtin.include_tasks:
file: helpers/clean_install.yml
- name: Check for existing install {{ pkg }}
register: stat_hyprgraphics_inst
@@ -20,49 +17,22 @@
when:
- not stat_hyprgraphics_inst.stat.exists
block:
- name: Clone git repository {{ pkg }}
ansible.builtin.git:
force: true
depth: 1
dest: "{{ hyprgraphics.git_path }}"
repo: "{{ hyprgraphics.repo }}"
version: "{{ hyprgraphics.vers }}"
- name: Do repo clone {{ pkg }}
vars:
src_pkg: hyprgraphics
src_path: "{{ srcconfig.hyprgraphics.src_path }}"
src_gitrepo: "{{ srconfig.hyprgraphics.gitrepo }}"
src_version: "{{ hyprgraphics.vers }}"
ansible.builtin.include_tasks:
file: helpers/git.yml
- 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
- name: CMake build and install {{ pkg }}
vars:
src_path: "{{ srcconfig.hyprgraphics.src_path }}"
configure: "{{ srcconfig.hyprgraphics.configure }}"
build_creates: "{{ srcconfig.hyprgraphics.build_creates }}"
build: "{{ srcconfig.hyprgraphics.build }}"
install_creates: "{{ srcconfig.hyprgraphics.install_creates }}"
install: "{{ srcconfig.hyprcursor.install }}"
ansible.builtin.include_tasks:
files: helpers/cmake_build.yml