standarizing cmake builds

This commit is contained in:
Matthew Stobbs
2025-03-31 21:17:22 -06:00
parent 4da72c2539
commit 40adb16987
18 changed files with 242 additions and 216 deletions

View File

@@ -11,7 +11,7 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
alacritty: alacritty:
method: "{{ alacritty.method }}" method: "{{ alacritty.method }}"
build_deps: "{{ pkgconfig.alacritty.build_deps[ansible_os_family] }}" build_deps: "{{ srcconfig.alacritty.deps[ansible_os_family] }}"
cargo: cargo:
vers: "{{ pkgconfig.alacritty.version }}" vers: "{{ pkgconfig.alacritty.version }}"
locked: true locked: true

View File

@@ -4,11 +4,7 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
aquamarine: aquamarine:
bin: aquamarine bin: aquamarine
build: "{{ pkgconfig.aquamarine.build }}" build_deps: "{{ srcconfig.aquamarine.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 }}" pkg_deps: "{{ pkgconfig.aquamarine.pkg_deps }}"
repo: "{{ pkgconfig.aquamarine.repo }}"
vers: "{{ pkgconfig.aquamarine.version }}" vers: "{{ pkgconfig.aquamarine.version }}"

View File

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

View File

@@ -40,6 +40,7 @@
pipx_exec: "/usr/bin/pipx" pipx_exec: "/usr/bin/pipx"
sys_pkg_become: true # Linux package managers require sudo access sys_pkg_become: true # Linux package managers require sudo access
lib_path: lib64 lib_path: lib64
root_prefix: /usr/local
- name: Set alpine linux specific facts - name: Set alpine linux specific facts
when: when:

View File

@@ -0,0 +1,10 @@
# vim: set filetype=yaml.ansible :
---
- name: Remove file list
become: true
loop: "{{ file_list }}"
loop_control:
loop_var: file
ansible.builtin.file:
state: absent
path: "{{ file }}"

View File

@@ -2,18 +2,18 @@
--- ---
- name: Configure {{ repo.git_path }} - name: Configure {{ repo.git_path }}
ansible.builtin.command: ansible.builtin.command:
creates: "{{ repo.git_path }}/build" creates: "{{ src_path }}/build"
chdir: "{{ repo.git_path }}" chdir: "{{ src_path }}"
argv: "{{ repo.build.configure }}" argv: "{{ configure }}"
- name: Build {{ repo.git_path }} - name: Build {{ repo.git_path }}
ansible.builtin.command: ansible.builtin.command:
creates: "{{ repo.git_path }}/{{ repo.build.creates }}" creates: "{{ build_creates }}"
chdir: "{{ repo.git_path }}" chdir: "{{ src_path }}"
argv: "{{ repo.build.build }}" argv: "{{ build }}"
- name: Install {{ repo.git_push }} - name: Install {{ repo.git_push }}
ansible.buitlin.command: ansible.builtin.command:
creates: "{{ repo.prefix }}/{{ repo.build.installs }}" creates: "{{ install_creates }}"
chdir: "{{ repo.git_path }}" chdir: "{{ src_path }}"
argv: "{{ repo.build.install }}" argv: "{{ install }}"

View File

@@ -1,7 +1,7 @@
- name: Clone git repository {{ repo.repo }} - name: Clone git repository {{ src_pkg }}
ansible.builtin.git: ansible.builtin.git:
depth: 1 depth: 1
force: true force: true
dest: "{{ repo.git_path }}" dest: "{{ src_path }}"
repo: "{{ repo.repo }}" repo: "{{ src_gitrepo }}"
version: "{{ repo.version | default(omit) }}" version: "{{ src_version | default(omit) }}"

View File

@@ -62,8 +62,16 @@
ansible.builtin.debug: ansible.builtin.debug:
var: pkgconfig var: pkgconfig
- name: End playbook - name: Read default package configuration
ansible.builtin.meta: end_play ansible.builtin.include_vars:
dir: src
extensions:
- yml
name: srcconfig
- name: Dump srcconfig
ansible.builtin.debug:
var: srcconfig
- name: Generate package installation lists - name: Generate package installation lists
loop: "{{ packages | unique }}" loop: "{{ packages | unique }}"

View File

