add helpers for git cloning and building
This commit is contained in:
@@ -3,11 +3,12 @@
|
||||
- name: Set aquamarine config
|
||||
ansible.builtin.set_fact:
|
||||
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
|
||||
build: "{{ pkgconfig.aquamarine.build }}"
|
||||
build_deps: "{{ pkgconfig.aquamarine.build_deps[ansible_os_family] }}"
|
||||
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:
|
||||
- not stat_aquamarine_inst.stat.exists
|
||||
block:
|
||||
- name: Clone git repository {{ pkg }}
|
||||
ansible.builtin.git:
|
||||
depth: 1
|
||||
force: true
|
||||
dest: "{{ aquamarine.git_path }}"
|
||||
repo: "{{ aquamarine.repo }}"
|
||||
version: "{{ aquamarine.vers }}"
|
||||
- name: Do repo clone {{ pkg }}
|
||||
vars:
|
||||
repo: "{{ aquamarine }}"
|
||||
ansible.builtin.include_tasks:
|
||||
file: helpers/git.yml
|
||||
|
||||
- name: Apply patch for alpine linux {{ pkg }}
|
||||
when:
|
||||
@@ -37,41 +35,8 @@
|
||||
state: present
|
||||
strip: 1
|
||||
|
||||
- name: Configure {{ pkg }}
|
||||
ansible.builtin.command:
|
||||
creates: "{{ aquamarine.git_path }}/build"
|
||||
chdir: "{{ aquamarine.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: "{{ 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
|
||||
- name: Do build and install {{ pkg }}
|
||||
vars:
|
||||
repo: "{{ aquamarine }}"
|
||||
ansible.builtin.include_tasks:
|
||||
file: helpers/cmake_build.yml
|
||||
|
||||
Reference in New Issue
Block a user