diff --git a/tasks/config/alacritty.yml b/tasks/config/alacritty.yml index e80c4f7..6aba863 100644 --- a/tasks/config/alacritty.yml +++ b/tasks/config/alacritty.yml @@ -11,7 +11,7 @@ ansible.builtin.set_fact: alacritty: method: "{{ alacritty.method }}" - build_deps: "{{ pkgconfig.alacritty.build_deps[ansible_os_family] }}" + build_deps: "{{ srcconfig.alacritty.deps[ansible_os_family] }}" cargo: vers: "{{ pkgconfig.alacritty.version }}" locked: true diff --git a/tasks/config/aquamarine.yml b/tasks/config/aquamarine.yml index 9fd8f9e..4b47447 100644 --- a/tasks/config/aquamarine.yml +++ b/tasks/config/aquamarine.yml @@ -4,11 +4,7 @@ ansible.builtin.set_fact: aquamarine: bin: aquamarine - build: "{{ pkgconfig.aquamarine.build }}" - build_deps: "{{ pkgconfig.aquamarine.build_deps[ansible_os_family] }}" + build_deps: "{{ srcconfig.aquamarine.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 }}" diff --git a/tasks/config/hyprcursor.yml b/tasks/config/hyprcursor.yml index e807c63..904a860 100644 --- a/tasks/config/hyprcursor.yml +++ b/tasks/config/hyprcursor.yml @@ -6,7 +6,5 @@ vers: "{{ pkgconfig.hyprcursor.version }}" repo: "{{ pkgconfig.hyprcursor.repo }}" pkg_deps: "{{ pkgconfig.hyprcursor.pkg_deps }}" - build_deps: "{{ pkgconfig.hyprcursor.build_deps[ansible_os_family] }}" - installed_files: "{{ pkgconfig.hyprcursor.build_installed_files }}" - git_path: "{{ d_tempdir.path }}/hyprcursor" + build_deps: "{{ srcconfig.hyprcursor.deps[ansible_os_family] }}" clean: "{{ pkgconfig_hyprland_clean | default(package_default_clean_src) }}" diff --git a/tasks/facts.yml b/tasks/facts.yml index 3de7584..cdd2d3f 100644 --- a/tasks/facts.yml +++ b/tasks/facts.yml @@ -40,6 +40,7 @@ pipx_exec: "/usr/bin/pipx" sys_pkg_become: true # Linux package managers require sudo access lib_path: lib64 + root_prefix: /usr/local - name: Set alpine linux specific facts when: diff --git a/tasks/helpers/clean_install.yml b/tasks/helpers/clean_install.yml new file mode 100644 index 0000000..cdda8f8 --- /dev/null +++ b/tasks/helpers/clean_install.yml @@ -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 }}" diff --git a/tasks/helpers/cmake_build.yml b/tasks/helpers/cmake_build.yml index e3bd32c..bd6d2a7 100644 --- a/tasks/helpers/cmake_build.yml +++ b/tasks/helpers/cmake_build.yml @@ -2,18 +2,18 @@ --- - name: Configure {{ repo.git_path }} ansible.builtin.command: - creates: "{{ repo.git_path }}/build" - chdir: "{{ repo.git_path }}" - argv: "{{ repo.build.configure }}" + creates: "{{ src_path }}/build" + chdir: "{{ src_path }}" + argv: "{{ configure }}" - name: Build {{ repo.git_path }} ansible.builtin.command: - creates: "{{ repo.git_path }}/{{ repo.build.creates }}" - chdir: "{{ repo.git_path }}" - argv: "{{ repo.build.build }}" + creates: "{{ build_creates }}" + chdir: "{{ src_path }}" + argv: "{{ build }}" - name: Install {{ repo.git_push }} - ansible.buitlin.command: - creates: "{{ repo.prefix }}/{{ repo.build.installs }}" - chdir: "{{ repo.git_path }}" - argv: "{{ repo.build.install }}" + ansible.builtin.command: + creates: "{{ install_creates }}" + chdir: "{{ src_path }}" + argv: "{{ install }}" diff --git a/tasks/helpers/git.yml b/tasks/helpers/git.yml index 31e49b9..e909813 100644 --- a/tasks/helpers/git.yml +++ b/tasks/helpers/git.yml @@ -1,7 +1,7 @@ -- name: Clone git repository {{ repo.repo }} +- name: Clone git repository {{ src_pkg }} ansible.builtin.git: depth: 1 force: true - dest: "{{ repo.git_path }}" - repo: "{{ repo.repo }}" - version: "{{ repo.version | default(omit) }}" + dest: "{{ src_path }}" + repo: "{{ src_gitrepo }}" + version: "{{ src_version | default(omit) }}" diff --git a/tasks/main.yml b/tasks/main.yml index 8ab82e6..63a9700 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -62,8 +62,16 @@ ansible.builtin.debug: var: pkgconfig -- name: End playbook - ansible.builtin.meta: end_play +- name: Read default package configuration + ansible.builtin.include_vars: + dir: src + extensions: + - yml + name: srcconfig + +- name: Dump srcconfig + ansible.builtin.debug: + var: srcconfig - name: Generate package installation lists loop: "{{ packages | unique }}" diff --git a/tasks/src/aquamarine.yml b/tasks/src/aquamarine.yml index 76bdf80..ea49478 100644 --- a/tasks/src/aquamarine.yml +++ b/tasks/src/aquamarine.yml @@ -3,13 +3,10 @@ - name: Remove existing install {{ pkg }} when: - aquamarine.clean - become: true - loop: "{{ aquamarine.installed_files }}" - loop_control: - loop_var: file - ansible.builtin.file: - state: absent - path: "{{ hyprland.prefix }}/{{ file }}" + vars: + file_list: "{{ srcconfig.aquamarine.build_installed_files }}" + ansible.builtin.include_tasks: + files: helpers/clean_install.yml - name: Check for installed {{ pkg }} register: stat_aquamarine_inst @@ -22,7 +19,10 @@ block: - name: Do repo clone {{ pkg }} 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: file: helpers/git.yml @@ -37,6 +37,11 @@ - name: Do build and install {{ pkg }} 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: file: helpers/cmake_build.yml diff --git a/tasks/src/hyprcursor.yml b/tasks/src/hyprcursor.yml index ed3c22c..1382938 100644 --- a/tasks/src/hyprcursor.yml +++ b/tasks/src/hyprcursor.yml @@ -3,13 +3,10 @@ - name: Remove existing install of {{ pkg }} when: - hyprcursor.clean - become: true - loop: "{{ hyprcursor.installed_files }}" - loop_control: - loop_var: file - ansible.builtin.file: - state: absent - path: "{{ hyprland.prefix }}/{{ file }}" + vars: + file_list: "{{ srcconfig.hyprcursor.build_installed_files }}" + ansible.builtin.include_tasks: + file: helpers/clean_install.yml - name: Check for installed {{ pkg }} register: stat_hyprcursor_inst @@ -20,49 +17,22 @@ when: - not stat_hyprcursor_inst.stat.exists block: - - name: Clone git repository {{ pkg }} - ansible.builtin.git: - depth: 1 - force: true - dest: "{{ hyprcursor.git_path }}" - repo: "{{ hyprcursor.repo }}" - version: "{{ hyprcursor.vers }}" + - name: Do repo clone {{ pkg }} + vars: + src_pkg: hyprcursor + src_path: "{{ srcconfig.hyprcursor.src_path }}" + src_gitrepo: "{{ srcconfig.hyprcursor.gitrepo }}" + src_version: "{{ hyprcursor.vers }}" + ansible.builtin.include_tasks: + file: helpers/git.yml - - name: Configure {{ pkg }} - ansible.builtin.command: - creates: "{{ hyprcursor.git_path }}/build" - chdir: "{{ hyprcursor.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: "{{ 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 + - name: CMake build and install {{ pkg }} + vars: + src_path: "{{ srcconfig.hyprcursor.src_path }}" + configure: "{{ srcconfig.hyprcursor.configure }}" + build_creates: "{{ srcconfig.hyprcursor.build_creates }}" + build: "{{ srcconfig.hyprcursor.build }}" + install_creates: "{{ srcconfig.hyprcursor.install_creates }}" + install: "{{ srcconfig.hyprcursor.install }}" + ansible.builtin.include_tasks: + file: helpers/cmake_build.yml diff --git a/vars/pkgs/alacritty.yml b/vars/pkgs/alacritty.yml index 7ea211d..527360b 100644 --- a/vars/pkgs/alacritty.yml +++ b/vars/pkgs/alacritty.yml @@ -8,27 +8,3 @@ alacritty: cargo: locked: true 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 diff --git a/vars/pkgs/aquamarine.yml b/vars/pkgs/aquamarine.yml index 296f75c..4211d78 100644 --- a/vars/pkgs/aquamarine.yml +++ b/vars/pkgs/aquamarine.yml @@ -2,64 +2,6 @@ --- aquamarine: version: v0.8.0 - repo: "{{ hyprgitbase }}/aquamarine" pkg_deps: - hyprwayland_scanner - 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" diff --git a/vars/pkgs/hyprcursor.yml b/vars/pkgs/hyprcursor.yml index 72da5b7..21f8bb5 100644 --- a/vars/pkgs/hyprcursor.yml +++ b/vars/pkgs/hyprcursor.yml @@ -2,26 +2,5 @@ --- hyprcursor: version: v0.1.12 - repo: "{{ hyprgitbase }}/hyprcursor" pkg_deps: - 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" diff --git a/vars/pkgs/hyprgraphics.yml b/vars/pkgs/hyprgraphics.yml index 6d77c4e..32fc1f4 100644 --- a/vars/pkgs/hyprgraphics.yml +++ b/vars/pkgs/hyprgraphics.yml @@ -5,30 +5,3 @@ hyprgraphics: repo: "{{ hyprgitbase }}/hyprgraphics" pkg_deps: - 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" diff --git a/vars/src/alacritty.yml b/vars/src/alacritty.yml new file mode 100644 index 0000000..fa7b7a7 --- /dev/null +++ b/vars/src/alacritty.yml @@ -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 diff --git a/vars/src/aquamarine.yml b/vars/src/aquamarine.yml new file mode 100644 index 0000000..f9bb8f1 --- /dev/null +++ b/vars/src/aquamarine.yml @@ -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" diff --git a/vars/src/hyprcursor.yml b/vars/src/hyprcursor.yml new file mode 100644 index 0000000..d14d625 --- /dev/null +++ b/vars/src/hyprcursor.yml @@ -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" diff --git a/vars/src/hyrpgraphics.yml b/vars/src/hyrpgraphics.yml new file mode 100644 index 0000000..1770e6e --- /dev/null +++ b/vars/src/hyrpgraphics.yml @@ -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"