~sirmorrison


#421 Dynamic Border Radius. 1 year, 3 months ago

Comment by ~sirmorrison on ~eliasnaur/gio

Hello

Thanks for the prompt feedback.

Looking through most of the widgets like the button widget, I see we stuck with a fixed border radius, meaning I either use a squared box or chamfered on all edges.

I feel this is too rigid. What if I want a button with the top left and top right edges curved and have the bottom left and bottom right edges squared?

It seems you don’t give me much of a choice in this regard.

We currently have a card widget for rendering blocks, and it is coverable too.

type Card struct {
	layout.Inset
	Color      color.NRGBA
	HoverColor color.NRGBA
	Radius     CornerRadius
}

type CornerRadius struct {
	TopLeft     float32
	TopRight    float32
	BottomRight float32
	BottomLeft  float32
}

func Radius(radius float32) CornerRadius {
	return CornerRadius{
		TopLeft:     radius,
		TopRight:    radius,
		BottomRight: radius,
		BottomLeft:  radius,
	}
}

func TopRadius(radius float32) CornerRadius {
	return CornerRadius{
		TopLeft:  radius,
		TopRight: radius,
	}
}

func BottomRadius(radius float32) CornerRadius {
	return CornerRadius{
		BottomRight: radius,
		BottomLeft:  radius,
	}
}

const (
	defaultRadius = 14
)

func (t *Theme) Card() Card {
	return Card{
		Color:      t.Color.Surface,
		HoverColor: t.Color.Gray4,
		Radius:     Radius(defaultRadius),
	}
}

func (c Card) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
	dims := c.Inset.Layout(gtx, func(gtx C) D {
		return layout.Stack{}.Layout(gtx,
			layout.Expanded(func(gtx C) D {
				tr := gtx.Dp(unit.Dp(c.Radius.TopRight))
				tl := gtx.Dp(unit.Dp(c.Radius.TopLeft))
				br := gtx.Dp(unit.Dp(c.Radius.BottomRight))
				bl := gtx.Dp(unit.Dp(c.Radius.BottomLeft))
				defer clip.RRect{
					Rect: image.Rectangle{Max: image.Point{
						X: gtx.Constraints.Min.X,
						Y: gtx.Constraints.Min.Y,
					}},
					NW: tl, NE: tr, SE: br, SW: bl,
				}.Push(gtx.Ops).Pop()
				return fill(gtx, c.Color)
			}),
			layout.Stacked(w),
		)
	})

	return dims
}

func (c Card) HoverableLayout(gtx layout.Context, btn *Clickable, w layout.Widget) layout.Dimensions {
	background := c.Color
	dims := c.Inset.Layout(gtx, func(gtx C) D {
		return layout.Stack{}.Layout(gtx,
			layout.Expanded(func(gtx C) D {
				tr := gtx.Dp(unit.Dp(c.Radius.TopRight))
				tl := gtx.Dp(unit.Dp(c.Radius.TopLeft))
				br := gtx.Dp(unit.Dp(c.Radius.BottomRight))
				bl := gtx.Dp(unit.Dp(c.Radius.BottomLeft))
				defer clip.RRect{
					Rect: image.Rectangle{Max: image.Point{
						X: gtx.Constraints.Min.X,
						Y: gtx.Constraints.Min.Y,
					}},
					NW: tl, NE: tr, SE: br, SW: bl,
				}.Push(gtx.Ops).Pop()

				if btn.Hoverable && btn.button.Hovered() {
					background = btn.style.HoverColor
				}

				return fill(gtx, background)
			}),
			layout.Stacked(w),
		)
	})

	return dims
}

For this, we would like radius to be dynamic.

I just feel it will make working with Gioui more convenient with me having to write too many custom widgets.

On 2 Jun 2022, at 11:39, ~eliasnaur outgoing@sr.ht wrote:

It's useful. The question is whether it's useful enough to warrant inclusion in package widget. How often do you need it? Maybe ~whereswaldon has some intuition of the need as well.

-- View on the web: https://todo.sr.ht/~eliasnaur/gio/421#event-177463

