working on go

Signed-off-by: Matthew Stobbs <matthew@stobbs.ca>
This commit is contained in:
Matthew Stobbs
2026-02-02 17:06:31 -07:00
parent b9fdf03298
commit 81a1dd7469
9 changed files with 237 additions and 147 deletions

View File

@@ -13,7 +13,7 @@ special handling.
Order of precedence for package installation: Order of precedence for package installation:
1. System package manager (dnf, apt, homebrew, etc.) 1. System package manager (dnf, apt, homebrew, etc.)
2. Source built - only in some situations, like for fast moving software (neovim) 2. Source built - only in some situations, like for fast moving software (neovim, hyprland)
3. Appimage (Linux only) 3. Appimage (Linux only)
4. Flatpak (Linux only) 4. Flatpak (Linux only)
5. Snap (Linux only), takes precedence over flatpak on Ubuntu based systems 5. Snap (Linux only), takes precedence over flatpak on Ubuntu based systems

View File

@@ -1,9 +1,17 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: Install go package {{ pkg }} - name: Install go packages
become: "{{ ext_become }}" become: "{{ install_become }}"
environment: environment:
GOBIN: "{{ path.bin }}" GOBIN: "{{ path_bin }}"
PATH: "{{ path.go }}/bin:$PATH" GOROOT: "{{ path_go }}"
PATH: "{{ path_go }}/bin:$PATH"
loop: pkg_go
loop_control:
loop_var: current
ansible.builtin.command: ansible.builtin.command:
cmd: go install {{ pkg }} creates: "{{ current.bin }}"
argv:
- go
- install
- "{{ current.url }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: Set air configuration # {{{ - name: Configure air # {{{
when: when:
- __air_configured is undefined or - __air_configured is undefined
not __air_configured
block: block:
- name: Set air install method - name: Set air install method
when: when:
@@ -11,21 +10,40 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
air_install_method: "{% if install_method in air_install_methods %}{{ install_method }}{% else %}{{ air_install_method[0] }}{% endif %}" air_install_method: "{% if install_method in air_install_methods %}{{ install_method }}{% else %}{{ air_install_method[0] }}{% endif %}"
- name: Set air version and url - name: Configure air source install
ansible.builtin.set_fact: when:
air_version: "{{ air_version | default('latest') }}" - air_install_method == 'source'
air_install_url: "{{ air_install_url | default('github.com/air-verse/air') }}" block:
- name: Set air install package - name: Set air install package
ansible.builtin.set_fact: ansible.builtin.set_fact:
air_pkg: "{{ air_install_url }}@{{ air_version }}" air_go_pkg:
url: "{{ air_install_url }}@{{ air_version }}"
bin: "{{ path_bin }}/air"
# }}}
- name: Append air to pkg_go
when:
- air_install_method == 'source'
block:
- name: Clean existing air install
when:
- clean_install
loop: air_build_files
loop_control:
lopo_var: air_file
ansible.builtin.file:
state: absent
path: "{{ install_prefix }}/{{ air_file }}"
- name: Configure pkg dependencies
loop: "{{ air_pkg_deps }}"
loop_control:
loop_var: air_pkg_dep
ansible.builtin.include_tasks: "{{ air_pkg_dep }}"
- name: Add air to install list
ansible.builtin.set_fact:
pkg_go: "{{ pkg_go + [air_go_pkg] }}"
- name: Complete air configuration - name: Complete air configuration
ansible.builtin.set_fact: ansible.builtin.set_fact:
__air_configured: true __air_configured: true
# }}}
- name: Append air to pkg_go
when:
- air_install_method == 'source'
ansible.builtin.set_fact:
pkg_go: "{{ pkg_go + [air_pkg] }}"

View File

