From d58ea8dafede083a7e1dccc7dc25b64efc6a51a4 Mon Sep 17 00:00:00 2001 From: Matthew Stobbs Date: Sun, 2 Mar 2025 16:10:51 -0700 Subject: [PATCH] add the rest of hyprland deps --- tasks/config/hyprland_protocols.yml | 8 +++ tasks/config/sdbus_cpp_2.yml | 9 +++ tasks/config/xdg_desktop_portal_hyprland.yml | 8 +++ tasks/pkgs/hyprland_protocols.yml | 4 ++ tasks/pkgs/sdbus_cpp_2.yml | 4 ++ tasks/pkgs/xdg_desktop_portal_hyprland.yml | 13 ++++ tasks/src/hyprland_protocols.yml | 48 ++++++++++++++ tasks/src/hyprlang.yml | 2 +- tasks/src/sdbus_cpp_2.yml | 66 ++++++++++++++++++++ tasks/src/xdg_desktop_portal_hyprland.yml | 63 +++++++++++++++++++ vars/pkgs/hyprland_protocols.yml | 17 +++++ vars/pkgs/sdbus_cpp_2.yml | 43 +++++++++++++ vars/pkgs/xdg_desktop_portal_hyprland.yml | 25 ++++++++ 13 files changed, 309 insertions(+), 1 deletion(-) create mode 100644 tasks/config/hyprland_protocols.yml create mode 100644 tasks/config/sdbus_cpp_2.yml create mode 100644 tasks/config/xdg_desktop_portal_hyprland.yml create mode 100644 tasks/pkgs/hyprland_protocols.yml create mode 100644 tasks/pkgs/sdbus_cpp_2.yml create mode 100644 tasks/pkgs/xdg_desktop_portal_hyprland.yml create mode 100644 tasks/src/hyprland_protocols.yml create mode 100644 tasks/src/sdbus_cpp_2.yml create mode 100644 tasks/src/xdg_desktop_portal_hyprland.yml create mode 100644 vars/pkgs/hyprland_protocols.yml create mode 100644 vars/pkgs/sdbus_cpp_2.yml create mode 100644 vars/pkgs/xdg_desktop_portal_hyprland.yml diff --git a/tasks/config/hyprland_protocols.yml b/tasks/config/hyprland_protocols.yml new file mode 100644 index 0000000..ac5d9a4 --- /dev/null +++ b/tasks/config/hyprland_protocols.yml @@ -0,0 +1,8 @@ +- name: Set hyperland-protocols config + ansible.builtin.set_fact: + hyprland_protocols: + vers: "{{ pkgconfig.hyprland_protocols.version }}" + repo: "{{ pkgconfig.hyprland_protocols.repo }}" + build_deps: "{{ pkgconfig.hyprland_protocols.build_deps[ansible_os_family] }}" + installed_files: "{{ pkgconfig.hyprland_protocols.build_installed_files }}" + git_path: "{{ d_tempdir.path }}/hyperland-protocols" diff --git a/tasks/config/sdbus_cpp_2.yml b/tasks/config/sdbus_cpp_2.yml new file mode 100644 index 0000000..53f1dce --- /dev/null +++ b/tasks/config/sdbus_cpp_2.yml @@ -0,0 +1,9 @@ +- name: Set sdbus-cpp-2 config + ansible.builtin.set_fact: + sdbus_cpp_2: + vers: "{{ pkgconfig.sdbus_cpp_2.version }}" + repo: "{{ pkgconfig.sdbus_cpp_2.repo }}" + build_deps: "{{ pkgconfig.sdbus_cpp_2.build_deps[ansible_os_family] }}" + git_path: "{{ d_tempdir.path }}/sdbus-cpp" + prefix: "/usr/local" + clean: "{{ pkgconfig.sdbus_cpp_2.clean }}" diff --git a/tasks/config/xdg_desktop_portal_hyprland.yml b/tasks/config/xdg_desktop_portal_hyprland.yml new file mode 100644 index 0000000..44d31cc --- /dev/null +++ b/tasks/config/xdg_desktop_portal_hyprland.yml @@ -0,0 +1,8 @@ +- name: Set xdg-desktop-portal-hyprland config + ansible.builtin.set_fact: + xdg_desktop_portal_hyprland: + vers: "{{ pkgconfig.xdg_desktop_portal_hyprland.version }}" + repo: "{{ pkgconfig.xdg_desktop_portal_hyprland.repo }}" + pkg_deps: "{{ pkgconfig.xdg_desktop_portal_hyprland.pkg_deps }}" + build_deps: "{{ pkgconfig.xdg_desktop_portal_hyprland.build_deps[ansible_os_family] }}" + diff --git a/tasks/pkgs/hyprland_protocols.yml b/tasks/pkgs/hyprland_protocols.yml new file mode 100644 index 0000000..8203b95 --- /dev/null +++ b/tasks/pkgs/hyprland_protocols.yml @@ -0,0 +1,4 @@ +- name: Append to pkg lists + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + hyprland_protocols.build_deps }}" + pkg_src: "{{ pkg_src + ['hyprland_protocols'] }}" diff --git a/tasks/pkgs/sdbus_cpp_2.yml b/tasks/pkgs/sdbus_cpp_2.yml new file mode 100644 index 0000000..a97a75d --- /dev/null +++ b/tasks/pkgs/sdbus_cpp_2.yml @@ -0,0 +1,4 @@ +- name: Append to pkg list + ansible.builtin.set_fact: + pkg_sys: "{{ pkg_sys + sdbus_cpp_2.build_deps }}" + pkg_src: "{{ pkg_src + ['sdbus_cpp_2'] }}" diff --git a/tasks/pkgs/xdg_desktop_portal_hyprland.yml b/tasks/pkgs/xdg_desktop_portal_hyprland.yml new file mode 100644 index 0000000..8e245c1 --- /dev/null +++ b/tasks/pkgs/xdg_desktop_portal_hyprland.yml @@ -0,0 +1,13 @@ +- name: Ensure pkg_deps are added + loop: "{{ xdg_desktop_portal_hyprland.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_sys: "{{ pkg_sys + xdg_desktop_portal_hyprland.build_deps }}" + pkg_src: "{{ pkg_src + ['xdg_desktop_portal_hyprland'] }}" diff --git a/tasks/src/hyprland_protocols.yml b/tasks/src/hyprland_protocols.yml new file mode 100644 index 0000000..6f5a84b --- /dev/null +++ b/tasks/src/hyprland_protocols.yml @@ -0,0 +1,48 @@ +- name: Remove existing install + when: + - hyprland_protocols.clean + become: true + loop: "{{ hyprland_protocols.installed_files }}" + loop_control: + loop_var: file + ansible.builtin.file: + state: absent + path: "{{ hyprland_protocols.prefix }}/{{ file }}" + +- name: Check if hyprland-protocols is installed + register: stat_hyprland_protocols_inst + ansible.builtin.stat: + path: "{{ hyprland_protocols.prefix }}/share/hyprland-protocols/protocols/hyprland-ctm-control-v1.xml" + +- name: Build and install hyprland-protocols + when: + - not stat_hyprland_protocols_inst.stat.exists + block: + - name: Clone git repository + ansible.builtin.git: + depth: 1 + recursive: true + dest: "{{ hyprland_protocols.git_path }}" + repo: "{{ hyprland_protocols.repo }}" + version: "{{ hyprland_protocols.vers }}" + + - name: Build hyprland-protocols + ansible.builtin.command: + creates: "{{ hyprland_protocols.git_path }}/build/build.ninja" + chdir: "{{ hyprland_protocols.git_path }}" + argv: + - meson + - setup + - --prefix={{ hyrpland.prefix }} + - build + + - name: Install hyprland-protocols + become: true + ansible.builtin.command: + creates: "{{ hyprland_protocols.prefix }}/share/hyprland-protocols/protocols/hyprland-ctm-control-v1.xml" + chdir: "{{ hyprland_protocols.git_path }}" + argv: + - meson + - install + - -C + - build diff --git a/tasks/src/hyprlang.yml b/tasks/src/hyprlang.yml index aa8a7af..ad774e0 100644 --- a/tasks/src/hyprlang.yml +++ b/tasks/src/hyprlang.yml @@ -1,7 +1,7 @@ - name: Remove existing install when: - hyprland_clean - become: "{{ ext_become }}" + become: true loop: "{{ hyprlang.installed_files }}" loop_control: loop_var: file diff --git a/tasks/src/sdbus_cpp_2.yml b/tasks/src/sdbus_cpp_2.yml new file mode 100644 index 0000000..7e82263 --- /dev/null +++ b/tasks/src/sdbus_cpp_2.yml @@ -0,0 +1,66 @@ +- name: Remove existing install + when: + - sdbus_cpp_2.clean + become: true + loop: "{{ sdbus_cpp_2.installed_files }}" + loop_control: + loop_var: file + ansible.builtin.file: + state: absent + path: "{{ sdbus_cpp_2.prefix }}/{{ file }}" + +- name: Check if sdbus-cpp-2 is installed + register: stat_sdbus_cpp_2_inst + ansible.builtin.stat: + path: "{{ sdbus_cpp_2.prefix }}/lib64/libsdbus-c++.so" + +- name: Build and install sdbus-cpp-2 + when: + - not stat_sdbus_cpp_2_inst.stat.exists + block: + - name: Clone git repository + ansible.builtin.git: + depth: 1 + recursive: true + dest: "{{ sdbus_cpp_2.git_path }}" + repo: "{{ sdbus_cpp_2.repo }}" + version: "{{ sdbus_cpp_2.vers }}" + + - name: Configure sdbus-cpp-2 + ansible.builtin.command: + creates: "{{ sdbus_cpp_2.git_path }}/build" + chdir: "{{ sdbus_cpp_2.git_path }}" + argv: + - cmake + - --no-warn-unused-cli + - -DCMAKE_BUILD_TYPE=Release + - -dDCMAKE_INSTALL_PREFIX={{ sdbus_cpp_2.prefix }} + - -S + - . + - -B + - ./build + + - name: Build sdbus-cpp-2 + ansible.builtin.command: + creates: "{{ sdbus_cpp_2.git_path }}/build/Makefile" + chdir: "{{ sdbus_cpp_2.git_path }}" + argv: + - cmake + - --build + - ./build + - --config + - Release + - --target + - all + - -j + - "{{ ansible_processor_nproc|int }}" + + - name: Install sdbus_cpp_2 + become: true + ansible.builtin.command: + creates: "{{ sdbus_cpp_2.prefix }}/lib64/libsdbus-c++.so" + chdir: "{{ sdbus_cpp_2.git_path }}" + argv: + - cmake + - --install + - ./build diff --git a/tasks/src/xdg_desktop_portal_hyprland.yml b/tasks/src/xdg_desktop_portal_hyprland.yml new file mode 100644 index 0000000..92fde9d --- /dev/null +++ b/tasks/src/xdg_desktop_portal_hyprland.yml @@ -0,0 +1,63 @@ +- name: Remove existing install + when: + - hyprland_clean + become: "{{ ext_become }}" + loop: "{{ xdg_desktop_portal_hyprland.installed_files }}" + loop_control: + loop_var: file + ansible.builtin.file: + state: absent + path: "{{ hyprland.prefix }}/{{ file }}" + +- name: Check if xdg_desktop_portal_hyprland is installed + register: stat_xdg_desktop_portal_hyprland_bin + ansible.builtin.stat: + path: "{{ hyprland.prefix }}/bin/hyprland-share-picker" + +- name: Build and install xdg_desktop_portal_hyprland + when: + - not stat_xdg_desktop_portal_hyprland_bin.stat.exists + block: + - name: Clone git repository + ansible.builtin.git: + depth: 1 + dest: "{{ xdg_desktop_portal_hyprland.git_path }}" + recursive: true + repo: "{{ xdg_desktop_portal_hyprland.repo }}" + version: "{{ xdg_desktop_portal_hyprland.vers }}" + + - name: Configure xdg_desktop_portal_hyprland + ansible.builtin.command: + creates: "{{ xdg_desktop_portal_hyprland.git_path }}/build" + chdir: "{{ xdg_desktop_portal_hyprland.git_path }}" + argv: + - cmake + - -DCMAKE_INSTALL_LIBEXECDIR={{ hyprland.prefix }}/lib + - -DCMAKE_INSTALL_PREFIX={{ hyprland.prefix }} + - -B + - ./build + + - name: Build xdg_desktop_portal_hyprland + ansible.builtin.command: + creates: "{{ xdg_desktop_portal_hyprland.git_path }}/build/xdg-desktop-portal-hyprland" + chdir: "{{ xdg_desktop_portal_hyprland.git_path }}" + argv: + - cmake + - --build + - ./build + - --config + - Release + - --target + - all + - -j + - "{{ ansible_processor_nproc|int }}" + + - name: Install xdg_desktop_portal_hyprland + become: true + ansible.builtin.command: + creates: "{{ path.bin }}/hyprland-share-picker" + chdir: "{{ xdg_desktop_portal_hyprland.git_path }}" + argv: + - cmake + - --install + - ./build diff --git a/vars/pkgs/hyprland_protocols.yml b/vars/pkgs/hyprland_protocols.yml new file mode 100644 index 0000000..6f11d22 --- /dev/null +++ b/vars/pkgs/hyprland_protocols.yml @@ -0,0 +1,17 @@ +hyprland_protocols: + version: v0.6.2 + repo: "{{ hyprgitbase }}/hyperland-protocols" + build_deps: + RedHat: + - meson + - ninja-build + build_installed_files: + - share/hyprland-protocols/protocols + - share/hyprland-protocols/protocols/hyprland-ctm-control-v1.xml + - share/hyprland-protocols/protocols/hyprland-focus-grab-v1.xml + - share/hyprland-protocols/protocols/hyprland-global-shortcuts-v1.xml + - share/hyprland-protocols/protocols/hyprland-lock-notify-v1.xml + - share/hyprland-protocols/protocols/hyprland-surface-v1.xml + - share/hyprland-protocols/protocols/hyprland-toplevel-export-v1.xml + - share/hyprland-protocols + - share/pkgconfig/hyprland-protocols.pc diff --git a/vars/pkgs/sdbus_cpp_2.yml b/vars/pkgs/sdbus_cpp_2.yml new file mode 100644 index 0000000..121bd34 --- /dev/null +++ b/vars/pkgs/sdbus_cpp_2.yml @@ -0,0 +1,43 @@ +sdbus_cpp_2: + clean: false + version: v2.1.0 + repo: https://github.com/Kistler-Group/sdbus-cpp + build_deps: + RedHat: + - systemd-devel + build_installed_files: + - share/doc/sdbus-c++/sdbus-c++-class-diagram.png + - share/doc/sdbus-c++/sdbus-c++-class-diagram.uml + - share/doc/sdbus-c++/systemd-dbus-config.md + - share/doc/sdbus-c++/using-sdbus-c++.md + - lib64/libsdbus-c++.so.2.0.0 + - lib64/libsdbus-c++.so.2 + - lib64/libsdbus-c++.so + - include/sdbus-c++/ConvenienceApiClasses.h + - include/sdbus-c++/ConvenienceApiClasses.inl + - include/sdbus-c++/VTableItems.h + - include/sdbus-c++/VTableItems.inl + - include/sdbus-c++/Error.h + - include/sdbus-c++/IConnection.h + - include/sdbus-c++/AdaptorInterfaces.h + - include/sdbus-c++/ProxyInterfaces.h + - include/sdbus-c++/StandardInterfaces.h + - include/sdbus-c++/IObject.h + - include/sdbus-c++/IProxy.h + - include/sdbus-c++/Message.h + - include/sdbus-c++/MethodResult.h + - include/sdbus-c++/Types.h + - include/sdbus-c++/TypeTraits.h + - include/sdbus-c++/Flags.h + - include/sdbus-c++/sdbus-c++.h + - lib64/cmake/sdbus-c++/sdbus-c++-targets.cmake + - lib64/cmake/sdbus-c++/sdbus-c++-targets-release.cmake + - lib64/cmake/sdbus-c++/sdbus-c++-config.cmake + - lib64/cmake/sdbus-c++/sdbus-c++-config-version.cmake + - lib64/pkgconfig/sdbus-c++.pc + - share/doc/sdbus-c++/README + - share/doc/sdbus-c++/README.md + - share/doc/sdbus-c++/NEWS + - share/doc/sdbus-c++/COPYING + - share/doc/sdbus-c++/ChangeLog + - share/doc/sdbus-c++/AUTHORS diff --git a/vars/pkgs/xdg_desktop_portal_hyprland.yml b/vars/pkgs/xdg_desktop_portal_hyprland.yml new file mode 100644 index 0000000..003e10b --- /dev/null +++ b/vars/pkgs/xdg_desktop_portal_hyprland.yml @@ -0,0 +1,25 @@ +xdg_desktop_portal_hyprland: + version: v1.3.9 + repo: "{{ hyprgitbase }}/xdg-desktop-portal-hyprland" + pkg_deps: + - git + - sdbus_cpp_2 + - hyprlang + - hyprutils + - hyprwayland_scanner + - hyprland + build_deps: + RedHat: + - libdrm-devel + - mesa-libgbm-devel + - pipewire-devel + - pipewire-libs + - sdbus-cpp-devel + - wayland-devel + - wayland-protocols-devel + build_installed_files: + - bin/hyprland-share-picker + - lib/xdg-desktop-portal-hyprland + - share/xdg-desktop-portal/portals/hyprland.portal + - share/dbus-1/services/org.freedesktop.impl.portal.desktop.hyprland.service + - lib/systemd/user/xdg-desktop-portal-hyprland.service