#421 Dynamic Border Radius. 1 year, 3 months ago

Ticket created by ~sirmorrison on ~eliasnaur/gio

Hello @gioui team,

I believe it would be nice to have a dynamic border with dynamic radius. Currently, on Godcr, we have something implemented that could help.

// Border lays out a widget and draws a border inside it.
type Border struct {
	Color  color.NRGBA
	Radius CornerRadius
	Width  unit.Dp
}

func (b Border) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
	dims := w(gtx)
	sz := dims.Size

	width := gtx.Dp(b.Width)
	sz.X -= width
	sz.Y -= width

	r := image.Rectangle{Max: sz}
	r = r.Add(image.Point{X: width * 0.5, Y: width * 0.5})

	tr := float32(gtx.Dp(unit.Dp(b.Radius.TopRight)))
	tl := float32(gtx.Dp(unit.Dp(b.Radius.TopLeft)))
	br := float32(gtx.Dp(unit.Dp(b.Radius.BottomRight)))
	bl := float32(gtx.Dp(unit.Dp(b.Radius.BottomLeft)))
	radius := clip.RRect{
		Rect: r,
		NW:   tl, NE: tr, SE: br, SW: bl,
	}

	paint.FillShape(gtx.Ops,
		b.Color,
		clip.Stroke{
			Path:  radius.Path(gtx.Ops),
			Width: width,
		}.Op(),
	)

	return dims
}

This way we can decide the redius for all 4 corners of the border rather than just one for all.

Warm regards

#165 Gio cross-compilation for linux, build gioui.org/app/internal/glimpl: cannot load gioui.org/app/internal/glimpl: no Go source files 2 years ago

Comment by ~sirmorrison on ~eliasnaur/gio

Done.

#165 Gio cross-compilation for linux, build gioui.org/app/internal/glimpl: cannot load gioui.org/app/internal/glimpl: no Go source files 2 years ago

Comment by ~sirmorrison on ~eliasnaur/gio

CGO_ENABLED=1 GOOS=linux GOARCH=ppc64le go build -o godcr-linux-ppc64le

#runtime/cgo

