modified make, fixed packages and vars
- the make helper now has distinct build stages - configure: is now defined in pkg.targets.configure - build: is now defined in pkg.targets.build - install: is now defined in pkg.targets.install - added pre-install: which is a list of targets that are looped over before install - added post-instal: which is a list of targets that are looped over after install - removed major package level variables from vars/main.yml - moving those variables into actual package level variables as defaults - if the values are defined they will be used instead of defaults
This commit is contained in:
@@ -12,11 +12,54 @@
|
|||||||
version: "{{ pkg.version | default(omit) }}"
|
version: "{{ pkg.version | default(omit) }}"
|
||||||
ansible.builtin.include_tasks: helpers/git.yml
|
ansible.builtin.include_tasks: helpers/git.yml
|
||||||
|
|
||||||
- name: Run make targets
|
- name: Run configure target
|
||||||
loop: "{{ pkg.targets }}"
|
when:
|
||||||
|
- pkg.target.configure is defined
|
||||||
|
community.general.make:
|
||||||
|
chdir: "{{ pkg.path }}"
|
||||||
|
target: "{{ pkg.target.configure.name }}"
|
||||||
|
params: "{{ pkg.target.configure.params | default(omit) }}"
|
||||||
|
|
||||||
|
- name: Run build target
|
||||||
|
when:
|
||||||
|
- pkg.target.build is defined
|
||||||
|
community.general.make:
|
||||||
|
chdir: "{{ pkg.path }}"
|
||||||
|
target: "{{ pkg.target.build.name }}"
|
||||||
|
params: "{{ target.params | default(omit) }}"
|
||||||
|
|
||||||
|
- name: Clean old installation
|
||||||
|
vars:
|
||||||
|
files: "{{ pkg.install_files }}"
|
||||||
|
when:
|
||||||
|
- pkg.install_files is defined
|
||||||
|
ansible.builtin.include_tasks: helpers/clean_install.yml
|
||||||
|
|
||||||
|
- name: Run preinstall targets
|
||||||
|
when:
|
||||||
|
- pkg.targets.preinstall is defined
|
||||||
|
loop: "{{ pkg.targets.preinstall }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: target
|
||||||
|
community.general.make:
|
||||||
|
chdir: "{{ pkg.path }}"
|
||||||
|
target: "{{ target.name }}"
|
||||||
|
params: "{{ target.params | default(omit) }}"
|
||||||
|
|
||||||
|
- name: Run install target
|
||||||
|
when:
|
||||||
|
- pkg.targets.install is defined
|
||||||
|
community.general.make:
|
||||||
|
chdir: "{{ pkg.path }}"
|
||||||
|
target: "{{ pkg.targets.install.name }}"
|
||||||
|
params: "{{ pkg.targets.install.params | default(omit) }}"
|
||||||
|
|
||||||
|
- name: Run postinstall targets
|
||||||
|
when:
|
||||||
|
- pkg.targets.postinstall is defined
|
||||||
|
loop: "{{ pkg.targets.postinstall }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: target
|
loop_var: target
|
||||||
become: "{{ target.do_become }}"
|
|
||||||
community.general.make:
|
community.general.make:
|
||||||
chdir: "{{ pkg.path }}"
|
chdir: "{{ pkg.path }}"
|
||||||
target: "{{ target.name }}"
|
target: "{{ target.name }}"
|
||||||
|
|||||||
@@ -1,11 +1,25 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
#
|
#
|
||||||
## Package: bat
|
## Package: bat
|
||||||
## Description: cat replacement with style
|
## Description: cat replacement with wings
|
||||||
## Version: latest
|
## Version: latest
|
||||||
## Methods: source
|
## Methods: source
|
||||||
## Helpers: cargo
|
## Helpers: cargo
|
||||||
---
|
---
|
||||||
|
- name: Set bat default facts # {{{
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
bat:
|
||||||
|
install_methods:
|
||||||
|
- source
|
||||||
|
- system
|
||||||
|
pkgname:
|
||||||
|
RedHat: bat
|
||||||
|
Debian: bat
|
||||||
|
Archlinux: bat
|
||||||
|
Alpine: bat
|
||||||
|
Darwin: bat
|
||||||
|
FreeBSD: bat
|
||||||
|
# }}}
|
||||||
- name: Start bat configuration
|
- name: Start bat configuration
|
||||||
when:
|
when:
|
||||||
- "'bat' not in __configured"
|
- "'bat' not in __configured"
|
||||||
|
|||||||
@@ -11,6 +11,11 @@
|
|||||||
cargo:
|
cargo:
|
||||||
install_methods:
|
install_methods:
|
||||||
- system
|
- system
|
||||||
|
pkgname:
|
||||||
|
RedHat: cargo
|
||||||
|
Debian: cargo
|
||||||
|
Alpine: cargo
|
||||||
|
FreeBSD: cargo
|
||||||
- name: Configure cargo
|
- name: Configure cargo
|
||||||
when:
|
when:
|
||||||
- "'cargo' not in __configured"
|
- "'cargo' not in __configured"
|
||||||
@@ -35,7 +40,7 @@
|
|||||||
block:
|
block:
|
||||||
- name: Queue cargo install
|
- name: Queue cargo install
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
pkg_sys: "{{ pkg_sys + [cargo_pkgname] }}"
|
pkg_sys: "{{ pkg_sys + [cargo.pkgname[os_family]] }}"
|
||||||
|
|
||||||
- name: Finalize cargo configuration
|
- name: Finalize cargo configuration
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
|
|||||||
@@ -6,6 +6,12 @@
|
|||||||
## Methods: system
|
## Methods: system
|
||||||
## Helpers: -
|
## Helpers: -
|
||||||
---
|
---
|
||||||
|
- name: Set cmake default facts # {{
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
cmake:
|
||||||
|
install_methods:
|
||||||
|
- system
|
||||||
|
# }}
|
||||||
- name: Configure cmake
|
- name: Configure cmake
|
||||||
when:
|
when:
|
||||||
- "'cmake' not in __configured"
|
- "'cmake' not in __configured"
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
|
- name: Set fzf default facts # {{{
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
fzf:
|
||||||
|
install_methods:
|
||||||
|
- system
|
||||||
|
# }}}
|
||||||
- name: Configure fzf
|
- name: Configure fzf
|
||||||
when:
|
when:
|
||||||
- "'fzf' not in __configured"
|
- "'fzf' not in __configured"
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
|
- name: Set git default facts # {{{
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
git:
|
||||||
|
install_methods:
|
||||||
|
- system
|
||||||
|
# }}}
|
||||||
- name: Configure git
|
- name: Configure git
|
||||||
when:
|
when:
|
||||||
- "'git' not in __configured"
|
- "'git' not in __configured"
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
|
||||||
---
|
|
||||||
- name: Add glow
|
|
||||||
when:
|
|
||||||
- glow_configured is undefined
|
|
||||||
block:
|
|
||||||
- name: Append glow to pkg_go
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
pkg_go: "{{ pkg_go + ['github.com/charmbracelet/glow@latest'] }}"
|
|
||||||
|
|
||||||
- name: Set glow_configured
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
glow_configured: true
|
|
||||||
@@ -1,5 +1,50 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
|
- name: Set go default facts # {{{
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
go:
|
||||||
|
install_methods:
|
||||||
|
- archive
|
||||||
|
- system
|
||||||
|
pkgname:
|
||||||
|
RedHat: go
|
||||||
|
Debian: go
|
||||||
|
Darwin: go
|
||||||
|
FreeBSD:
|
||||||
|
default: go
|
||||||
|
1.25: go125
|
||||||
|
1.24: go124
|
||||||
|
1.23: go123
|
||||||
|
1.22: go122
|
||||||
|
archive:
|
||||||
|
version: "{{ go_archive_version | default('1.26.1') }}"
|
||||||
|
archmap:
|
||||||
|
arm64: arm64
|
||||||
|
aarch64: arm64
|
||||||
|
x86_64: amd64
|
||||||
|
url_base: https://go.dev/dl
|
||||||
|
checksums:
|
||||||
|
1.26.1:
|
||||||
|
Darwin:
|
||||||
|
amd64: sha256:65773dab2f8cc4cd23d93ba6d0a805de150ca0b78378879292be0b903b8cdd08
|
||||||
|
arm64: sha256:353df43a7811ce284c8938b5f3c7df40b7bfb6f56cb165b150bc40b5e2dd541f
|
||||||
|
Linux:
|
||||||
|
amd64: sha256:031f088e5d955bab8657ede27ad4e3bc5b7c1ba281f05f245bcc304f327c987a
|
||||||
|
arm64: sha256:a290581cfe4fe28ddd737dde3095f3dbeb7f2e4065cab4eae44dfc53b760c2f7
|
||||||
|
FreeBSD:
|
||||||
|
amd64: sha256:d89034a0b54fdc234815fecfb76d7d06a7d180d7a6124aa47715a4cacc9fe999
|
||||||
|
arm64: sha256:d62b358dbf7bcfc33402e7e221d848e7fd8d7ac902b33920f2c23c8a32ba76db
|
||||||
|
1.25.6:
|
||||||
|
Darwin:
|
||||||
|
amd64: sha256:e2b5b237f5c262931b8e280ac4b8363f156e19bfad5270c099998932819670b7
|
||||||
|
arm64: sha256:984521ae978a5377c7d782fd2dd953291840d7d3d0bd95781a1f32f16d94a006
|
||||||
|
Linux:
|
||||||
|
amd64: sha256:f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a
|
||||||
|
arm64: sha256:738ef87d79c34272424ccdf83302b7b0300b8b096ed443896089306117943dd5
|
||||||
|
FreeBSD:
|
||||||
|
amd64: sha256:61e1d50e332359474ff6dcf4bc0bd34ba2d2cf4ef649593a5faa527f0ab84e2b
|
||||||
|
arm64: sha256:648484146702dd58db0e2c3d15bda3560340d149ed574936e63285a823116b77
|
||||||
|
# }}}
|
||||||
- name: Configure go for install
|
- name: Configure go for install
|
||||||
when:
|
when:
|
||||||
- "'go' not in __configured"
|
- "'go' not in __configured"
|
||||||
@@ -16,7 +61,7 @@
|
|||||||
block:
|
block:
|
||||||
- name: Set go pkgname
|
- name: Set go pkgname
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
go_pkgname: "{{ go_pkgname[ansible_os_family] }}"
|
go_pkgname: "{{ go.pkgname[os_family] }}"
|
||||||
|
|
||||||
- name: Set go pkgname for FreeBSD
|
- name: Set go pkgname for FreeBSD
|
||||||
when:
|
when:
|
||||||
@@ -24,6 +69,10 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
go_pkgname: "{{ go_pkgname[go_bsd_version] | default(go_pkgname['default']) }}"
|
go_pkgname: "{{ go_pkgname[go_bsd_version] | default(go_pkgname['default']) }}"
|
||||||
|
|
||||||
|
- name: Go system package install
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
pkg_sys: "{{ pkg_sys + [go_pkgname] }}"
|
||||||
|
|
||||||
- name: Configure go archive installation
|
- name: Configure go archive installation
|
||||||
when:
|
when:
|
||||||
- go_install_method == 'archive'
|
- go_install_method == 'archive'
|
||||||
@@ -31,16 +80,16 @@
|
|||||||
- name: Configure go
|
- name: Configure go
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
go_system: "{{ ansible_system | lower }}"
|
go_system: "{{ ansible_system | lower }}"
|
||||||
go_arch: "{{ go_archive_archmap[ansible_architecture] }}"
|
go_arch: "{{ go.archive.archmap[ansible_architecture] }}"
|
||||||
|
|
||||||
- name: Set archive name
|
- name: Set archive name
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
go_archive_file: "go{{ go_archive_version }}.{{ go_system }}-{{ go_arch }}.tar.gz"
|
go_archive_file: "go{{ go.archive.version }}.{{ go_system }}-{{ go_arch }}.tar.gz"
|
||||||
|
|
||||||
- name: Set go archive url and path
|
- name: Set go archive url and path
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
go_archive_url: "{{ go_archive_url_base }}/{{ go_archive_file }}"
|
go_archive_url: "{{ go.archive.url_base }}/{{ go_archive_file }}"
|
||||||
go_extract_path: "{{ path_archive }}/go{{ go_archive_version }}"
|
go_extract_path: "{{ path_archive }}/go{{ go.archive.version }}"
|
||||||
|
|
||||||
- name: Finalize go archive install
|
- name: Finalize go archive install
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
@@ -48,7 +97,7 @@
|
|||||||
extract_to: "{{ go_extract_path }}"
|
extract_to: "{{ go_extract_path }}"
|
||||||
url: "{{ go_archive_url }}"
|
url: "{{ go_archive_url }}"
|
||||||
name: "{{ go_archive_file }}"
|
name: "{{ go_archive_file }}"
|
||||||
checksum: "{{ go_archive_sums[go_archive_version][ansible_system][go_arch] }}"
|
checksum: "{{ go.archive.checksums[go.archive.version][ansible_system][go_arch] }}"
|
||||||
links:
|
links:
|
||||||
- from: "{{ go_extract_path }}/go"
|
- from: "{{ go_extract_path }}/go"
|
||||||
to: "{{ path_go }}"
|
to: "{{ path_go }}"
|
||||||
@@ -59,22 +108,10 @@
|
|||||||
__add_to_path: "{{ __add_to_path + [path_go ~ '/bin'] }}"
|
__add_to_path: "{{ __add_to_path + [path_go ~ '/bin'] }}"
|
||||||
__var_to_env: "{{ __var_to_env | combine( { 'GOROOT': path_go } ) }}"
|
__var_to_env: "{{ __var_to_env | combine( { 'GOROOT': path_go } ) }}"
|
||||||
|
|
||||||
- name: Queue go install
|
- name: Add go archive extract install
|
||||||
block:
|
|
||||||
- name: Go system package install
|
|
||||||
when:
|
|
||||||
- go_install_method == 'system'
|
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
pkg_sys: "{{ pkg_sys + [go_pkgname] }}"
|
pkg_archive: "{{ pkg_archive + [go_archive_install] }}"
|
||||||
|
|
||||||
- name: Install via archive
|
- name: Finalise go configuration
|
||||||
when:
|
|
||||||
- go_install_method == 'archive'
|
|
||||||
block:
|
|
||||||
- name: Add go archive extract install
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
pkg_archive: "{{ pkg_archive + [go_archive_install] }}"
|
|
||||||
|
|
||||||
- name: Complete go archive install configuration
|
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
__configured: "{{ __configured | combine( { 'go': true } ) }}"
|
__configured: "{{ __configured | combine( { 'go': go_install_method } ) }}"
|
||||||
|
|||||||
@@ -1,5 +1,64 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
|
#
|
||||||
|
## Package: neovim
|
||||||
|
## Description: fork of vim focusing on modern development
|
||||||
|
## Version: master
|
||||||
|
## Methods: [source, system, appimage, archive]
|
||||||
|
## Helpers: [make, archive, appimage]
|
||||||
---
|
---
|
||||||
|
- name: Set neovim default facts # {{{
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
neovim:
|
||||||
|
install_methods:
|
||||||
|
- source
|
||||||
|
- system
|
||||||
|
- appimage
|
||||||
|
- archive
|
||||||
|
git_repo: https://github.com/neovim/neovim
|
||||||
|
appimage:
|
||||||
|
base_url: https://github.com/neovim/neovim/releases/download
|
||||||
|
pkgname:
|
||||||
|
RedHat: neovim
|
||||||
|
Debian: neovim
|
||||||
|
Darwin: neovim
|
||||||
|
FreeBSD: neovim
|
||||||
|
build_files:
|
||||||
|
- to: lib64/nvim
|
||||||
|
- to: bin/nvim
|
||||||
|
- to: share/nvim
|
||||||
|
- to: share/applications/nvim.desktop
|
||||||
|
- to: share/icons/hicolor/128x128/apps/nvim.png
|
||||||
|
- to: share/man/man1/nvim.1
|
||||||
|
build_pkgdeps:
|
||||||
|
- cmake
|
||||||
|
- git
|
||||||
|
build_deps:
|
||||||
|
RedHat:
|
||||||
|
- cmake
|
||||||
|
- curl
|
||||||
|
- gcc
|
||||||
|
- gettext
|
||||||
|
- glibc-gconv-extra
|
||||||
|
- make
|
||||||
|
- ninja-build
|
||||||
|
Debian:
|
||||||
|
- build-essential
|
||||||
|
- cmake
|
||||||
|
- curl
|
||||||
|
- gettext
|
||||||
|
- ninja-build
|
||||||
|
Darwin:
|
||||||
|
- cmake
|
||||||
|
- curl
|
||||||
|
- gettext
|
||||||
|
- ninja
|
||||||
|
Alpine:
|
||||||
|
- build-base
|
||||||
|
- cmake
|
||||||
|
- coreutils
|
||||||
|
- curl
|
||||||
|
- gettext-dev
|
||||||
|
# }}}
|
||||||
- name: Configure neovim
|
- name: Configure neovim
|
||||||
when:
|
when:
|
||||||
- "'neovim' not in __configured"
|
- "'neovim' not in __configured"
|
||||||
@@ -29,12 +88,14 @@
|
|||||||
repo: "{{ neovim.git_repo }}"
|
repo: "{{ neovim.git_repo }}"
|
||||||
version: "{{ neovim_version }}"
|
version: "{{ neovim_version }}"
|
||||||
targets:
|
targets:
|
||||||
- name: ""
|
build:
|
||||||
|
name: ""
|
||||||
do_become: false
|
do_become: false
|
||||||
params:
|
params:
|
||||||
CMAKE_BUILD_TYPE: Release
|
CMAKE_BUILD_TYPE: Release
|
||||||
CMAKE_EXTRA_FLAGS: "-DCMAKE_INSTALL_PREFIX={{ install_prefix }}"
|
CMAKE_EXTRA_FLAGS: "-DCMAKE_INSTALL_PREFIX={{ install_prefix }}"
|
||||||
- name: install
|
install:
|
||||||
|
name: install
|
||||||
do_become: true
|
do_become: true
|
||||||
- name: Append neovim to source install list
|
- name: Append neovim to source install list
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
|
|||||||
@@ -44,42 +44,12 @@ __configured: {} # dict of configured packages
|
|||||||
__add_to_path: [] # list of paths that should be in PATH
|
__add_to_path: [] # list of paths that should be in PATH
|
||||||
__var_to_env: {} # dict of variables to add to your env
|
__var_to_env: {} # dict of variables to add to your env
|
||||||
|
|
||||||
# Per package variables
|
# system level variables that could change for each system
|
||||||
# cargo {{{
|
path_profile:
|
||||||
cargo_pkgname: cargo
|
|
||||||
# }}}
|
|
||||||
# {{{ go
|
|
||||||
go_archive_version: 1.25.6
|
|
||||||
go_archive_archmap:
|
|
||||||
arm64: arm64
|
|
||||||
aarch64: arm64
|
|
||||||
x86_64: amd64
|
|
||||||
go_archive_url_base: https://go.dev/dl
|
|
||||||
go_archive_sums:
|
|
||||||
1.25.6:
|
|
||||||
Darwin:
|
|
||||||
amd64: sha256:e2b5b237f5c262931b8e280ac4b8363f156e19bfad5270c099998932819670b7
|
|
||||||
arm64: sha256:984521ae978a5377c7d782fd2dd953291840d7d3d0bd95781a1f32f16d94a006
|
|
||||||
Linux:
|
|
||||||
amd64: sha256:f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a
|
|
||||||
arm64: sha256:738ef87d79c34272424ccdf83302b7b0300b8b096ed443896089306117943dd5
|
|
||||||
FreeBSD:
|
|
||||||
amd64: sha256:61e1d50e332359474ff6dcf4bc0bd34ba2d2cf4ef649593a5faa527f0ab84e2b
|
|
||||||
arm64: sha256:648484146702dd58db0e2c3d15bda3560340d149ed574936e63285a823116b77
|
|
||||||
go_profile_path:
|
|
||||||
Linux: /etc/profile.d
|
Linux: /etc/profile.d
|
||||||
FreeBSD: /etc/profile.d
|
FreeBSD: /etc/profile.d
|
||||||
go_pkgname:
|
|
||||||
RedHat: go
|
# Per package variables
|
||||||
Debian: go
|
|
||||||
Darwin: go
|
|
||||||
FreeBSD:
|
|
||||||
default: go
|
|
||||||
1.25: go125
|
|
||||||
1.24: go124
|
|
||||||
1.23: go123
|
|
||||||
1.22: go122
|
|
||||||
# }}}
|
|
||||||
# neovim {{{
|
# neovim {{{
|
||||||
neovim_version: master
|
neovim_version: master
|
||||||
neovim_build_type: Release
|
neovim_build_type: Release
|
||||||
|
|||||||
Reference in New Issue
Block a user