add helpers for git cloning and building
This commit is contained in:
@@ -3,11 +3,12 @@
|
|||||||
- name: Set aquamarine config
|
- name: Set aquamarine config
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
aquamarine:
|
aquamarine:
|
||||||
vers: "{{ pkgconfig.aquamarine.version }}"
|
|
||||||
repo: "{{ pkgconfig.aquamarine.repo }}"
|
|
||||||
git_path: "{{ d_tempdir.path }}/aquamarine"
|
|
||||||
pkg_deps: "{{ pkgconfig.aquamarine.pkg_deps }}"
|
|
||||||
installed_files: "{{ pkgconfig.aquamarine.build_installed_files }}"
|
|
||||||
bin: aquamarine
|
bin: aquamarine
|
||||||
|
build: "{{ pkgconfig.aquamarine.build }}"
|
||||||
build_deps: "{{ pkgconfig.aquamarine.build_deps[ansible_os_family] }}"
|
build_deps: "{{ pkgconfig.aquamarine.build_deps[ansible_os_family] }}"
|
||||||
clean: "{{ pkgconfig_hyprland_clean | default(package_default_clean_src) }}"
|
clean: "{{ pkgconfig_hyprland_clean | default(package_default_clean_src) }}"
|
||||||
|
git_path: "{{ d_tempdir.path }}/aquamarine"
|
||||||
|
installed_files: "{{ pkgconfig.aquamarine.build_installed_files }}"
|
||||||
|
pkg_deps: "{{ pkgconfig.aquamarine.pkg_deps }}"
|
||||||
|
repo: "{{ pkgconfig.aquamarine.repo }}"
|
||||||
|
vers: "{{ pkgconfig.aquamarine.version }}"
|
||||||
|
|||||||
19
tasks/helpers/cmake_build.yml
Normal file
19
tasks/helpers/cmake_build.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# vim: set filetype=yaml.ansible :
|
||||||
|
---
|
||||||
|
- name: Configure {{ repo.git_path }}
|
||||||
|
ansible.builtin.command:
|
||||||
|
creates: "{{ repo.git_path }}/build"
|
||||||
|
chdir: "{{ repo.git_path }}"
|
||||||
|
argv: "{{ repo.build.configure }}"
|
||||||
|
|
||||||
|
- name: Build {{ repo.git_path }}
|
||||||
|
ansible.builtin.command:
|
||||||
|
creates: "{{ repo.git_path }}/{{ repo.build.creates }}"
|
||||||
|
chdir: "{{ repo.git_path }}"
|
||||||
|
argv: "{{ repo.build.build }}"
|
||||||
|
|
||||||
|
- name: Install {{ repo.git_push }}
|
||||||
|
ansible.buitlin.command:
|
||||||
|
creates: "{{ repo.prefix }}/{{ repo.build.installs }}"
|
||||||
|
chdir: "{{ repo.git_path }}"
|
||||||
|
argv: "{{ repo.build.install }}"
|
||||||
7
tasks/helpers/git.yml
Normal file
7
tasks/helpers/git.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
- name: Clone git repository {{ repo.repo }}
|
||||||
|
ansible.builtin.git:
|
||||||
|
depth: 1
|
||||||
|
force: true
|
||||||
|
dest: "{{ repo.git_path }}"
|
||||||
|
repo: "{{ repo.repo }}"
|
||||||
|
version: "{{ repo.version | default(omit) }}"
|
||||||
@@ -20,13 +20,11 @@
|
|||||||
when:
|
when:
|
||||||
- not stat_aquamarine_inst.stat.exists
|
- not stat_aquamarine_inst.stat.exists
|
||||||
block:
|
block:
|
||||||
- name: Clone git repository {{ pkg }}
|
- name: Do repo clone {{ pkg }}
|
||||||
ansible.builtin.git:
|
vars:
|
||||||
depth: 1
|
repo: "{{ aquamarine }}"
|
||||||
force: true
|
ansible.builtin.include_tasks:
|
||||||
dest: "{{ aquamarine.git_path }}"
|
file: helpers/git.yml
|
||||||
repo: "{{ aquamarine.repo }}"
|
|
||||||
version: "{{ aquamarine.vers }}"
|
|
||||||
|
|
||||||
- name: Apply patch for alpine linux {{ pkg }}
|
- name: Apply patch for alpine linux {{ pkg }}
|
||||||
when:
|
when:
|
||||||
@@ -37,41 +35,8 @@
|
|||||||
state: present
|
state: present
|
||||||
strip: 1
|
strip: 1
|
||||||
|
|
||||||
- name: Configure {{ pkg }}
|
- name: Do build and install {{ pkg }}
|
||||||
ansible.builtin.command:
|
vars:
|
||||||
creates: "{{ aquamarine.git_path }}/build"
|
repo: "{{ aquamarine }}"
|
||||||
chdir: "{{ aquamarine.git_path }}"
|
ansible.builtin.include_tasks:
|
||||||
argv:
|
file: helpers/cmake_build.yml
|
||||||
- cmake
|
|
||||||
- --no-warn-unused-cli
|
|
||||||
- -DCMAKE_BUILD_TYPE=Release
|
|
||||||
- -DCMAKE_INSTALL_PREFIX={{ hyprland.prefix }}
|
|
||||||
- -S
|
|
||||||
- .
|
|
||||||
- -B
|
|
||||||
- ./build
|
|
||||||
|
|
||||||
- name: Build {{ pkg }}
|
|
||||||
ansible.builtin.command:
|
|
||||||
creates: "{{ aquamarine.git_path }}/build/libaquamarine.so"
|
|
||||||
chdir: "{{ aquamarine.git_path }}"
|
|
||||||
argv:
|
|
||||||
- cmake
|
|
||||||
- --build
|
|
||||||
- ./build
|
|
||||||
- --config
|
|
||||||
- Release
|
|
||||||
- --target
|
|
||||||
- all
|
|
||||||
- -j
|
|
||||||
- "{{ ansible_processor_nproc | int }}"
|
|
||||||
|
|
||||||
- name: Install {{ pkg }}
|
|
||||||
become: true
|
|
||||||
ansible.builtin.command:
|
|
||||||
creates: "{{ hyprland.prefix }}/{{ lib_path }}/libaquamarine.so"
|
|
||||||
chdir: "{{ aquamarine.git_path }}"
|
|
||||||
argv:
|
|
||||||
- cmake
|
|
||||||
- --install
|
|
||||||
- ./build
|
|
||||||
|
|||||||
@@ -6,6 +6,32 @@ aquamarine:
|
|||||||
pkg_deps:
|
pkg_deps:
|
||||||
- hyprwayland_scanner
|
- hyprwayland_scanner
|
||||||
- hyprutils
|
- hyprutils
|
||||||
|
build:
|
||||||
|
configure:
|
||||||
|
- cmake
|
||||||
|
- --no-warn-unused-cli
|
||||||
|
- -DCMAKE_BUILD_TYPE=Release
|
||||||
|
- -DCMAKE_INSTALL_PREFIX={{ hyprland.prefix }}
|
||||||
|
- -S
|
||||||
|
- .
|
||||||
|
- -B
|
||||||
|
- ./build
|
||||||
|
creates: build/libaquamarine.so
|
||||||
|
build:
|
||||||
|
- cmake
|
||||||
|
- --build
|
||||||
|
- ./build
|
||||||
|
- --config
|
||||||
|
- Release
|
||||||
|
- --target
|
||||||
|
- all
|
||||||
|
- -j
|
||||||
|
- "{{ ansible_processor_nproc | int }}"
|
||||||
|
installs: "{{ lib_path }}/libaquamarine.so"
|
||||||
|
install:
|
||||||
|
- cmake
|
||||||
|
- --install
|
||||||
|
- ./build
|
||||||
build_deps:
|
build_deps:
|
||||||
RedHat:
|
RedHat:
|
||||||
- hwdata-devel
|
- hwdata-devel
|
||||||
|
|||||||
Reference in New Issue
Block a user