gcc_linux_ppc64x.S:27:7: error: invalid register name mflr %r0 ^ gcc_linux_ppc64x.S:28:6: error: invalid register name std %r0, 16(%r1) ^ gcc_linux_ppc64x.S:29:6: error: invalid register name std %r2, 24(%r1) ^ gcc_linux_ppc64x.S:30:2: error: invalid instruction mnemonic 'bl' bl saveregs ^~ gcc_linux_ppc64x.S:31:7: error: invalid register name stdu %r1, -296(%r1) ^ gcc_linux_ppc64x.S:34:2: error: invalid instruction mnemonic 'bl' bl _cgo_reginit ^~ gcc_linux_ppc64x.S:38:5: error: invalid register name mr %r30, %r4 ^~ gcc_linux_ppc64x.S:41:11: error: invalid register name mr %r12, %r3 ^ gcc_linux_ppc64x.S:42:8: error: invalid register name mtctr %r3 ^ gcc_linux_ppc64x.S:43:2: error: invalid instruction mnemonic 'bctrl' bctrl ^ gcc_linux_ppc64x.S:45:7: error: invalid register name addi %r1, %r1, 296 ^ gcc_linux_ppc64x.S:46:2: error: invalid instruction mnemonic 'bl' bl restoreregs ^~ gcc_linux_ppc64x.S:47:5: error: invalid register name ld %r2, 24(%r1) ^ gcc_linux_ppc64x.S:48:5: error: invalid register name ld %r0, 16(%r1) ^ gcc_linux_ppc64x.S:49:7: error: invalid register name mtlr %r0 ^ gcc_linux_ppc64x.S:50:2: error: invalid instruction mnemonic 'blr' blr ^ gcc_linux_ppc64x.S:55:17: error: invalid register name std %r14, -288(%r1) ^ gcc_linux_ppc64x.S:56:17: error: invalid register name std %r15, -280(%r1) ^ gcc_linux_ppc64x.S:57:6: error: invalid register name std %r16, -272(%r1) ^~ gcc_linux_ppc64x.S:58:6: error: invalid register name std %r17, -264(%r1) ^~ gcc_linux_ppc64x.S:59:6: error: invalid register name std %r18, -256(%r1) ^~ gcc_linux_ppc64x.S:60:6: error: invalid register name std %r19, -248(%r1) ^~ gcc_linux_ppc64x.S:61:6: error: invalid register name std %r20, -240(%r1) ^~ gcc_linux_ppc64x.S:62:6: error: invalid register name std %r21, -232(%r1) ^~ gcc_linux_ppc64x.S:63:6: error: invalid register name std %r22, -224(%r1) ^~ gcc_linux_ppc64x.S:64:6: error: invalid register name std %r23, -216(%r1) ^~ gcc_linux_ppc64x.S:65:6: error: invalid register name std %r24, -208(%r1) ^~ gcc_linux_ppc64x.S:66:6: error: invalid register name std %r25, -200(%r1) ^~ gcc_linux_ppc64x.S:67:6: error: invalid register name std %r26, -192(%r1) ^~ gcc_linux_ppc64x.S:68:6: error: invalid register name std %r27, -184(%r1) ^~ gcc_linux_ppc64x.S:69:6: error: invalid register name std %r28, -176(%r1) ^~ gcc_linux_ppc64x.S:70:6: error: invalid register name std %r29, -168(%r1) ^~ gcc_linux_ppc64x.S:71:6: error: invalid register name std %r30, -160(%r1) ^~ gcc_linux_ppc64x.S:72:6: error: invalid register name std %r31, -152(%r1) ^~ gcc_linux_ppc64x.S:73:7: error: invalid register name stfd %f14, -144(%r1) ^~ gcc_linux_ppc64x.S:74:7: error: invalid register name stfd %f15, -136(%r1) ^~ gcc_linux_ppc64x.S:75:7: error: invalid register name stfd %f16, -128(%r1) ^~ gcc_linux_ppc64x.S:76:7: error: invalid register name stfd %f17, -120(%r1) ^~ gcc_linux_ppc64x.S:77:7: error: invalid register name stfd %f18, -112(%r1) ^~ gcc_linux_ppc64x.S:78:7: error: invalid register name stfd %f19, -104(%r1) ^~ gcc_linux_ppc64x.S:79:7: error: invalid register name stfd %f20, -96(%r1) ^~ gcc_linux_ppc64x.S:80:7: error: invalid register name stfd %f21, -88(%r1) ^~ gcc_linux_ppc64x.S:81:7: error: invalid register name stfd %f22, -80(%r1) ^~ gcc_linux_ppc64x.S:82:7: error: invalid register name stfd %f23, -72(%r1) ^~ gcc_linux_ppc64x.S:83:7: error: invalid register name stfd %f24, -64(%r1) ^~ gcc_linux_ppc64x.S:84:7: error: invalid register name stfd %f25, -56(%r1) ^~ gcc_linux_ppc64x.S:85:7: error: invalid register name stfd %f26, -48(%r1) ^~ gcc_linux_ppc64x.S:86:7: error: invalid register name stfd %f27, -40(%r1) ^~ gcc_linux_ppc64x.S:87:7: error: invalid register name stfd %f28, -32(%r1) ^~ gcc_linux_ppc64x.S:88:7: error: invalid register name stfd %f29, -24(%r1) ^~ gcc_linux_ppc64x.S:89:7: error: invalid register name stfd %f30, -16(%r1) ^~ gcc_linux_ppc64x.S:90:7: error: invalid register name stfd %f31, -8(%r1) ^~ gcc_linux_ppc64x.S:92:2: error: invalid instruction mnemonic 'blr'

#165 Gio cross-compilation for linux, build gioui.org/app/internal/glimpl: cannot load gioui.org/app/internal/glimpl: no Go source files 2 years ago

Comment by ~sirmorrison on ~eliasnaur/gio

