Skip to content

Commit bb59476

Browse files
timlinuxclaude
andcommitted
Add CGO build tags for systray and update flake version
- Add //go:build cgo tag to systray.go for CGO-enabled builds - Add systray_nocgo.go stub for non-CGO cross-platform builds - Update flake.nix version to 0.7.1 - Allows cross-compilation without CGO (systray disabled) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e7f8a7c commit bb59476

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
flake-utils.lib.eachDefaultSystem (system:
1111
let
1212
pkgs = nixpkgs.legacyPackages.${system};
13-
version = "0.1.0";
13+
version = "0.7.1";
1414

1515
# MkDocs with Material theme for documentation
1616
mkdocsEnv = pkgs.python3.withPackages (ps: with ps; [

internal/systray/systray.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build cgo
2+
13
package systray
24

35
import (

internal/systray/systray_nocgo.go

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
//go:build !cgo
2+
3+
package systray
4+
5+
import (
6+
"fmt"
7+
"time"
8+
)
9+
10+
// Stub implementation for non-CGO builds
11+
// System tray functionality requires CGO and is not available in this build.
12+
13+
type TrayState int
14+
15+
const (
16+
StateIdle TrayState = iota
17+
StateRecording
18+
StatePaused
19+
StateProcessing
20+
)
21+
22+
type RecordingInfo struct {
23+
Monitor string
24+
StartTime time.Time
25+
IsPaused bool
26+
}
27+
28+
type Manager struct{}
29+
30+
func New() *Manager {
31+
return &Manager{}
32+
}
33+
34+
func (m *Manager) StartChan() <-chan struct{} { return make(chan struct{}) }
35+
func (m *Manager) StopChan() <-chan struct{} { return make(chan struct{}) }
36+
func (m *Manager) PauseChan() <-chan struct{} { return make(chan struct{}) }
37+
func (m *Manager) TUIChan() <-chan struct{} { return make(chan struct{}) }
38+
func (m *Manager) QuitChan() <-chan struct{} { return make(chan struct{}) }
39+
func (m *Manager) OnReady() {}
40+
func (m *Manager) OnExit() {}
41+
func (m *Manager) SetRecordingActive(string, time.Time) {}
42+
func (m *Manager) SetRecordingPaused() {}
43+
func (m *Manager) SetIdle() {}
44+
func (m *Manager) SetProcessing() {}
45+
func (m *Manager) StartRecording() error { return fmt.Errorf("systray not available: built without CGO") }
46+
func (m *Manager) StopRecording() error { return fmt.Errorf("systray not available: built without CGO") }
47+
func (m *Manager) PauseRecording() error { return fmt.Errorf("systray not available: built without CGO") }
48+
func (m *Manager) OpenTUI() error { return fmt.Errorf("systray not available: built without CGO") }
49+
50+
func Run() {
51+
fmt.Println("System tray not available: this build was compiled without CGO support.")
52+
fmt.Println("Use 'kartoza-screencaster' (TUI mode) instead.")
53+
}
54+
55+
func RunWithHandler() {
56+
Run()
57+
}

0 commit comments

Comments
 (0)