Compare commits

..

8 Commits

Author SHA1 Message Date
Jeff Carr b3f63523b4 try to make this work again 2025-09-11 17:42:23 -05:00
Jeff Carr 3b559eff7e minor 2025-09-11 14:21:28 -05:00
Jeff Carr b46996bac2 common forge.Init() 2025-09-11 04:46:40 -05:00
Jeff Carr 8e67e31bbe new init & config() 2025-09-11 03:36:31 -05:00
Jeff Carr b3dc0e265e standard locations for everything 2025-03-12 13:18:11 -05:00
Jeff Carr 953a1cd5d5 empty this before rebuilding 2025-02-15 12:32:04 -06:00
Jeff Carr 7396af67a1 fixes for new gitpb 2024-12-17 07:09:22 -06:00
Jeff Carr edfa36b419 new attempt at this package 2024-12-14 22:15:13 -06:00
5 changed files with 52 additions and 126 deletions

View File

@ -1,12 +1,15 @@
.PHONY: debian
.PHONY: build
VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d)
all: build
@echo fixme
-rm -f go-gui*.deb
go-deb --gui andlabs gui
#./go-gui-toolkits
#ls -l ~/go/lib/go-gui/
build:
build: goimports
GO111MODULE=off go build \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
@ -18,94 +21,10 @@ install:
GO111MODULE=off go install \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
build:
goimports:
reset
goimports -w *.go
# Test the README.md & doc.go file
# this runs pkgsite, the binary that does dev.go.dev
# go install golang.org/x/pkgsite/cmd/pkgsite@latest
pkgsite:
GO111MODULE= pkgsite
redomod:
rm -f go.*
GO111MODULE= go mod init
GO111MODULE= go mod tidy
download:
go get -v go.wit.com/toolkits/debian
go get -v go.wit.com/toolkits/tree
go get -v go.wit.com/toolkits/nocui
go get -v go.wit.com/toolkits/gocui
go get -v go.wit.com/toolkits/andlabs
notes:
ifeq ($(GO111MODULE),)
@echo
@echo If you are compiling this here, you probably want to set GO111MODULE
@echo
@echo Setting GO111MODULE means that the version you are compiling has plugins
@echo that get compiled against this current running version of the code
@echo Otherwise, the GO language plugins can complain about being compiled against
@echo mis-matched versions
@echo
@echo export GO111MODULE=off
@echo
sleep 1
endif
make nocui gocui andlabs
nocui:
# go build -C nocui -v -buildmode=plugin -o ../nocui.so
make -C ../nocui
gocui:
# go build -C gocui -v -buildmode=plugin -o ../gocui.so
make -C ../gocui
andlabs:
# go build -C andlabs -v -buildmode=plugin -o ../andlabs.so
make -C ../andlabs
build-dep:
apt install -f libgtk-3-dev
# should update every go dependancy (?)
update:
git pull
go get -v -t -u ./...
debian:
cd debian && make
@#dpkg-deb -c ../go-gui-toolkit*.deb
@#-wit mirrors
goget:
go get -v -t -u
make -C toolkit/gocui goget
make -C toolkit/andlabs goget
clean:
rm -f ../*.so
cd debian && make clean
plugins: plugins-gocui plugins-andlabs
plugins-gocui:
go build -C toolkit/gocui -v -buildmode=plugin -o ../gocui.so
go build -C toolkit/nocui -v -buildmode=plugin -o ../nocui.so
plugins-andlabs:
go build -C toolkit/andlabs -v -buildmode=plugin -o ../andlabs.so
objdump:
objdump -t toolkit/andlabs.so |less
log:
reset
tail -f /tmp/witgui.* /tmp/guilogfile
submit-to-docs:
GOPROXY=https://proxy.golang.org GO111MODULE=on go get go.wit.com/gui@v1.0.0
rm -f ~/go/lib/go-gui/*.so
go-mod-clean purge

20
build
View File

@ -1,18 +1,8 @@
#!/bin/bash -x
make -C ../../toolkits/nocui
make -C ../../toolkits/gocui
make -C ../../toolkits/andlabs
make -C ../../toolkits/pixelgl
rm -rf ~/go/lib/*
go-gui-toolkits
ls -lt ~/go/lib/
mkdir -p files/usr/lib/go-gui
cp ../../toolkits/*.so files/usr/lib/go-gui/
# add the sources list file here until
# there is a seperate package for this
mkdir -p files/etc/apt/sources.list.d/
cp resources/wit.list files/etc/apt/sources.list.d/
# add the key for the wit repo
mkdir -p files/etc/apt/trusted.gpg.d/
cp resources/wit-public-key.asc files/etc/apt/trusted.gpg.d/
mkdir -p files/usr/lib/go-gui-toolkits
cp -a ~/go/lib/go-gui/*.so files/usr/lib/go-gui-toolkits/

View File

@ -1,3 +1,4 @@
Package: go-gui-toolkits
Maintainer: Jeff Carr <jcarr@wit.com>
Depends:
Architecture: amd64

18
exit.go Normal file
View File

@ -0,0 +1,18 @@
package main
import (
"os"
"go.wit.com/log"
)
func okExit(thing string) {
log.Info(thing, "ok")
// log.Info("Finished go-clean on", check.GetGoPath(), "ok")
os.Exit(0)
}
func badExit(err error) {
log.Info("go-gui-toolkits failed: ", err)
os.Exit(-1)
}

40
main.go
View File

@ -1,29 +1,27 @@
package main
import (
"go.wit.com/log"
"go.wit.com/gui"
import (
"go.wit.com/lib/protobuf/forgepb"
)
var myGui *gui.Node // This is the beginning of the binary tree of widgets
// go will sit here until the window exits
func main() {
myGui = gui.New().Default()
// myGui.LoadToolkit("nocui")
forge := forgepb.Init()
buildworld()
gui.Watchdog()
}
// This initializes the first window, a group and a button
func buildworld() {
window := myGui.NewWindow("build world")
box := window.NewBox("vbox", false)
group := box.NewGroup("groupy")
grid := group.NewGrid("gridiron", 2, 1)
grid.NewButton("build", func() {
log.Println("make something to build everything")
})
cmd := []string{"make", "install"}
if repo := forge.Repos.FindByNamespace("go.wit.com/toolkits/gocui"); repo != nil {
repo.RunVerbose(cmd)
}
if repo := forge.Repos.FindByNamespace("go.wit.com/toolkits/andlabs"); repo != nil {
repo.RunVerbose(cmd)
}
if repo := forge.Repos.FindByNamespace("go.wit.com/toolkits/nocui"); repo != nil {
repo.RunVerbose(cmd)
}
if repo := forge.Repos.FindByNamespace("go.wit.com/toolkits/fyne"); repo != nil {
repo.RunVerbose(cmd)
}
}