From 91cdc5056c16c47bdd57a6908ad495caaf4a00f3 Mon Sep 17 00:00:00 2001 From: Matthew Stobbs Date: Fri, 28 Feb 2025 15:57:02 -0700 Subject: [PATCH] adding hyprland src install --- tasks/config/aquamarine.yml | 9 +++++ tasks/config/hyprwayland_scanner.yml | 6 ++++ tasks/pkgs/aquamarine.yml | 12 +++++++ tasks/pkgs/hyprwayland_scanner.yml | 6 ++++ tasks/src/aquamarine.yml | 50 ++++++++++++++++++++++++++++ tasks/src/hyprwayland_scanner.yml | 50 ++++++++++++++++++++++++++++ vars/main.yml | 3 ++ vars/pkgs/aquamarine.yml | 16 +++++++++ vars/pkgs/hyprland.yml | 29 ++++++++++++++++ vars/pkgs/hyprwayland_scanner.yml | 10 ++++++ 10 files changed, 191 insertions(+) create mode 100644 tasks/config/aquamarine.yml create mode 100644 tasks/config/hyprwayland_scanner.yml create mode 100644 tasks/pkgs/aquamarine.yml create mode 100644 tasks/pkgs/hyprwayland_scanner.yml create mode 100644 tasks/src/aquamarine.yml create mode 100644 tasks/src/hyprwayland_scanner.yml create mode 100644 vars/pkgs/aquamarine.yml create mode 100644 vars/pkgs/hyprland.yml create mode 100644 vars/pkgs/hyprwayland_scanner.yml diff --git a/tasks/config/aquamarine.yml b/tasks/config/aquamarine.yml new file mode 100644 index 0000000..1305bd5 --- /dev/null +++ b/tasks/config/aquamarine.yml @@ -0,0 +1,9 @@ +- 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 diff --git a/tasks/config/hyprwayland_scanner.yml b/tasks/config/hyprwayland_scanner.yml new file mode 100644 index 0000000..4cb2499 --- /dev/null +++ b/tasks/config/hyprwayland_scanner.yml @@ -0,0 +1,6 @@ +- name: Set hyperwayland-scanner config + ansible.builtin.set_fact: + hyprwayland_scanner: + vers: "{{ pkgconfig.hyprwayland_scanner.version }}" + repo: "{{ pkgconfig.hyprwayland_scanner.repo }}" + build_deps: "{{ pkgconfig.hyprwayland_scanner.build_deps[ansible_os_family] }}" diff --git a/tasks/pkgs/aquamarine.yml b/tasks/pkgs/aquamarine.yml new file mode 100644 index 0000000..f476338 --- /dev/null +++ b/tasks/pkgs/aquamarine.yml @@ -0,0 +1,12 @@ +- name: Ensure pkg_deps are added + loop: aquamarine.pkg_deps + loop_control: + loop_var: pkg_dep + vars: + pkg: "{{ pkg_dep }}" + ansible.builtin.include_tasks: + file: addpkg.yml + +- name: Append to pkg_src + ansible.builtin.set_fact: + pkg_src: "{{ pkg_src + ['aquamarine'] }}" diff --git a/tasks/pkgs/hyprwayland_scanner.yml b/tasks/pkgs/hyprwayland_scanner.yml new file mode 100644 index 0000000..68a694e --- /dev/null +++ b/tasks/pkgs/hyprwayland_scanner.yml @@ -0,0 +1,6 @@ +- name: Append to pkg_sys and pkg_src + when: + - ansible_os_family == 'RedHat' + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + hyprwayland_scanner.build_deps }}" + pkg_src: "{{ pkg_src + ['hyprwayland_scanner'] }}" diff --git a/tasks/src/aquamarine.yml b/tasks/src/aquamarine.yml new file mode 100644 index 0000000..1c66097 --- /dev/null +++ b/tasks/src/aquamarine.yml @@ -0,0 +1,50 @@ +- name: Remove existing install + when: + - hyprland_clean + become: "{{ ext_become }}" + loop: aquamarine.installed_files + loop_control: + loop_var: file + ansible.builtin.file: + state: absent + path: "{{ path.prefix }}/{{ file }}" + +- name: Build and install aquamarine + block: + - name: Clone git repository + ansible.builtin.git: + depth: 1 + dest: "{{ aquamarine.git_path }}" + repo: "{{ aquamarine.repo }}" + version: "{{ aquamarine.vers }}" + + - name: Configure hyprwayland-scanner + ansible.builtin.command: + creates: "{{ aquamarine.git_path }}/build" + chdir: "{{ aquamarine.git_path }}" + argv: + - cmake + - -DCMAKE_INSTALL_PREFIX={{ path.prefix }} + - -B + - build + + - name: Build hyprwayland-scanner + ansible.builtin.command: + creates: "{{ aquamarine.git_path }}/build/" + chdir: "{{ aquamarine.git_path }}" + argv: + - cmake + - --build + - build + - -j + - "{{ ansible_processor_nproc|int }}" + + - name: Install hyprwayland-scanner + become: "{{ ext_become }}" + ansible.builtin.command: + creates: "{{ path.bin }}/aquamarine" + chdir: "{{ aquamarine.git_path }}" + argv: + - cmake + - --install + - build diff --git a/tasks/src/hyprwayland_scanner.yml b/tasks/src/hyprwayland_scanner.yml new file mode 100644 index 0000000..3640e5a --- /dev/null +++ b/tasks/src/hyprwayland_scanner.yml @@ -0,0 +1,50 @@ +- name: Remove existing install + when: + - hyprland_clean + become: "{{ ext_become }}" + loop: hyprwayland_scanner.installed_files + loop_control: + loop_var: file + ansible.builtin.file: + state: absent + path: "{{ path.prefix }}/{{ file }}" + +- name: Build and install hyprwayland-scanner + block: + - name: Clone git repository + ansible.builtin.git: + depth: 1 + dest: "{{ d_tempdir.path }}/hyprwayland-scanner" + repo: "{{ hyprwayland_scanner.repo }}" + version: "{{ hyprwayland_scanner.vers }}" + + - name: Configure hyprwayland-scanner + ansible.builtin.command: + creates: "{{ d_tempdir.path }}/hyprwayland-scanner/build" + chdir: "{{ d_tempdir.path }}/hyprwayland-scanner" + argv: + - cmake + - -DCMAKE_INSTALL_PREFIX={{ path.prefix }} + - -B + - build + + - name: Build hyprwayland-scanner + ansible.builtin.command: + creates: "{{ d_tempdir.path }}/hyprwayland-scanner/build/hyprwayland-scanner" + chdir: "{{ d_tempdir.path }}/hyprwayland-scanner" + argv: + - cmake + - --build + - build + - -j + - "{{ ansible_processor_nproc|int }}" + + - name: Install hyprwayland-scanner + become: "{{ ext_become }}" + ansible.builtin.command: + creates: "{{ path.bin }}/hyprwayland-scanner" + chdir: "{{ d_tempdir.path }}/hyprwayland-scanner" + argv: + - cmake + - --install + - build diff --git a/vars/main.yml b/vars/main.yml index a05766d..86ffd38 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -24,3 +24,6 @@ defaults: # - paths.cargo: $PREFIX/cargo # - paths.go: $PREFIX/go # - paths.pipx: $PREFIX/pipx + +## Extra config that usually will not need to be changed +hyprland_clean: true diff --git a/vars/pkgs/aquamarine.yml b/vars/pkgs/aquamarine.yml new file mode 100644 index 0000000..c1d5f5a --- /dev/null +++ b/vars/pkgs/aquamarine.yml @@ -0,0 +1,16 @@ +aquamarine: + version: v0.7.2 + repo: https://github.com/hyprwm/aquamarine + pkg_deps: + - hyprwayland-scanner + build_deps: + RedHat: + - libseat-devel + - libinput-devel + - wayland-devel + - wayland-protocols-devel + - libdrm-devel + - mesa-libgbm-devel + - libdisplay-info-devel + - systemd-devel + - hwdata-devel diff --git a/vars/pkgs/hyprland.yml b/vars/pkgs/hyprland.yml new file mode 100644 index 0000000..f40012c --- /dev/null +++ b/vars/pkgs/hyprland.yml @@ -0,0 +1,29 @@ +hyprland: + version: v0.47.2 + repo: https://github.com/hyprwm/Hyprland + pkg_deps: + - aquamarine + build_deps: + RedHat: + - cairo-devel + - cmake + - gcc-c++ + - glslang-devel + - libdrm-devel + - libglvnd-devel + - libinput-devel + - libseat-devel + - libxcb-devel + - libxkbcommon-devel + - mesa-libgbm-devel + - meson + - pango-devel + - pixman-devel + - systemd-devel + - tomlpluplus-devel + - vulkan-loader-devel + - wayland-devel + - wayland-protocols-devel + - xcb-util-renderutil-devel + - xcb-util-wm-devel + - xorg-x11-server-Xwayland-devel diff --git a/vars/pkgs/hyprwayland_scanner.yml b/vars/pkgs/hyprwayland_scanner.yml new file mode 100644 index 0000000..77d5ea8 --- /dev/null +++ b/vars/pkgs/hyprwayland_scanner.yml @@ -0,0 +1,10 @@ +hyprwayland_scanner: + version: v0.4.4 + repo: https://github.com/hyprwm/hyprwayland-scanner + build_deps: + RedHat: + - pugixml-devel + build_installed_files: + - bin/hyprwayland-scanner + - lib64/pkgconfig/hyprwayland-scanner.pc + - lib64/cmake/hyprwayland-scanner