add hyprpolkit

This commit is contained in:
Matthew Stobbs
2025-03-03 16:15:11 -07:00
parent ea9e524cf9
commit 198c1f80fe
5 changed files with 106 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
- name: Set hyprpolkitagent config
ansible.builtin.set_fact:
hyprpolkitagent:
vers: "{{ pkgconfig.hyprpolkitagent.version }}"
repo: "{{ pkgconfig.hyprpolkitagent.repo }}"
build_deps: "{{ pkgconfig.hyprpolkitagent.build_deps }}"
installed_files: "{{ pkgconfig.hyprpolkitagent.build_installed_files }}"
git_path: "{{ d_tempdir.path }}/hyprpolkitagent"

View File

@@ -0,0 +1,20 @@
# vim: set filetype=yaml.ansible :
---
- name: Add hyprpolkitagent
when:
- hyprpolkitagent_configured is undefined
block:
- name: Set hyprpolkitagent_configured
ansible.builtin.set_fact:
hyprpolkitagent_configured: true
- name: Load hyprpolkitagent config
when:
- hyprpolkitagent is undefined
ansible.builtin.include_tasks:
file: config/hyprpolkitagent.yml
- name: Append to pkg_src
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + hyprpolkitagent.build_deps }}"
pkg_src: "{{ pkg_src + ['hyprpolkitagent'] }}"

View File

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