What is your OS and Go version? go version go1.13.5 darwin/amd64

This out are for different platforms, linux, freebsd, openbsd etc.

CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o godcr-linux-amd64

#pkg-config --cflags -- xkbcommon

Package xkbcommon was not found in the pkg-config search path. Perhaps you should add the directory containing `xkbcommon.pc' to the PKG_CONFIG_PATH environment variable No package 'xkbcommon' found pkg-config: exit status 1

#pkg-config --cflags -- glesv2

Package glesv2 was not found in the pkg-config search path. Perhaps you should add the directory containing `glesv2.pc' to the PKG_CONFIG_PATH environment variable No package 'glesv2' found pkg-config: exit status 1

#os/user

/usr/local/go/src/os/user/getgrouplist_unix.go:16:35: warning: passing 'gid_t *' (aka 'unsigned int *') to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:650:43: note: passing argument to parameter here

CGO_ENABLED=1 GOOS=linux GOARCH=386 go build -o godcr-linux-386

#runtime/cgo

ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS) ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libpthread.tbd, missing required architecture i386 in file /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libpthread.tbd Undefined symbols for architecture i386: "___stack_chk_fail", referenced from: _x_cgo_init in _x006.o __cgo_sys_thread_start in _x006.o "___stack_chk_guard", referenced from: _x_cgo_init in _x006.o __cgo_sys_thread_start in _x006.o "___stderrp", referenced from: _fatalf in _x004.o _x_cgo_sys_thread_create.cold.1 in _x005.o _x_cgo_thread_start.cold.1 in _x009.o _fatalf in _x004.o _x_cgo_sys_thread_create.cold.1 in _x005.o _x_cgo_thread_start.cold.1 in _x009.o _fatalf in _x004.o _x_cgo_sys_thread_create.cold.1 in _x005.o _x_cgo_thread_start.cold.1 in _x009.o "_abort", referenced from: _fatalf in _x004.o _x_cgo_sys_thread_create.cold.1 in _x005.o _x_cgo_thread_start.cold.1 in _x009.o "_fprintf", referenced from: _x_cgo_sys_thread_create.cold.1 in _x005.o "_free", referenced from: _threadentry in _x006.o "_fwrite$UNIX2003", referenced from: _fatalf in _x004.o _x_cgo_thread_start.cold.1 in _x009.o "_malloc", referenced from: _x_cgo_thread_start in _x009.o "_nanosleep$UNIX2003", referenced from: _x_cgo_sys_thread_create in _x005.o __cgo_try_pthread_create in _x005.o "_pthread_attr_destroy", referenced from: _x_cgo_init in _x006.o "_pthread_attr_getstacksize", referenced from: _x_cgo_init in _x006.o __cgo_sys_thread_start in _x006.o "_pthread_attr_init", referenced from: _x_cgo_init in _x006.o __cgo_sys_thread_start in _x006.o "_pthread_cond_broadcast", referenced from: _x_cgo_notify_runtime_init_done in _x005.o "_pthread_cond_wait$UNIX2003", referenced from: __cgo_wait_runtime_init_done in _x005.o "_pthread_create", referenced from: _x_cgo_sys_thread_create in _x005.o __cgo_try_pthread_create in _x005.o (maybe you meant: __cgo_try_pthread_create) "_pthread_detach", referenced from: _x_cgo_sys_thread_create in _x005.o __cgo_try_pthread_create in _x005.o "_pthread_mutex_lock", referenced from: __cgo_wait_runtime_init_done in _x005.o _x_cgo_notify_runtime_init_done in _x005.o _x_cgo_set_context_function in _x005.o __cgo_get_context_function in _x005.o "_pthread_mutex_unlock", referenced from: __cgo_wait_runtime_init_done in _x005.o _x_cgo_notify_runtime_init_done in _x005.o _x_cgo_set_context_function in _x005.o __cgo_get_context_function in _x005.o "_pthread_sigmask$UNIX2003", referenced from: __cgo_sys_thread_start in _x006.o "_setenv$UNIX2003", referenced from: _x_cgo_setenv in _x007.o "_strerror$UNIX2003", referenced from: _x_cgo_sys_thread_create.cold.1 in _x005.o __cgo_sys_thread_start in _x006.o "_unsetenv$UNIX2003", referenced from: _x_cgo_unsetenv in _x007.o "_vfprintf", referenced from: _fatalf in _x004.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

