Skip to content

Commit

Permalink
feat: Build for Android (Termux)
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Jan 23, 2024
1 parent f0a7529 commit 9f8a5b2
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ builds:
env:
- CGO_ENABLED=0
goos:
- android
- darwin
- freebsd
- linux
Expand Down Expand Up @@ -68,6 +69,12 @@ builds:
- -X main.date={{ .Date }}
- -X main.builtBy=goreleaser
ignore:
- goos: android
goarch: '386'
- goos: android
goarch: amd64
- goos: android
goarch: arm
- goos: darwin
goarch: '386'
- goos: linux
Expand Down
1 change: 1 addition & 0 deletions assets/chezmoi.io/docs/install.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ pre-built binary and shell completions.
{{- end }}
[`amd64` (glibc)](https://github.com/twpayne/chezmoi/releases/download/v{{ $version }}/chezmoi_{{ $version }}_linux-glibc_amd64.tar.gz)
[`amd64` (musl)](https://github.com/twpayne/chezmoi/releases/download/v{{ $version }}/chezmoi_{{ $version }}_linux-musl_amd64.tar.gz)
[`arm64` (Termux)](https://github.com/twpayne/chezmoi/releases/download/v{{ $version }}/chezmoi_{{ $version }}_android_arm64.tar.gz)

=== "macOS"

Expand Down
8 changes: 8 additions & 0 deletions assets/scripts/install-local-bin.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions assets/scripts/install.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions internal/cmds/generate-install.sh/install.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ get_goos() {
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
case "${os}" in
cygwin_nt*) goos="windows" ;;
linux)
if is_command termux-info; then
goos=android
else
goos=linux
fi
;;
mingw*) goos="windows" ;;
msys_nt*) goos="windows" ;;
*) goos="${os}" ;;
Expand Down

0 comments on commit 9f8a5b2

Please sign in to comment.