Files
llgo/.goreleaser.yaml
2025-09-09 11:57:38 +08:00

150 lines
5.3 KiB
YAML

version: 2
dist: .dist
env:
- SYSROOT_DARWIN_AMD64={{.Env.PWD}}/.sysroot/darwin/amd64
- SYSROOT_DARWIN_ARM64={{.Env.PWD}}/.sysroot/darwin/arm64
- SYSROOT_LINUX_AMD64={{.Env.PWD}}/.sysroot/linux/amd64
- SYSROOT_LINUX_ARM64={{.Env.PWD}}/.sysroot/linux/arm64
- CGO_ENABLED=1
- CGO_CXXFLAGS=-std=c++17
before:
hooks:
- go mod download
builds:
- id: llgo-darwin-amd64
main: ./cmd/llgo
binary: bin/llgo
flags:
- -tags=darwin,amd64,byollvm
ldflags:
- -X github.com/goplus/llgo/internal/env.buildVersion=v{{.Version}}
- -X github.com/goplus/llgo/internal/env.buildTime={{.Date}}
env:
- CC=o64-clang
- CXX=o64-clang++
- CGO_CPPFLAGS=-I{{.Env.SYSROOT_DARWIN_AMD64}}/crosscompile/clang/include -mmacosx-version-min=10.13 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
- CGO_LDFLAGS=-L{{.Env.SYSROOT_DARWIN_AMD64}}/crosscompile/clang/lib -Wl,-rpath,@executable_path/../crosscompile/clang/lib -mmacosx-version-min=10.13 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -lLLVM-19 -lz -lm
targets:
- darwin_amd64
mod_timestamp: "{{.CommitTimestamp}}"
- id: llgo-darwin-arm64
main: ./cmd/llgo
binary: bin/llgo
flags:
- -tags=darwin,arm64,byollvm
ldflags:
- -X github.com/goplus/llgo/internal/env.buildVersion=v{{.Version}}
- -X github.com/goplus/llgo/internal/env.buildTime={{.Date}}
env:
- CC=oa64-clang
- CXX=oa64-clang++
- CGO_CPPFLAGS=-I{{.Env.SYSROOT_DARWIN_ARM64}}/crosscompile/clang/include -mmacosx-version-min=10.13 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
- CGO_LDFLAGS=-L{{.Env.SYSROOT_DARWIN_ARM64}}/crosscompile/clang/lib -Wl,-rpath,@executable_path/../crosscompile/clang/lib -mmacosx-version-min=10.13 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -lLLVM-19 -lz -lm
targets:
- darwin_arm64
mod_timestamp: "{{.CommitTimestamp}}"
- id: llgo-linux-amd64
main: ./cmd/llgo
binary: bin/llgo
flags:
- -tags=linux,amd64,byollvm
ldflags:
- -X github.com/goplus/llgo/internal/env.buildVersion=v{{.Version}}
- -X github.com/goplus/llgo/internal/env.buildTime={{.Date}}
env:
- CC=x86_64-linux-gnu-gcc
- CXX=x86_64-linux-gnu-g++
- CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -I{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
- CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -Wl,-rpath,\$ORIGIN/../crosscompile/clang/lib -lLLVM-19
targets:
- linux_amd64
mod_timestamp: "{{.CommitTimestamp}}"
- id: llgo-linux-arm64
main: ./cmd/llgo
binary: bin/llgo
flags:
- -tags=linux,arm64,byollvm
ldflags:
- -X github.com/goplus/llgo/internal/env.buildVersion=v{{.Version}}
- -X github.com/goplus/llgo/internal/env.buildTime={{.Date}}
env:
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
- CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -I{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
- CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -Wl,-rpath,\$ORIGIN/../crosscompile/clang/lib -lLLVM-19
targets:
- linux_arm64
mod_timestamp: "{{.CommitTimestamp}}"
archives:
- format: tar.gz
name_template: >-
{{.ProjectName}}{{.Version}}.{{.Os}}-{{.Arch}}
{{- if .Arm}}v{{.Arm}}{{end}}
files:
- LICENSE
- README.md
- runtime
- src: ".sysroot/{{.Os}}/{{.Arch}}/crosscompile/clang"
dst: crosscompile/clang
info:
mode: 0755
checksum:
name_template: "{{.ProjectName}}{{.Version}}.checksums.txt"
nfpms:
- package_name: llgo
vendor: goplus
homepage: https://github.com/goplus/llgo
maintainer: Aofei Sheng <aofei@aofeisheng.com>
description: |
LLGo is a Go compiler based on LLVM in order to better integrate Go with the C ecosystem including Python. It's a
subproject of the XGo project.
LLGo aims to expand the boundaries of Go/XGo, providing limitless possibilities such as:
- Game development
- AI and data science
- WebAssembly
- Embedded development
- ...
license: Apache-2.0
formats:
- deb
- rpm
file_name_template: >-
{{.ProjectName}}{{.Version}}.{{.Os}}-{{.Arch}}
{{- if .Arm}}v{{.Arm}}{{end}}
bindir: /usr/local/bin
snapcrafts:
- name: llgo
title: A Go compiler based on LLVM
summary: A Go compiler based on LLVM
description: |
LLGo is a Go compiler based on LLVM in order to better integrate Go with the C ecosystem including Python. It's a
subproject of the XGo project.
LLGo aims to expand the boundaries of Go/XGo, providing limitless possibilities such as:
- Game development
- AI and data science
- WebAssembly
- Embedded development
- ...
license: Apache-2.0
confinement: classic
name_template: >-
{{.ProjectName}}{{.Version}}.{{.Os}}-{{.Arch}}
{{- if .Arm}}v{{.Arm}}{{end}}
snapshot:
name_template: '{{trimprefix .Summary "v"}}'
release:
prerelease: auto