CGO_ENABLED=1 GOOS=linux GOARCH=ppc64 go build -o godcr-linux-ppc64

#runtime/cgo

gcc_linux_ppc64x.S:27:7: error: invalid register name mflr %r0 ^ gcc_linux_ppc64x.S:28:6: error: invalid register name std %r0, 16(%r1) ^ gcc_linux_ppc64x.S:29:6: error: invalid register name std %r2, 24(%r1) ^ gcc_linux_ppc64x.S:30:2: error: invalid instruction mnemonic 'bl' bl saveregs ^~ gcc_linux_ppc64x.S:31:7: error: invalid register name stdu %r1, -296(%r1) ^ gcc_linux_ppc64x.S:34:2: error: invalid instruction mnemonic 'bl' bl _cgo_reginit ^~ gcc_linux_ppc64x.S:38:5: error: invalid register name mr %r30, %r4 ^~ gcc_linux_ppc64x.S:41:11: error: invalid register name mr %r12, %r3 ^ gcc_linux_ppc64x.S:42:8: error: invalid register name mtctr %r3 ^ gcc_linux_ppc64x.S:43:2: error: invalid instruction mnemonic 'bctrl' bctrl ^ gcc_linux_ppc64x.S:45:7: error: invalid register name addi %r1, %r1, 296 ^ gcc_linux_ppc64x.S:46:2: error: invalid instruction mnemonic 'bl' bl restoreregs ^~ gcc_linux_ppc64x.S:47:5: error: invalid register name ld %r2, 24(%r1) ^ gcc_linux_ppc64x.S:48:5: error: invalid register name ld %r0, 16(%r1) ^ gcc_linux_ppc64x.S:49:7: error: invalid register name mtlr %r0 ^ gcc_linux_ppc64x.S:50:2: error: invalid instruction mnemonic 'blr' blr ^ gcc_linux_ppc64x.S:55:17: error: invalid register name std %r14, -288(%r1) ^ gcc_linux_ppc64x.S:56:17: error: invalid register name std %r15, -280(%r1) ^ gcc_linux_ppc64x.S:57:6: error: invalid register name std %r16, -272(%r1) ^~ gcc_linux_ppc64x.S:58:6: error: invalid register name std %r17, -264(%r1) ^~ gcc_linux_ppc64x.S:59:6: error: invalid register name std %r18, -256(%r1) ^~ gcc_linux_ppc64x.S:60:6: error: invalid register name std %r19, -248(%r1) ^~ gcc_linux_ppc64x.S:61:6: error: invalid register name std %r20, -240(%r1) ^~ gcc_linux_ppc64x.S:62:6: error: invalid register name std %r21, -232(%r1) ^~ gcc_linux_ppc64x.S:63:6: error: invalid register name std %r22, -224(%r1) ^~ gcc_linux_ppc64x.S:64:6: error: invalid register name std %r23, -216(%r1) ^~ gcc_linux_ppc64x.S:65:6: error: invalid register name std %r24, -208(%r1) ^~ gcc_linux_ppc64x.S:66:6: error: invalid register name std %r25, -200(%r1) ^~ gcc_linux_ppc64x.S:67:6: error: invalid register name std %r26, -192(%r1) ^~ gcc_linux_ppc64x.S:68:6: error: invalid register name std %r27, -184(%r1) ^~ gcc_linux_ppc64x.S:69:6: error: invalid register name std %r28, -176(%r1) ^~ gcc_linux_ppc64x.S:70:6: error: invalid register name std %r29, -168(%r1) ^~ gcc_linux_ppc64x.S:71:6: error: invalid register name std %r30, -160(%r1) ^~ gcc_linux_ppc64x.S:72:6: error: invalid register name std %r31, -152(%r1) ^~ gcc_linux_ppc64x.S:73:7: error: invalid register name stfd %f14, -144(%r1) ^~ gcc_linux_ppc64x.S:74:7: error: invalid register name stfd %f15, -136(%r1) ^~ gcc_linux_ppc64x.S:75:7: error: invalid register name stfd %f16, -128(%r1) ^~ gcc_linux_ppc64x.S:76:7: error: invalid register name stfd %f17, -120(%r1) ^~ gcc_linux_ppc64x.S:77:7: error: invalid register name stfd %f18, -112(%r1) ^~ gcc_linux_ppc64x.S:78:7: error: invalid register name stfd %f19, -104(%r1) ^~ gcc_linux_ppc64x.S:79:7: error: invalid register name stfd %f20, -96(%r1) ^~ gcc_linux_ppc64x.S:80:7: error: invalid register name stfd %f21, -88(%r1) ^~ gcc_linux_ppc64x.S:81:7: error: invalid register name stfd %f22, -80(%r1) ^~ gcc_linux_ppc64x.S:82:7: error: invalid register name stfd %f23, -72(%r1) ^~ gcc_linux_ppc64x.S:83:7: error: invalid register name stfd %f24, -64(%r1) ^~ gcc_linux_ppc64x.S:84:7: error: invalid register name stfd %f25, -56(%r1) ^~ gcc_linux_ppc64x.S:85:7: error: invalid register name stfd %f26, -48(%r1) ^~ gcc_linux_ppc64x.S:86:7: error: invalid register name stfd %f27, -40(%r1) ^~ gcc_linux_ppc64x.S:87:7: error: invalid register name stfd %f28, -32(%r1) ^~ gcc_linux_ppc64x.S:88:7: error: invalid register name stfd %f29, -24(%r1) ^~ gcc_linux_ppc64x.S:89:7: error: invalid register name stfd %f30, -16(%r1) ^~ gcc_linux_ppc64x.S:90:7: error: invalid register name stfd %f31, -8(%r1) ^~ gcc_linux_ppc64x.S:92:2: error: invalid instruction mnemonic 'blr' blr ^ gcc_linux_ppc64x.S:96:16: error: invalid register name ld %r14, -288(%r1) ^ gcc_linux_ppc64x.S:97:16: error: invalid register name ld %r15, -280(%r1) ^ gcc_linux_ppc64x.S:98:5: error: invalid register name ld %r16, -272(%r1) ^~ gcc_linux_ppc64x.S:99:5: error: invalid register name ld %r17, -264(%r1) ^~ gcc_linux_ppc64x.S:100:5: error: invalid register name ld %r18, -256(%r1) ^~ gcc_linux_ppc64x.S:101:5: error: invalid register name ld %r19, -248(%r1) ^~ gcc_linux_ppc64x.S:102:5: error: invalid register name ld %r20, -240(%r1) ^~ gcc_linux_ppc64x.S:103:5: error: invalid register name ld %r21, -232(%r1) ^~ gcc_linux_ppc64x.S:104:5: error: invalid register name ld %r22, -224(%r1) ^~ gcc_linux_ppc64x.S:105:5: error: invalid register name ld %r23, -216(%r1) ^~ gcc_linux_ppc64x.S:106:5: error: invalid register name ld %r24, -208(%r1) ^~ gcc_linux_ppc64x.S:107:5: error: invalid register name ld %r25, -200(%r1) ^~ gcc_linux_ppc64x.S:108:5: error: invalid register name ld %r26, -192(%r1) ^~ gcc_linux_ppc64x.S:109:5: error: invalid register name ld %r27, -184(%r1) ^~ gcc_linux_ppc64x.S:110:5: error: invalid register name ld %r28, -176(%r1) ^~ gcc_linux_ppc64x.S:111:5: error: invalid register name ld %r29, -168(%r1) ^~ gcc_linux_ppc64x.S:112:5: error: invalid register name ld %r30, -160(%r1) ^~ gcc_linux_ppc64x.S:113:5: error: invalid register name ld %r31, -152(%r1) ^~ gcc_linux_ppc64x.S:114:6: error: invalid register name lfd %f14, -144(%r1) ^~ gcc_linux_ppc64x.S:115:6: error: invalid register name lfd %f15, -136(%r1) ^~ gcc_linux_ppc64x.S:116:6: error: invalid register name lfd %f16, -128(%r1) ^~ gcc_linux_ppc64x.S:117:6: error: invalid register name lfd %f17, -120(%r1) ^~ gcc_linux_ppc64x.S:118:6: error: invalid register name lfd %f18, -112(%r1) ^~ gcc_linux_ppc64x.S:119:6: error: invalid register name lfd %f19, -104(%r1) ^~ gcc_linux_ppc64x.S:120:6: error: invalid register name lfd %f20, -96(%r1) ^~ gcc_linux_ppc64x.S:121:6: error: invalid register name lfd %f21, -88(%r1) ^~ gcc_linux_ppc64x.S:122:6: error: invalid register name lfd %f22, -80(%r1) ^~ gcc_linux_ppc64x.S:123:6: error: invalid register name lfd %f23, -72(%r1) ^~ gcc_linux_ppc64x.S:124:6: error: invalid register name lfd %f24, -64(%r1) ^~ gcc_linux_ppc64x.S:125:6: error: invalid register name lfd %f25, -56(%r1) ^~ gcc_linux_ppc64x.S:126:6: error: invalid register name lfd %f26, -48(%r1) ^~ gcc_linux_ppc64x.S:127:6: error: invalid register name lfd %f27, -40(%r1) ^~ gcc_linux_ppc64x.S:128:6: error: invalid register name lfd %f28, -32(%r1) ^~ gcc_linux_ppc64x.S:129:6: error: invalid register name lfd %f29, -24(%r1) ^~ gcc_linux_ppc64x.S:130:6: error: invalid register name lfd %f30, -16(%r1) ^~ gcc_linux_ppc64x.S:131:6: error: invalid register name lfd %f31, -8(%r1) ^~~~ gcc_linux_ppc64x.S:133:2: error: invalid instruction mnemonic 'blr' blr