@@ -2,29 +2,21 @@
--- ---
- name: Configure alacritty # {{{ - name: Configure alacritty # {{{
when: when:
- __alacritty_configured is undefined or - __alacritty_configured is undefined
not __alacritty_configured
block: block:
- name: Set install method - name: Set alacritty install method
when: when:
- alacritty_install_method is undefined - alacritty_install_method is undefined
ansible.builtin.set_fact: ansible.builtin.set_fact:
alacritty_install_method: "{% if default_install_method in alacritty_install_methods %}{{ default_install_method }}{% else %}{{ alacritty_install_methods[0] }}{% endif %}" alacritty_install_method: "{% if default_install_method in alacritty_install_methods %}{{ default_install_method }}{% else %}{{ alacritty_install_methods[0] }}{% endif %}"
- name: Set basic variables
ansible.builtin.set_fact:
alacritty_version: "{{ alacritty_version | default('v0.16.1') }}"
alacritty_git_repo: "{{ alacritty_git_repo | default('https://github.com/alacritty/alacritty') }}"
alacritty_pkgname: "{{ alacritty_pkgname | default('alacritty') }}"
alacritty_build_deps_extra: []
- name: Configure alacritty source install - name: Configure alacritty source install
when: when:
- alacritty_install_method == "source" - alacritty_install_method == "source"
ansible.builtin.set_fact: ansible.builtin.set_fact:
alacritty_build_deps: "{{ alacritty_build_deps[ansible_os_family] }}"
alacritty_src_install: alacritty_src_install:
cargo_build_flags: cargo_build_flags: "{{ alacritty_cargo_build_flags }}"
- --release
name: "{{ alacritty_pkgname }}" name: "{{ alacritty_pkgname }}"
repo: "{{ alacritty_git_repo }}" repo: "{{ alacritty_git_repo }}"
version: "{{ alacritty_version }}" version: "{{ alacritty_version }}"
@@ -35,55 +27,7 @@
extra/logo/alacritty-term.svg: share/pixmaps/Alacritty.svg extra/logo/alacritty-term.svg: share/pixmaps/Alacritty.svg
desktop_files: desktop_files:
- extra/linux/Alacritty.desktop - extra/linux/Alacritty.desktop
files_list: files_list: "{{ alacritty_build_files }}"
- bin/alacritty
- share/pixmaps/Alacritty.svg
alacritty_build_deps:
RedHat:
- cmake
- fontconfig-devel
- freetype-devel
- g++
- libxcb-devel
- libxkbcommon-devel
- desktop-file-utils
Debian:
- cmake
- g++
- pkg-config
- libfontconfig1-dev
- libxcb-xfixes0-dev
- libxkbcommon-dev
- python3
- libfreetype6-dev
- desktop-file-utils
Alpine:
- cmake
- pkgconf
- freetype-dev
- fontconfig-dev
- python3
- libxcb-dev
- g++
- libxkbcommon-dev
- desktop-file-utils
Archlinux:
- cmake
- freetype2
- fontconfig
- pkg-config
- make
- libxcb
- libxkbcommon
- python
- desktop-file-utils
FreeBSD:
- cmake
- freetype2
- fontconfig
- pkgconf
- python3
- desktop-file-utils
- name: Set alacritty install extra build deps - name: Set alacritty install extra build deps
when: when:
@@ -95,27 +39,29 @@
when: when:
- ansible_distribution_major_version == 7 - ansible_distribution_major_version == 7
ansible.builtin.set_fact: ansible.builtin.set_fact:
alacritty_build_deps_extra: ['xcb-util-devel', '@Development Tools'] alacritty_build_deps: "{{ alacritty_build_deps + ['xcb-util-devel', '@Development Tools'] }}"
- name: Add extra dependencies for EL8 - name: Add extra dependencies for EL8
when: when:
- ansible_distribution_major_version == 8 - ansible_distribution_major_version == 8
ansible.builtin.set_fact: ansible.builtin.set_fact:
alacritty_build_deps_extra: ['@Development Tools'] alacritty_build_deps: "{{ alacritty_build_deps + ['@Development Tools'] }}"
- name: Complete alacritty configuration
when: __alacritty_configured is undefined
ansible.builtin.set_fact:
__alacritty_configured: true
# }}} # }}}
- name: Append alacritty installation - name: Append alacritty installation
block: block:
- name: Append alacritty to pkg_cargo - name: Append alacritty to pkg_cargo
when: when:
- alacritty_method == 'source' - alacritty_method == 'source'
block:
- name: Configure pkg dependencies
loop: "{{ alacritty_pkg_deps }}"
loop_control:
loop_var: alacritty_pkg_dep
ansible.builtin.include_tasks: "{{ alacritty_pkg_dep }}"
ansible.builtin.set_fact: ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + alacritty_build_deps + alacritty_build_deps_extra + ['git'] }}" pkg_sys: "{{ pkg_sys + alacritty_build_deps }}"
pkg_cargo_build: "{{ pkg_cargo_build + [alacritty_src_install] }}" pkg_cargo_build: "{{ pkg_cargo_build + [alacritty_src_install] }}"
- name: Append alacritty to pkg_cask - name: Append alacritty to pkg_cask
@@ -129,3 +75,8 @@
- alacritty_method == 'package' - alacritty_method == 'package'
ansible.builtin.set_fact: ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + [alacritty_pkgname] }}" pkg_sys: "{{ pkg_sys + [alacritty_pkgname] }}"
- name: Complete alacritty configuration
when: __alacritty_configured is undefined
ansible.builtin.set_fact:
__alacritty_configured: true

