mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-04 03:11:55 +02:00
cefec7c58b
This adds `arm` support for termux (arch needs to be called `arm` as well). --- Ok this drove me nuts, but I think I've got it working now: https://github.com/carapace-sh/carapace-bin/releases/tag/v1.0.3 1. First of all most of the `android` targets need `CGO_ENABLED=1`. 2. Then there's the need for a [patched runtime](https://github.com/carapace-sh/go/tree/master/termux) due to the `/data/data/com.termux/files` prefix (adopted from the [golang package](https://github.com/termux/termux-packages/tree/master/packages/golang)). 3. Two builds so that for termux the patched `gobinary` can be used. Then add a `termux` suffix to the archives for clarity. ```yaml builds: - id: default env: - CGO_ENABLED=0 goos: - linux - windows - darwin main: ./cmd/carapace binary: carapace tags: - release - id: termux env: - CGO_ENABLED=1 goos: - android goarch: - amd64 - arm64 - arm - "386" main: ./cmd/carapace binary: carapace tags: - release gobinary: go-termux archives: - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' builds: - default format_overrides: - goos: windows format: zip - id: termux builds: - termux name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}.termux' ``` 4. Compiling needs the [Android NDK](https://developer.android.com/ndk) with the `CC` environment variable set. I used a [script](https://github.com/carapace-sh/go/blob/master/go-termux.sh) for this (`/usr/local/bin/go-termux`). ```sh #!/bin/bash bindir="/opt/android-sdk/ndk/${NDK_VERSION}/toolchains/llvm/prebuilt/linux-x86_64/bin" [ "$GOARCH" = "amd64" ] && export CC="$bindir/x86_64-linux-android${ANDROID_VERSION}-clang" [ "$GOARCH" = "arm64" ] && export CC="$bindir/aarch64-linux-android${ANDROID_VERSION}-clang" [ "$GOARCH" = "arm" ] && export CC="$bindir/armv7a-linux-androideabi${ANDROID_VERSION}-clang" [ "$GOARCH" = "386" ] && export CC="$bindir/i686-linux-android${ANDROID_VERSION}-clang" exec /usr/local/go-termux/bin/go "$@" ``` 5. There's [termux-apt-repo](https://github.com/termux/termux-apt-repo) which makes repo creation pretty easy with `gh_pages`. Just needs a [fix](https://github.com/termux/termux-apt-repo/pull/25) as goreleaser uses `data.tar.gz`. related #3333 related #4812 related https://github.com/termux/termux-apt-repo/pull/25 |
||
---|---|---|
.. | ||
testdata | ||
nfpm_test.go | ||
nfpm.go |