#165 Gio cross-compilation for linux, build gioui.org/app/internal/glimpl: cannot load gioui.org/app/internal/glimpl: no Go source files 2 years ago

Ticket created by ~sirmorrison on ~eliasnaur/gio

Hello,

So I am having issues cross compiling for linux and other platforms as I get the above error.

Following the comment on https://lists.sr.ht/~eliasnaur/gio/%3C1591186246741.35915%40wil.waw.pl%3E, you recommended that CGO_ENABLED be set to 1, I have done that and this does not seem to resolve this issue for me.

Is there something I am missing?

<<< Error log >>>

GOOS=linux GOARCH=amd64 go build -o godcr-linux-amd64 build gioui.org/app/internal/glimpl: cannot load gioui.org/app/internal/glimpl: no Go source files GOOS=linux GOARCH=386 go build -o godcr-linux-386 build gioui.org/app/internal/glimpl: cannot load gioui.org/app/internal/glimpl: no Go source files GOOS=linux GOARCH=ppc64 go build -o godcr-linux-ppc64 build gioui.org/app/internal/glimpl: cannot load gioui.org/app/internal/glimpl: no Go source files GOOS=linux GOARCH=ppc64le go build -o godcr-linux-ppc64le build gioui.org/app/internal/glimpl: cannot load gioui.org/app/internal/glimpl: no Go source files GOOS=linux GOARCH=mips64 go build -o godcr-linux-mips64 build gioui.org/app/internal/glimpl: cannot load gioui.org/app/internal/glimpl: no Go source files GOOS=linux GOARCH=mips64le go build -o godcr-linux-mips64le build gioui.org/app/internal/glimpl: cannot load gioui.org/app/internal/glimpl: no Go source files GOOS=freebsd GOARCH=amd64 go build -o godcr-freebsd-amd64 build gioui.org/app/internal/glimpl: cannot load gioui.org/app/internal/glimpl: no Go source files