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

@@ -5,7 +5,7 @@
hyprgraphics: hyprgraphics:
vers: "{{ pkgconfig.hyprgraphics.version }}" vers: "{{ pkgconfig.hyprgraphics.version }}"
repo: "{{ pkgconfig.hyprgraphics.repo }}" repo: "{{ pkgconfig.hyprgraphics.repo }}"
build_deps: "{{ pkgconfig.hyprgraphics.build_deps[ansible_os_family] }}" build_deps: "{{ srcconfig.hyprgraphics.deps[ansible_os_family] }}"
installed_files: "{{ pkgconfig.hyprgraphics.build_installed_files }}" installed_files: "{{ pkgconfig.hyprgraphics.build_installed_files }}"
git_path: "{{ d_tempdir.path }}/hyprgraphics" git_path: "{{ d_tempdir.path }}/hyprgraphics"
clean: "{{ pkgconfig_hyprland_clean | default(package_default_clean_src) }}" clean: "{{ pkgconfig_hyprland_clean | default(package_default_clean_src) }}"

View File

@@ -3,13 +3,10 @@
- name: Remove existing install of {{ pkg }} - name: Remove existing install of {{ pkg }}
when: when:
- hyprgraphics.clean - hyprgraphics.clean
become: true vars:
loop: "{{ hyprgraphics.installed_files }}" file_list: "{{ srcconfig.hyprcursor.build_installed_files }}"
loop_control: ansible.builtin.include_tasks:
loop_var: file file: helpers/clean_install.yml
ansible.builtin.file:
state: absent
path: "{{ hyprland.prefix }}/{{ file }}"
- name: Check for existing install {{ pkg }} - name: Check for existing install {{ pkg }}
register: stat_hyprgraphics_inst register: stat_hyprgraphics_inst
@@ -20,49 +17,22 @@
when: when:
- not stat_hyprgraphics_inst.stat.exists - not stat_hyprgraphics_inst.stat.exists
block: block:
- name: Clone git repository {{ pkg }} - name: Do repo clone {{ pkg }}
ansible.builtin.git: vars:
force: true src_pkg: hyprgraphics
depth: 1 src_path: "{{ srcconfig.hyprgraphics.src_path }}"
dest: "{{ hyprgraphics.git_path }}" src_gitrepo: "{{ srconfig.hyprgraphics.gitrepo }}"
repo: "{{ hyprgraphics.repo }}" src_version: "{{ hyprgraphics.vers }}"
version: "{{ hyprgraphics.vers }}" ansible.builtin.include_tasks:
file: helpers/git.yml
- name: Configure {{ pkg }} - name: CMake build and install {{ pkg }}
ansible.builtin.command: vars:
creates: "{{ hyprgraphics.git_path }}/build" src_path: "{{ srcconfig.hyprgraphics.src_path }}"
chdir: "{{ hyprgraphics.git_path }}" configure: "{{ srcconfig.hyprgraphics.configure }}"
argv: build_creates: "{{ srcconfig.hyprgraphics.build_creates }}"
- cmake build: "{{ srcconfig.hyprgraphics.build }}"
- --no-warn-unused-cli install_creates: "{{ srcconfig.hyprgraphics.install_creates }}"
- DCMAKE_BUILD_TYPE=Release install: "{{ srcconfig.hyprcursor.install }}"
- -DCMAKE_INSTALL_PREFIX={{ hyprland.prefix }} ansible.builtin.include_tasks:
- -S files: helpers/cmake_build.yml
- .
- -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

View File

@@ -1,6 +1,32 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
hyprgraphics: hyprgraphics:
src_path: "{{ d_tempdir.path }}/hyprgraphics"
configure:
- cmake
- --no-warn-unused-cli
- DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX={{ hyprland.prefix }}
- -S
- .
- -B
- ./build
build_creates: "{{ d_tempdir.path }}/hyprgraphics/build/libhyprgraphics.so"
build:
- cmake
- --build
- ./build
- --config
- Release
- --target
- all
- -j
- "{{ ansible_processor_nproc | int }}"
install_creates: "{{ root_prefix }}/{{ lib_path }}/libhyprgraphics.so.0.1.2"
install:
- cmake
- --install
- ./build
deps: deps:
RedHat: RedHat:
- pixman-devel - pixman-devel