|
7 | 7 | GOTEST=$(GOCMD) test |
8 | 8 | GOVET=$(GOCMD) vet |
9 | 9 | BINARY_NAME=local-ai |
10 | | -LAUNCHER_BINARY_NAME=local-ai-launcher |
11 | 10 |
|
12 | 11 | UBUNTU_VERSION?=2404 |
13 | 12 | UBUNTU_CODENAME?=noble |
@@ -46,11 +45,6 @@ TEST_FLAKES?=5 |
46 | 45 | RANDOM := $(shell bash -c 'echo $$RANDOM') |
47 | 46 |
|
48 | 47 | VERSION?=$(shell git describe --always --tags || echo "dev" ) |
49 | | -# fyne package only accepts numeric x[.y[.z]] app versions, so reduce git |
50 | | -# describe output (v4.9.0, v4.9.0-14-gabc1234, or a bare sha on untagged |
51 | | -# checkouts) to its numeric core; anything non-numeric falls back to 0.0.0. |
52 | | -# Without this the packaged launcher reports itself as version 0.0.0 (#11673). |
53 | | -LAUNCHER_APP_VERSION?=$(shell v=$$(echo "$(VERSION)" | sed -E 's/^v//; s/[+-].*$$//'); echo "$$v" | grep -qE '^[0-9]+(\.[0-9]+){0,2}$$' && echo "$$v" || echo "0.0.0") |
54 | 48 | # go tool nm ./local-ai | grep Commit |
55 | 49 | LD_FLAGS?=-s -w |
56 | 50 | override LD_FLAGS += -X "github.com/mudler/LocalAI/internal.Version=$(VERSION)" |
@@ -205,16 +199,6 @@ build: protogen-go generate install-go-tools core/http/react-ui/dist ## Build th |
205 | 199 | rm -rf $(BINARY_NAME) || true |
206 | 200 | CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o $(BINARY_NAME) ./cmd/local-ai |
207 | 201 |
|
208 | | -build-launcher: ## Build the launcher application |
209 | | - $(info ${GREEN}I local-ai launcher build info:${RESET}) |
210 | | - $(info ${GREEN}I BUILD_TYPE: ${YELLOW}$(BUILD_TYPE)${RESET}) |
211 | | - $(info ${GREEN}I GO_TAGS: ${YELLOW}$(GO_TAGS)${RESET}) |
212 | | - $(info ${GREEN}I LD_FLAGS: ${YELLOW}$(LD_FLAGS)${RESET}) |
213 | | - rm -rf $(LAUNCHER_BINARY_NAME) || true |
214 | | - CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o $(LAUNCHER_BINARY_NAME) ./cmd/launcher |
215 | | - |
216 | | -build-all: build build-launcher ## Build both server and launcher |
217 | | - |
218 | 202 | build-dev: ## Run LocalAI in dev mode with live reload |
219 | 203 | @command -v air >/dev/null 2>&1 || go install github.com/air-verse/air@latest |
220 | 204 | air -c .air.toml |
@@ -328,11 +312,10 @@ test-coverage-check: test-coverage |
328 | 312 | ## |
329 | 313 | ## LINT_EXCLUDE_DIRS_RE matches directories whose Go packages can't typecheck |
330 | 314 | ## without C/C++ headers we don't install in the lint runner (cgo wrappers |
331 | | -## around llama.cpp, piper/spdlog, silero-vad/onnxruntime, and Fyne/OpenGL for |
332 | | -## the launcher). Their compile-time correctness is enforced by their own |
| 315 | +## around llama.cpp, piper/spdlog, silero-vad/onnxruntime). Their compile-time correctness is enforced by their own |
333 | 316 | ## build pipelines. Keep this as a deny list — `go list ./...` discovers |
334 | 317 | ## everything else automatically, so new packages are scanned by default. |
335 | | -LINT_EXCLUDE_DIRS_RE=/(backend/go/(piper|silero-vad|llm)|cmd/launcher)(/|$$) |
| 318 | +LINT_EXCLUDE_DIRS_RE=/(backend/go/(piper|silero-vad|llm))(/|$$) |
336 | 319 |
|
337 | 320 | ## Set LINT_NEW_FROM to a git ref to override .golangci.yml's |
338 | 321 | ## new-from-merge-base (origin/master). Useful from a fork clone where |
@@ -1912,51 +1895,3 @@ site: docs/static/gallery.html |
1912 | 1895 | .PHONY: site-serve |
1913 | 1896 | site-serve: site |
1914 | 1897 | cd website/public && python3 -m http.server 8000 |
1915 | | - |
1916 | | -######################################################## |
1917 | | -## Platform-specific builds |
1918 | | -######################################################## |
1919 | | - |
1920 | | -## fyne cross-platform build |
1921 | | -# Build LocalAI.app from the launcher via fyne (metadata read from cmd/launcher/FyneApp.toml). |
1922 | | -# Signing happens via contrib/macos/sign-and-notarize.sh, which is a no-op when the signing |
1923 | | -# secrets are unset, so unsigned local/fork builds keep working. |
1924 | | -build-launcher-darwin: |
1925 | | - rm -rf dist/LocalAI.app cmd/launcher/LocalAI.app |
1926 | | - mkdir -p dist |
1927 | | - cd cmd/launcher && go run fyne.io/tools/cmd/fyne@latest package -os darwin -icon ../../core/http/static/logo.png --executable $(LAUNCHER_BINARY_NAME) --app-version $(LAUNCHER_APP_VERSION) |
1928 | | - mv cmd/launcher/LocalAI.app dist/LocalAI.app |
1929 | | - bash contrib/macos/sign-and-notarize.sh sign dist/LocalAI.app |
1930 | | - |
1931 | | -# Notarize + staple the .app itself, then wrap it into a drag-to-Applications |
1932 | | -# DMG via hdiutil and sign the DMG. The app is stapled BEFORE packaging so the |
1933 | | -# bundle carries its own ticket and verifies offline (a dmg-only staple leaves |
1934 | | -# the app relying on an online Gatekeeper check, which fails offline / once the |
1935 | | -# app is copied out of the dmg). No-op without notary secrets. |
1936 | | -dmg-launcher-darwin: build-launcher-darwin |
1937 | | - bash contrib/macos/sign-and-notarize.sh notarize-app dist/LocalAI.app |
1938 | | - rm -rf dist/dmg dist/LocalAI.dmg |
1939 | | - mkdir -p dist/dmg |
1940 | | - cp -R dist/LocalAI.app dist/dmg/LocalAI.app |
1941 | | - ln -s /Applications dist/dmg/Applications |
1942 | | - hdiutil create -volname "LocalAI" -srcfolder dist/dmg -ov -format UDZO dist/LocalAI.dmg |
1943 | | - bash contrib/macos/sign-and-notarize.sh sign dist/LocalAI.dmg |
1944 | | - |
1945 | | -# Submit the DMG to Apple notarization and staple the ticket (no-op without notary secrets). |
1946 | | -notarize-launcher-darwin: dmg-launcher-darwin |
1947 | | - bash contrib/macos/sign-and-notarize.sh notarize dist/LocalAI.dmg |
1948 | | - |
1949 | | -# Single entrypoint for CI: build -> sign app -> notarize+staple app -> dmg -> sign dmg -> notarize+staple dmg. |
1950 | | -release-launcher-darwin: notarize-launcher-darwin |
1951 | | - @echo "dist/LocalAI.dmg is ready" |
1952 | | - |
1953 | | -build-launcher-linux: |
1954 | | - cd cmd/launcher && go run fyne.io/tools/cmd/fyne@latest package -os linux -icon ../../core/http/static/logo.png --executable $(LAUNCHER_BINARY_NAME)-linux --app-version $(LAUNCHER_APP_VERSION) && mv LocalAI.tar.xz ../../$(LAUNCHER_BINARY_NAME)-linux.tar.xz |
1955 | | - |
1956 | | -# Thin native launcher only; retains the first-run LocalAI runtime downloader. |
1957 | | -.PHONY: build-launcher-appimage test-launcher-appimage |
1958 | | -build-launcher-appimage: |
1959 | | - APPIMAGE_ARCH=$(or $(APPIMAGE_ARCH),amd64) bash contrib/appimage/build.sh |
1960 | | - |
1961 | | -test-launcher-appimage: |
1962 | | - python3 -m unittest discover -s contrib/appimage -p 'test_*.py' -v |
0 commit comments