diff --git a/tasks/config/neovim.yml b/tasks/config/neovim.yml index 93dc93f..2ed4aac 100644 --- a/tasks/config/neovim.yml +++ b/tasks/config/neovim.yml @@ -24,7 +24,7 @@ git_repo: "{{ pkgconfig.neovim.git_repo }}" git_path: "{{ d_tempdir.path }}/neovim" build_type: "{{ pkgconfig.neovim.build_type }}" - clean: "{{ pkgconfig.neovim.clean_install }}" + clean: "{{ pkgconfig_neovim.clean | default(default.clean_src) }}" installed_files: "{{ pkgconfig.neovim.build_installed_files }}" - name: Set neovim config for appimage install diff --git a/tasks/config/nwg_hello.yml b/tasks/config/nwg_hello.yml index f5e1516..bad2ebc 100644 --- a/tasks/config/nwg_hello.yml +++ b/tasks/config/nwg_hello.yml @@ -6,4 +6,4 @@ installed_files: "{{ pkgconfig.nwg_hello.build_installed_files }}" git_path: "{{ d_tempdir.path }}/nwg-hello" build_deps: "{{ pkgconfig.nwg_hello.bulid_deps[ansible_os_family] }}" - clean: "{{ pkgconfig.nwg_hello.clean | default(false) }}" + clean: "{{ pkgconfig_nwg_hello_clean | default(default.clean_src) }}" diff --git a/tasks/config/sdbus_cpp_2.yml b/tasks/config/sdbus_cpp_2.yml index 53f1dce..311df1f 100644 --- a/tasks/config/sdbus_cpp_2.yml +++ b/tasks/config/sdbus_cpp_2.yml @@ -6,4 +6,4 @@ 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 }}" + clean: "{{ pkgconfig_sdbus_cpp_2_clean | default(default.clean_src) }}" diff --git a/tasks/config/uwsm.yml b/tasks/config/uwsm.yml index d8adadd..f2517a2 100644 --- a/tasks/config/uwsm.yml +++ b/tasks/config/uwsm.yml @@ -5,3 +5,6 @@ repo: "{{ pkgconfig.uwsm.repo }}" build_deps: "{{ pkgconfig.uwsm.build_deps[ansible_os_family] }}" deps: "{{ pkgconfig.uwsm.deps[ansible_os_family] }}" + clean: "{{ pkgconfig_uwsm_clean | default(default.clean_src) }}" + installed_files: "{{ pkgconfig.uwsm.build_installed_files }}" + prefix: "/usr/local" diff --git a/tasks/src/neovide.yml b/tasks/src/neovide.yml index 37f2b41..fa5ea00 100644 --- a/tasks/src/neovide.yml +++ b/tasks/src/neovide.yml @@ -1,24 +1,47 @@ # vim: set filetype=yaml.ansible : --- -- name: Ensure directories exist - ansible.builtin.file: - state: directory - path: "{{ pkgconfig_neovide.install_prefix }}/{{ _dir }}" - become: true - loop: - - share/icons - - share/applications +- name: Remove existing install {{ pkg }} + when: + - neovide.clean + become: "{{ ext_become }}" + loop: "{{ neovide.installed_files }}" loop_control: - loop_var: _dir + loop_var: file + ansible.builtin.file: + state: absent + path: "{{ path.prefix }}/{{ file }}" -- name: Copy neovide icon - become: true - ansible.builtin.copy: - src: neovide/icon.png - dest: "{{ pkgconfig_neovide.install_prefix }}/share/icons/neovide.png" +- name: Check for installed {{ pkg }} + register: stat_neovide_inst + ansible.builtin.stat: + path: "{{ path.bin }}/neovide" -- name: Copy neovide.desktop - become: true - ansible.builtin.template: - src: neovide/neovide.desktop - dest: "{{ pkgconfig_neovide.install_prefix }}/share/applications/neovide.desktop" +- name: Build and install {{ pkg }} + when: + - not state_neovide_inst.stat.exists + block: + - name: Ensure directories exist + become: true + loop: + - share/icons + - share/applications + loop_control: + loop_var: _dir + ansible.builtin.file: + state: directory + path: "{{ path.prefix }}/{{ _dir }}" + mode: '0755' + + - name: Copy neovide icon + become: true + ansible.builtin.copy: + src: neovide/icon.png + dest: "{{ path.prefix }}/share/icons/neovide.png" + mode: '0644' + + - name: Copy neovide.desktop + become: true + ansible.builtin.template: + src: neovide/neovide.desktop + dest: "{{ path.prefix }}/share/applications/neovide.desktop" + mode: '0644' diff --git a/tasks/src/neovim.yml b/tasks/src/neovim.yml index 203784b..b6ad8c0 100644 --- a/tasks/src/neovim.yml +++ b/tasks/src/neovim.yml @@ -1,10 +1,10 @@ # vim: set filetype=yaml.ansible : --- - name: Clean existing install - become: "{{ ext_become }}" when: - neovim.installed_files is defined - neovim.clean + become: "{{ ext_become }}" loop: "{{ neovim.installed_files }}" loop_control: loop_var: file @@ -28,7 +28,7 @@ repo: "{{ neovim.git_repo }}" version: "{{ neovim.vers }}" recursive: true - + - name: Build and install neovim become: "{{ ext_become }}" community.general.make: diff --git a/tasks/src/uwsm.yml b/tasks/src/uwsm.yml index 92990ac..ab3ba4e 100644 --- a/tasks/src/uwsm.yml +++ b/tasks/src/uwsm.yml @@ -1,30 +1,52 @@ -- name: Clone git repository {{ pkg }} - ansible.builtin.git: - depth: 1 - dest: "{{ d_tempdir.path }}/uwsm" - repo: "{{ uwsm.repo }}" - version: "v{{ uwsm.vers }}" - -- name: Build {{ pkg }} - ansible.builtin.command: - creates: "{{ d_tempdir.path }}/uwsm/build" - chdir: "{{ d_tempdir.path }}/uwsm" - argv: - - meson - - setup - - --prefix={{ hyprland.prefix }} - - -Duuctl=enabled - - -Dfumon=enabled - - -Duwsm-app=enabled - - build - -- name: Install {{ pkg }} +# vim: set filetype=yaml.ansible : +--- +- name: Remove existing install {{ pkg }} + when: + - uwsm.clean become: true - ansible.builtin.command: - creates: "{{ hyprland.prefix }}/bin/uwsm" - chdir: "{{ d_tempdir.path }}/uwsm" - argv: - - meson - - install - - -C - - build + loop: "{{ uwsm.installed_files }}" + loop_control: + loop_var: file + ansible.builtin.file: + state: absent + path: "{{ file }}" + +- name: Check for installed {{ pkg }} + register: stat_uwsm_inst + ansible.builtin.stat: + path: "{{ uwsm.prefix }}" + +- name: Build and install {{ uwsm }} + when: + - not stat_uwsm_inst.stat.exists + block: + - name: Clone git repository {{ pkg }} + ansible.builtin.git: + depth: 1 + dest: "{{ d_tempdir.path }}/uwsm" + repo: "{{ uwsm.repo }}" + version: "v{{ uwsm.vers }}" + + - name: Build {{ pkg }} + ansible.builtin.command: + creates: "{{ d_tempdir.path }}/uwsm/build" + chdir: "{{ d_tempdir.path }}/uwsm" + argv: + - meson + - setup + - --prefix={{ uwsm.prefix }} + - -Duuctl=enabled + - -Dfumon=enabled + - -Duwsm-app=enabled + - build + + - name: Install {{ pkg }} + become: true + ansible.builtin.command: + creates: "{{ uwsm.prefix }}/bin/uwsm" + chdir: "{{ d_tempdir.path }}/uwsm" + argv: + - meson + - install + - -C + - build diff --git a/vars/pkgs/ghostty.yml b/vars/pkgs/ghostty.yml index 2870d0c..b7aeb34 100644 --- a/vars/pkgs/ghostty.yml +++ b/vars/pkgs/ghostty.yml @@ -1,6 +1,5 @@ ghostty: - clean_install: false - version: v1.1.2 + version: v1.1.3 optimize: ReleaseFast git_repo: https://github.com/ghostty-org/ghostty pkg_deps: diff --git a/vars/pkgs/uwsm.yml b/vars/pkgs/uwsm.yml index 40c465a..b6713ab 100644 --- a/vars/pkgs/uwsm.yml +++ b/vars/pkgs/uwsm.yml @@ -15,3 +15,8 @@ uwsm: - newt - wofi - libnotify + build_installed_files: + - bin/uwsm + - share/uwsm + - share/doc/uwsm + - share/licenses/uwsm