saving bishop
parent
1dddf10476
commit
a1b1604489
@ -0,0 +1,95 @@
|
|||||||
|
# Variables
|
||||||
|
BINARY_NAME := bishop
|
||||||
|
BUILD_DIR := ./build
|
||||||
|
DIST_DIR := ./dist
|
||||||
|
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
||||||
|
BUILD_TIME := $(shell date -u '+%Y-%m-%d_%H:%M:%S')
|
||||||
|
GIT_COMMIT := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown")
|
||||||
|
DEB_PACKAGE_NAME := $(BINARY_NAME)_$(VERSION)_amd64.deb
|
||||||
|
|
||||||
|
# Default target
|
||||||
|
.PHONY: all
|
||||||
|
all: build
|
||||||
|
|
||||||
|
# Build the binary
|
||||||
|
.PHONY: build
|
||||||
|
build:
|
||||||
|
@echo "Building $(BINARY_NAME) version $(VERSION)..."
|
||||||
|
@mkdir -p $(BUILD_DIR)
|
||||||
|
@go build -ldflags "-X main.Version=$(VERSION) -X main.BuildTime=$(BUILD_TIME) -X main.GitCommit=$(GIT_COMMIT)" \
|
||||||
|
-o $(BUILD_DIR)/$(BINARY_NAME) .
|
||||||
|
|
||||||
|
# Clean build artifacts
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
@echo "Cleaning build artifacts..."
|
||||||
|
@rm -rf $(BUILD_DIR)
|
||||||
|
@rm -rf $(DIST_DIR)
|
||||||
|
|
||||||
|
# Build Debian package
|
||||||
|
.PHONY: deb
|
||||||
|
deb: build
|
||||||
|
@echo "Building Debian package..."
|
||||||
|
@mkdir -p $(DIST_DIR)
|
||||||
|
@mkdir -p $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)
|
||||||
|
@mkdir -p $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)/DEBIAN
|
||||||
|
@mkdir -p $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)/opt/bishop
|
||||||
|
|
||||||
|
# Copy binary
|
||||||
|
@cp $(BUILD_DIR)/$(BINARY_NAME) $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)/opt/bishop/
|
||||||
|
@chmod +x $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)/opt/bishop/$(BINARY_NAME)
|
||||||
|
|
||||||
|
# Create control file
|
||||||
|
@echo "Package: $(BINARY_NAME)" > $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)/DEBIAN/control
|
||||||
|
@echo "Version: $(VERSION)" >> $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)/DEBIAN/control
|
||||||
|
@echo "Architecture: amd64" >> $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)/DEBIAN/control
|
||||||
|
@echo "Maintainer: Bishop Maintainer <maintainer@example.com>" >> $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)/DEBIAN/control
|
||||||
|
@echo "Description: Bishop - A Go application" >> $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)/DEBIAN/control
|
||||||
|
@echo " Bishop is a Go application that provides various functionalities." >> $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)/DEBIAN/control
|
||||||
|
|
||||||
|
# Copy changelog if it exists
|
||||||
|
@if [ -f changelog ]; then \
|
||||||
|
cp changelog $(DIST_DIR)/$(BINARY_NAME)_$(VERSION)/DEBIAN/; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build the .deb package
|
||||||
|
@cd $(DIST_DIR) && dpkg-deb --build $(BINARY_NAME)_$(VERSION)
|
||||||
|
@mv $(DIST_DIR)/$(BINARY_NAME)_$(VERSION).deb $(DIST_DIR)/$(DEB_PACKAGE_NAME)
|
||||||
|
@echo "Debian package created: $(DIST_DIR)/$(DEB_PACKAGE_NAME)"
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
.PHONY: deps
|
||||||
|
deps:
|
||||||
|
@echo "Installing dependencies..."
|
||||||
|
@go mod download
|
||||||
|
|
||||||
|
# Run tests
|
||||||
|
.PHONY: test
|
||||||
|
test:
|
||||||
|
@echo "Running tests..."
|
||||||
|
@go test ./...
|
||||||
|
|
||||||
|
# Format code
|
||||||
|
.PHONY: fmt
|
||||||
|
fmt:
|
||||||
|
@echo "Formatting code..."
|
||||||
|
@go fmt ./...
|
||||||
|
|
||||||
|
# Lint code
|
||||||
|
.PHONY: lint
|
||||||
|
lint:
|
||||||
|
@echo "Linting code..."
|
||||||
|
@go vet ./...
|
||||||
|
|
||||||
|
# Show help
|
||||||
|
.PHONY: help
|
||||||
|
help:
|
||||||
|
@echo "Available targets:"
|
||||||
|
@echo " build - Build the binary in ./build directory"
|
||||||
|
@echo " deb - Build Debian package in ./dist directory"
|
||||||
|
@echo " clean - Clean build and dist directories"
|
||||||
|
@echo " deps - Install dependencies"
|
||||||
|
@echo " test - Run tests"
|
||||||
|
@echo " fmt - Format code"
|
||||||
|
@echo " lint - Lint code"
|
||||||
|
@echo " help - Show this help message"
|
@ -1,2 +1,23 @@
|
|||||||
# go-bishop
|
# go-bishop
|
||||||
|
|
||||||
|
Bishop is an experiment in speech processing in Golang
|
||||||
|
|
||||||
|
## Goals
|
||||||
|
|
||||||
|
- Kicking the tires of Golangs Onnx ecosystem
|
||||||
|
- Locally running Wake word detection(WWD), Voice Acitivity Detection (VAD), Automatic Speech Recognition(ASR).
|
||||||
|
- Embedded base models in binary
|
||||||
|
- Shipped as a .deb or in a tarball
|
||||||
|
|
||||||
|
### Model Considerations
|
||||||
|
|
||||||
|
#### WWD
|
||||||
|
- TBD
|
||||||
|
|
||||||
|
#### VAD
|
||||||
|
- Silero VAD?
|
||||||
|
|
||||||
|
#### ASR
|
||||||
|
- Whispher
|
||||||
|
- Sherpa (streaming audio)
|
||||||
|
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
bishop (1.0.0-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Initial release
|
||||||
|
* Basic Go application with version information
|
||||||
|
* Debian package support
|
||||||
|
|
||||||
|
-- Bishop Maintainer <maintainer@example.com> $(date -R)
|
@ -0,0 +1,3 @@
|
|||||||
|
module git.runcible.io/androiddrew/go-bishop
|
||||||
|
|
||||||
|
go 1.24.1
|
@ -0,0 +1,25 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"runtime/debug"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
Version = "dev"
|
||||||
|
BuildTime = "unknown"
|
||||||
|
GitCommit = "unknown"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fmt.Printf("Bishop Version: %s\n", Version)
|
||||||
|
fmt.Printf("Build Time: %s\n", BuildTime)
|
||||||
|
fmt.Printf("Git Commit: %s\n", GitCommit)
|
||||||
|
|
||||||
|
// Print build info if available
|
||||||
|
if info, ok := debug.ReadBuildInfo(); ok {
|
||||||
|
fmt.Printf("Go Version: %s\n", info.GoVersion)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("Hello Bishop")
|
||||||
|
}
|
Loading…
Reference in New Issue