View File

@@ -2,11 +2,49 @@
--- ---
- name: Add aquamarine - name: Add aquamarine
when: when:
- aquamarine_configured is undefined - __aquamarine_configured is undefined
block: block:
- name: Load aquamarine config - name: Set aquamarine install method
ansible.builtin.include_tasks: when:
file: config/aquamarine.yml - aquamarine_install_method is undefined
ansible.builtin.set_fact:
aquamarine_install_method: "{% if install_method in aquamarine_install_methods %}{{ install_method }}{% else %}{{ aquamarine_install_methods[0] }}{% endif %}"
- name: Configure aquamarine source install
when:
- aquamarine_install_method == 'source'
ansible.builtin.set_fact:
aquamarine_git_repo:
aquamarine_build_steps:
configure:
- cmake
- --no-warn-unused-cli
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX={{ install_prefix }}
- -S
- .
- -B
- ./build
build:
- cmake
- --build
- ./build
- --config
- Release
- --target
- all
- j
- "{{ build_jobs | int }}"
install:
- cmake
- --install
- ./build
- name: Finish aquamarine configuration
when:
- __aquamarine_configured is undefined
ansible.builtin.set_fact:
__aquamarine_configured: true
- name: Append aquamarine pkg_deps - name: Append aquamarine pkg_deps
loop: "{{ aquamarine.pkg_deps }}" loop: "{{ aquamarine.pkg_deps }}"

View File

@@ -16,20 +16,7 @@
block: block:
- name: Configure go - name: Configure go
ansible.builtin.set_fact: ansible.builtin.set_fact:
go_version: "{{ go_version | default('1.25.6') }}"
go_system: "{{ ansible_system | lower }}" go_system: "{{ ansible_system | lower }}"
go_archmap:
arm64: arm64
aarch64: arm64
x86_64: amd64
go_install_sums:
1.25.6:
Darwin:
amd64: sha256:e2b5b237f5c262931b8e280ac4b8363f156e19bfad5270c099998932819670b7
arm64: sha256:984521ae978a5377c7d782fd2dd953291840d7d3d0bd95781a1f32f16d94a006
Linux:
amd64: sha256:f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a
arm64: sha256:738ef87d79c34272424ccdf83302b7b0300b8b096ed443896089306117943dd5
- name: Set go architecture - name: Set go architecture
ansible.builtin.set_fact: ansible.builtin.set_fact:
@@ -37,32 +24,30 @@
- name: Set archive name - name: Set archive name
ansible.builtin.set_fact: ansible.builtin.set_fact:
go_archive: "go{{ go_version }}.{{ go_system }}-{{ go_arch }}.tar.gz" go_archive_file: "go{{ go_archive_version }}.{{ go_system }}-{{ go_arch }}.tar.gz"
- name: Set go download url - name: Set go archive url and path
ansible.builtin.set_fact: ansible.builtin.set_fact:
go_archive_url: "https://go.dev/dl/{{ go_archive }}" go_archive_url: "https://go.dev/dl/{{ go_archive_file }}"
go_extract_path: "{{ path_archive }}/go{{ go_archive_version }}"
- name: Set archive extract location - name: Finalize go archive install
ansible.builtin.set_fact: ansible.builtin.set_fact
go_extract_path: "{{ path_archive }}/go{{ go_version }}"
- name: Complete go archive install configuration
ansible.builtin.set_fact:
__go_configured: true
go_archive_install: go_archive_install:
extract_path: "{{ go_extract_path }}" extract_path: "{{ go_extract_path }}"
archive_url: "{{ go_archive_url }}" archive_url: "{{ go_archive_url }}"
archive_name: "{{ go_archive }}" archive_name: "{{ go_archive }}"
archive_checksum: "{{ go_install_sums[go_version][ansible_system][go_arch] }}" archive_checksum: "{{ go_archive_sums[go_archive_version][ansible_system][go_arch] }}"
- name: Install vis system package manager - name: Queue go install
block:
- name: Go system package install
when: when:
- go_install_method == 'system' - go_install_method == 'system'
ansible.builtin.set_fact: ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + ['go'] }}" pkg_sys: "{{ pkg_sys + ['go'] }}"
- name: Install via archive - name: Install via archive
when: when:
- go_install_method == 'archive' - go_install_method == 'archive'
block: block:
@@ -75,4 +60,8 @@
state: link state: link
force: true force: true
path: "{{ path_go }}" path: "{{ path_go }}"
src: "{{ got_extract_path }}/go" src: "{{ go_extract_path }}/go"
- name: Complete go archive install configuration
ansible.builtin.set_fact:
__go_configured: true