@@ -3,13 +3,10 @@
- name: Remove existing install {{ pkg }} - name: Remove existing install {{ pkg }}
when: when:
- aquamarine.clean - aquamarine.clean
become: true vars:
loop: "{{ aquamarine.installed_files }}" file_list: "{{ srcconfig.aquamarine.build_installed_files }}"
loop_control: ansible.builtin.include_tasks:
loop_var: file files: helpers/clean_install.yml
ansible.builtin.file:
state: absent
path: "{{ hyprland.prefix }}/{{ file }}"
- name: Check for installed {{ pkg }} - name: Check for installed {{ pkg }}
register: stat_aquamarine_inst register: stat_aquamarine_inst
@@ -22,7 +19,10 @@
block: block:
- name: Do repo clone {{ pkg }} - name: Do repo clone {{ pkg }}
vars: vars:
repo: "{{ aquamarine }}" src_pkg: aquamarine
src_path: "{{ srcconfig.aquamarine.src_path }}"
src_gitrepo: "{{ srcconfig.aquamarine.gitrepo }}"
src_version: "{{ aquamarine.vers }}"
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: helpers/git.yml file: helpers/git.yml
@@ -37,6 +37,11 @@
- name: Do build and install {{ pkg }} - name: Do build and install {{ pkg }}
vars: vars:
repo: "{{ aquamarine }}" src_path: "{{ srcconfig.aquamarine.src_path }}"
configure: "{{ srcconfig.aquamarine.configure }}"
build_creates: "{{ srcconfig.aquamarine.build_creates }}"
build: "{{ srcconfig.aquamarine.build }}"
install_creates: "{{ srcconfig.aquamarine.install_creates }}"
install: "{{ srcconfig.aquamarine.install }}"
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: helpers/cmake_build.yml file: helpers/cmake_build.yml

View File

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

View File

@@ -8,27 +8,3 @@ alacritty:
cargo: cargo:
locked: true locked: true
name: alacritty name: alacritty
build_deps:
RedHat:
- cmake
- fontconfig-devel
- freetype-devel
- g++
- libxcb-devel
- libxkbcommon-devel
Debian:
- cmake
- libfontconfig1-dev
- libfreetype6-dev
- libxcb-xfixes0-dev
- libxkbcommon-dev
- pkg-config
- python3
Alpine:
- cmake
- fontconfig-dev
- freetype-dev
- g++
- libxcb-dev
- libxkbcommon-dev
- pkgconf

View File

@@ -2,64 +2,6 @@
--- ---
aquamarine: aquamarine:
version: v0.8.0 version: v0.8.0
repo: "{{ hyprgitbase }}/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:
RedHat:
- hwdata-devel
- libdisplay-info-devel
- libdrm-devel
- libinput-devel
- libseat-devel
- mesa-libgbm-devel
- systemd-devel
- wayland-devel
- wayland-protocols-devel
Alpine:
- build-base
- elogind-dev
- hwdata-dev
- libdisplay-info-dev
- libdrm-dev
- libinput-dev
- libseat-dev
- mesa-gbm
- mesa-dev
- wayland-dev
- wayland-protocols
build_installed_files:
- "{{ lib_path }}/libaquamarine.so.0.8.0"
- "{{ lib_path }}/libaquamarine.so.7"
- "{{ lib_path }}/libaquamarine.so.0.7.2"
- "{{ lib_path }}libaquamarine.so.6"
- "{{ lib_path }}/libaquamarine.so"
- include/aquamarine
- "{{ lib_path }}/pkgconfig/aquamarine.pc"

View File

@@ -2,26 +2,5 @@
--- ---
hyprcursor: hyprcursor:
version: v0.1.12 version: v0.1.12
repo: "{{ hyprgitbase }}/hyprcursor"
pkg_deps: pkg_deps:
- hyprlang - hyprlang
build_deps:
RedHat:
- cairo-devel
- libzip-devel
- librsvg2-devel
- tomlplusplus-devel
Alpine:
- cairo-dev
- libzip-dev
- librsvg-dev
- tomlplusplus-dev
build_installed_files:
- "{{ lib_path }}/libhyprcursor.so.0.1.12"
- "{{ lib_path }}/libhyprcursor.so.0.1.11"
- "{{ lib_path }}/libhyprcursor.so.0"
- "{{ lib_path }}/libhyprcursor.so"
- include/hyprcursor.hpp
- bin/hyprcursor-util
- include/hyprcursor
- "{{ lib_path }}/pkgconfig/hyprcursor.pc"

View File

@@ -5,30 +5,3 @@ hyprgraphics:
repo: "{{ hyprgitbase }}/hyprgraphics" repo: "{{ hyprgitbase }}/hyprgraphics"
pkg_deps: pkg_deps:
- hyprutils - hyprutils
build_deps:
RedHat:
- pixman-devel
- cairo-devel
- libjpeg-turbo-devel
- libwebp-devel
- libjxl-devel
- libjxl-devtools
- libjxl-utils
- file-devel
- file-libs
- libspng-devel
Alpine:
- pixman-dev
- cairo-dev
- libjpeg-turbo-dev
- libwebp-dev
- libjxl-dev
- file-dev
- file
- libspng-dev
build_installed_files:
- "{{ lib_path }}/libhyprgraphics.so.0.1.2"
- "{{ lib_path }}/libhyprgraphics.so.0"
- "{{ lib_path }}/libhyprgraphics.so"
- include/hyprgraphics
- "{{ lib_path }}/pkgconfig/hyprgraphics.pc"

27
vars/src/alacritty.yml Normal file
View File

@@ -0,0 +1,27 @@
# vim: set filetype=yaml.ansible :
---
alacritty:
deps:
RedHat:
- cmake
- fontconfig-devel
- freetype-devel
- g++
- libxcb-devel
- libxkbcommon-devel
Debian:
- cmake
- libfontconfig1-dev
- libfreetype6-dev
- libxcb-xfixes0-dev
- libxkbcommon-dev
- pkg-config
- python3
Alpine:
- cmake
- fontconfig-dev
- freetype-dev
- g++
- libxcb-dev
- libxkbcommon-dev
- pkgconf

61
vars/src/aquamarine.yml Normal file
View File

@@ -0,0 +1,61 @@
# vim: set filetype=yaml.ansible :
---
aquamarine:
gitrepo: "{{ hyprgitbase }}/aquamarine"
src_path: "{{ d_tempdir.path }}/aquamarine"
deps:
RedHat:
- hwdata-devel
- libdisplay-info-devel
- libdrm-devel
- libinput-devel
- libseat-devel
- mesa-libgbm-devel
- systemd-devel
- wayland-devel
- wayland-protocols-devel
Alpine:
- build-base
- elogind-dev
- hwdata-dev
- libdisplay-info-dev
- libdrm-dev
- libinput-dev
- libseat-dev
- mesa-gbm
- mesa-dev
- wayland-dev
- wayland-protocols
configure:
- cmake
- --no-warn-unused-cli
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX={{ root_prefix }}
- -S
- .
- -B
- ./build
build_creates: "{{ d_tempdir.path }}/build/libaquamarine.so"
build:
- cmake
- --build
- ./build
- --config
- Release
- --target
- all
- -j
- "{{ ansible_processor_nproc | int }}"
build_installs: "{{ root_prefix }}/{{ lib_path }}/libaquamarine.so"
install:
- cmake
- --install
- ./build
build_installed_files:
- "{{ lib_path }}/libaquamarine.so.0.8.0"
- "{{ lib_path }}/libaquamarine.so.7"
- "{{ lib_path }}/libaquamarine.so.0.7.2"
- "{{ lib_path }}libaquamarine.so.6"
- "{{ lib_path }}/libaquamarine.so"
- include/aquamarine
- "{{ lib_path }}/pkgconfig/aquamarine.pc"

50
vars/src/hyprcursor.yml Normal file
View File

@@ -0,0 +1,50 @@
# vim: set filetype=yaml.ansible :
---
hyprcursor:
gitrepo: "{{ hyprgitbase }}/hyprcursor"
src_path: "{{ d_tempdir.path }}/hyprcursor"
configure:
- cmake
- --no-warn-unused-cli
- DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX={{ hyprland.prefix }}
- -S
- .
- -B
- ./build
build_creates: "{{ d_tempdir.path }}/hyprcursor/build/libhyprcursor.so"
build:
- cmake
- --build
- ./build
- --config
- Release
- --target
- all
- -j
- "{{ ansible_processor_nproc | int }}"
install_creates: "{{ root_prefix }}/bin/hyprcursor-util"
install:
- cmake
- --install
- ./build
deps:
RedHat:
- cairo-devel
- libzip-devel
- librsvg2-devel
- tomlplusplus-devel
Alpine:
- cairo-dev
- libzip-dev
- librsvg-dev
- tomlplusplus-dev
build_installed_files:
- "{{ lib_path }}/libhyprcursor.so.0.1.12"
- "{{ lib_path }}/libhyprcursor.so.0.1.11"
- "{{ lib_path }}/libhyprcursor.so.0"
- "{{ lib_path }}/libhyprcursor.so"
- include/hyprcursor.hpp
- bin/hyprcursor-util
- include/hyprcursor
- "{{ lib_path }}/pkgconfig/hyprcursor.pc"

30
vars/src/hyrpgraphics.yml Normal file
View File

@@ -0,0 +1,30 @@
# vim: set filetype=yaml.ansible :
---
hyprgraphics:
deps:
RedHat:
- pixman-devel
- cairo-devel
- libjpeg-turbo-devel
- libwebp-devel
- libjxl-devel
- libjxl-devtools
- libjxl-utils
- file-devel
- file-libs
- libspng-devel
Alpine:
- pixman-dev
- cairo-dev
- libjpeg-turbo-dev
- libwebp-dev
- libjxl-dev
- file-dev
- file
- libspng-dev
build_installed_files:
- "{{ lib_path }}/libhyprgraphics.so.0.1.2"
- "{{ lib_path }}/libhyprgraphics.so.0"
- "{{ lib_path }}/libhyprgraphics.so"
- include/hyprgraphics
- "{{ lib_path }}/pkgconfig/hyprgraphics.pc"