View File

@@ -29,9 +29,9 @@
hyprland_build_steps: hyprland_build_steps:
configure: configure:
- cmake - cmake
- --now-warn-unused-cli - --no-warn-unused-cli
- -DCMAKE_BUILD_TYPE:STRING=Release - -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX:PATH={{ install_prefix }} - -DCMAKE_INSTALL_PREFIX={{ install_prefix }}
- -S - -S
- . - .
- -B - -B
@@ -39,7 +39,7 @@
build: build:
- cmake - cmake
- --bulid - --bulid
- ./uild - ./build
- --config - --config
- Release - Release
- --target - --target

View File

@@ -51,3 +51,88 @@ pkg_sh: [] # use shell commands to install a package
pkg_appimage: [] # appimages to install pkg_appimage: [] # appimages to install
pkg_flatpak: [] # flatpak packages to install pkg_flatpak: [] # flatpak packages to install
pkg_snap: [] # snpacraft.io packages pkg_snap: [] # snpacraft.io packages
# Per package variables
## {{{ air
air_version: latest
air_install_url: github.com/air-verse/air
air_pkg_deps:
- pkgs/go.yml
air_build_files:
- bin/air
# }}}
## {{{ alacritty
alacritty_version: v0.16.1
alacritty_git_repo: https://github.com/alacritty/alacritty
alacritty_pkgname: alacritty
alacritty_pkg_deps:
- pkgs/git.yml
- pkgs/cargo.yml
alacritty_build_files:
- bin/alacritty
- share/pixmaps/Alacritty.svg
- share/applications/Alacritty.desktop
alacritty_cargo_build_flags:
- --release
alacritty_build_deps:
RedHat:
- cmake
- fontconfig-devel
- freetype-devel
- g++
- libxcb-devel
- libxkbcommon-devel
- desktop-file-utils
Debian:
- cmake
- g++
- pkg-config
- libfontconfig1-dev
- libxcb-xfixes0-dev
- libxkbcommon-dev
- python3
- libfreetype6-dev
- desktop-file-utils
Alpine:
- cmake
- pkgconf
- freetype-dev
- fontconfig-dev
- python3
- libxcb-dev
- g++
- libxkbcommon-dev
- desktop-file-utils
Archlinux:
- cmake
- freetype2
- fontconfig
- pkg-config
- make
- libxcb
- libxkbcommon
- python
- desktop-file-utils
FreeBSD:
- cmake
- freetype2
- fontconfig
- pkgconf
- python3
- desktop-file-utils
# }}}
# go {{{
go_archive_version: 1.25.6
go_archive_archmap:
arm64: arm64
aarch64: arm64
x86_64: amd64
go_archive_sums:
1.25.6:
Darwin:
amd64: sha256:e2b5b237f5c262931b8e280ac4b8363f156e19bfad5270c099998932819670b7
arm64: sha256:984521ae978a5377c7d782fd2dd953291840d7d3d0bd95781a1f32f16d94a006
Linux:
amd64: sha256:f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a
arm64: sha256:738ef87d79c34272424ccdf83302b7b0300b8b096ed443896089306117943dd5
# }}}

View File

@@ -17,9 +17,10 @@ ansible_lint_install_methods:
ansible_install_methods: ansible_install_methods:
- system - system
- system_pip - system_pip
# hyprland packages
aquamarine_install_methods: aquamarine_install_methods:
- source - source
hyprland_install_methods:
- source
yazi_install_methods: yazi_install_methods:
- source - source
- cargo - cargo