pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Fix build errors on NetBSD:



Module Name:	pkgsrc-wip
Committed By:	Rui-Xiang Guo <rxg%lavabit.com@localhost>
Pushed By:	rxg
Date:		Sun Jan 28 10:03:52 2024 +0800
Changeset:	162a5024ae479ba38884d09dcb18931d8b0fdd71

Modified Files:
	arduino-cli/DESCR
	arduino-cli/PLIST
	arduino-cli/TODO
	arduino-cli/distinfo
Added Files:
	arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__netbsd.go
	arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__resetbuf__linux__bsd.go
	arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__unix.go
	arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_unixutils_pipe.go
	arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_unixutils_select.go
	arduino-cli/patches/patch-executils_executils__netbsd.go
	arduino-cli/patches/patch-go.mod
	arduino-cli/patches/patch-i18n_detect__netbsd.go

Log Message:
Fix build errors on NetBSD:

go.bug.st/serial
../.gopath/pkg/mod/go.bug.st/serial@v1.6.1/serial_bsd.go:13:13: undefined: unixPort
../.gopath/pkg/mod/go.bug.st/serial@v1.6.1/serial.go:83:15: undefined: nativeOpen
../.gopath/pkg/mod/go.bug.st/serial@v1.6.1/serial.go:94:9: undefined: nativeGetPortsList
github.com/arduino/arduino-cli/i18n
i18n/detect.go:24:9: undefined: getLocaleIdentifier

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=162a5024ae479ba38884d09dcb18931d8b0fdd71

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 arduino-cli/DESCR                                  | 27 +------
 arduino-cli/PLIST                                  |  9 ++-
 arduino-cli/TODO                                   |  5 +-
 arduino-cli/distinfo                               |  8 ++
 ...ch-.._go.bug.st_serial@v1.6.1_serial__netbsd.go | 92 ++++++++++++++++++++++
 ...t_serial@v1.6.1_serial__resetbuf__linux__bsd.go | 13 +++
 ...atch-.._go.bug.st_serial@v1.6.1_serial__unix.go | 13 +++
 ...ch-.._go.bug.st_serial@v1.6.1_unixutils_pipe.go | 13 +++
 ...-.._go.bug.st_serial@v1.6.1_unixutils_select.go | 13 +++
 .../patches/patch-executils_executils__netbsd.go   | 26 ++++++
 arduino-cli/patches/patch-go.mod                   | 12 +++
 arduino-cli/patches/patch-i18n_detect__netbsd.go   | 25 ++++++
 12 files changed, 226 insertions(+), 30 deletions(-)

diffs:
diff --git a/arduino-cli/DESCR b/arduino-cli/DESCR
index 0e1c1d9637..8d720bafcb 100644
--- a/arduino-cli/DESCR
+++ b/arduino-cli/DESCR
@@ -1,23 +1,4 @@
-TODO: Adjust the following lines from README.md
-
-# arduino-cli
-
-![cli-logo](./docs/img/CLI_Logo_small.png)
-
-Arduino CLI is an all-in-one solution that provides Boards/Library Managers, sketch builder, board detection, uploader,
-and many other tools needed to use any Arduino compatible board and platform from command line or machine interfaces.
-
-[![Test Go status](https://github.com/arduino/arduino-cli/actions/workflows/test-go-task.yml/badge.svg)](https://github.com/arduino/arduino-cli/actions/workflows/test-go-task.yml)
-[![Publish Nightly Build status](https://github.com/arduino/arduino-cli/actions/workflows/publish-go-nightly-task.yml/badge.svg)](https://github.com/arduino/arduino-cli/actions/workflows/publish-go-nightly-task.yml)
-[![Deploy Website status](https://github.com/arduino/arduino-cli/actions/workflows/deploy-cobra-mkdocs-versioned-poetry.yml/badge.svg)](https://github.com/arduino/arduino-cli/actions/workflows/deploy-cobra-mkdocs-versioned-poetry.yml)
-[![Codecov](https://codecov.io/gh/arduino/arduino-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/arduino/arduino-cli)
-
-> **Note:** this software is currently under active development: anything can change at any time, API and UI must be
-> considered unstable until we release version 1.0.0.
-
-## Docs
-
-For guidance on installation and development, see the [User documentation].
-
-## Quickstart
-...
+Arduino CLI is an all-in-one solution that provides Boards/Library Managers,
+sketch builder, board detection, uploader, and many other tools needed to use
+any Arduino compatible board and platform from command line or machine
+interfaces.
diff --git a/arduino-cli/PLIST b/arduino-cli/PLIST
index 92ba51a2d7..3c89a2c855 100644
--- a/arduino-cli/PLIST
+++ b/arduino-cli/PLIST
@@ -1,4 +1,7 @@
 @comment $NetBSD$
-@comment TODO: to fill this file with the file listing:
-@comment TODO: 1. run "/usr/bin/make package"
-@comment TODO: 2. run "/usr/bin/make print-PLIST"
+bin/arduino-cli
+bin/client_example
+bin/cmd
+bin/discovery_client
+bin/docsgen
+bin/term_example
diff --git a/arduino-cli/TODO b/arduino-cli/TODO
index c415060073..26a4750cc3 100644
--- a/arduino-cli/TODO
+++ b/arduino-cli/TODO
@@ -1,4 +1 @@
-github.com/arduino/arduino-cli/i18n
-# github.com/arduino/arduino-cli/i18n
-i18n/detect.go:24:9: undefined: getLocaleIdentifier
-*** Error code 1
+functional testing
diff --git a/arduino-cli/distinfo b/arduino-cli/distinfo
index 5bb53bdadb..6c13ef5921 100644
--- a/arduino-cli/distinfo
+++ b/arduino-cli/distinfo
@@ -2121,3 +2121,11 @@ Size (rsc.io_quote_v3_@v_v3.1.0.mod) = 55 bytes
 BLAKE2s (rsc.io_sampler_@v_v1.3.0.mod) = 6d4d3ba7c381b9a923679a73562a7cf3d6b7d49f94f585f274c8955bb1b932b4
 SHA512 (rsc.io_sampler_@v_v1.3.0.mod) = 2137507eb25fbae419605e0cd6bca4cfa584110eebc276cd759a4dcb6f97e52928e5b2d9b276e76bcabcec3bbfc2c42f97fa29f54695d27fb00f9423e1638863
 Size (rsc.io_sampler_@v_v1.3.0.mod) = 88 bytes
+SHA1 (patch-.._go.bug.st_serial@v1.6.1_serial__netbsd.go) = 95708815d32deff2bf61f32cf3d704a5b483ba7e
+SHA1 (patch-.._go.bug.st_serial@v1.6.1_serial__resetbuf__linux__bsd.go) = f6401f8f4cbfb9c6101dcaed063a1669d0aee2eb
+SHA1 (patch-.._go.bug.st_serial@v1.6.1_serial__unix.go) = 70879cf840296299078c1cf8c942e624d6344ed5
+SHA1 (patch-.._go.bug.st_serial@v1.6.1_unixutils_pipe.go) = 1dcd9e7005d9fed673abe52ec128df81ba59e195
+SHA1 (patch-.._go.bug.st_serial@v1.6.1_unixutils_select.go) = f3d733aaf02ff85f5085aaf734d26066338bb5dd
+SHA1 (patch-executils_executils__netbsd.go) = 95ab98ab2c10fb4140a7477871331821e9e529ab
+SHA1 (patch-go.mod) = 8155f038fa0ca8e359b5da0c0e2f65208b7bcae5
+SHA1 (patch-i18n_detect__netbsd.go) = 83b9400dafb30fa72fd9f99e8bd45cfb9349fbc7
diff --git a/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__netbsd.go b/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__netbsd.go
new file mode 100644
index 0000000000..e0ca123a26
--- /dev/null
+++ b/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__netbsd.go
@@ -0,0 +1,92 @@
+$NetBSD$
+
+--- ../go.bug.st/serial@v1.6.1/serial_netbsd.go.orig	2024-01-28 00:47:19.919823960 +0000
++++ ../go.bug.st/serial@v1.6.1/serial_netbsd.go
+@@ -0,0 +1,87 @@
++//
++// Copyright 2014-2023 Cristian Maglie. All rights reserved.
++// Use of this source code is governed by a BSD-style
++// license that can be found in the LICENSE file.
++//
++
++package serial
++
++import "golang.org/x/sys/unix"
++
++const devFolder = "/dev"
++const regexFilter = "^(dty|tty)\\..*"
++
++// termios manipulation functions
++
++var baudrateMap = map[int]uint32{
++	0:      unix.B9600, // Default to 9600
++	50:     unix.B50,
++	75:     unix.B75,
++	110:    unix.B110,
++	134:    unix.B134,
++	150:    unix.B150,
++	200:    unix.B200,
++	300:    unix.B300,
++	600:    unix.B600,
++	1200:   unix.B1200,
++	1800:   unix.B1800,
++	2400:   unix.B2400,
++	4800:   unix.B4800,
++	9600:   unix.B9600,
++	19200:  unix.B19200,
++	38400:  unix.B38400,
++	57600:  unix.B57600,
++	115200: unix.B115200,
++	230400: unix.B230400,
++	460800: unix.B460800,
++	921600: unix.B921600,
++}
++
++var databitsMap = map[int]uint32{
++	0: unix.CS8, // Default to 8 bits
++	5: unix.CS5,
++	6: unix.CS6,
++	7: unix.CS7,
++	8: unix.CS8,
++}
++
++const tcCMSPAR uint32 = 0 // may be CMSPAR or PAREXT
++const tcIUCLC uint32 = 0
++
++const tcCCTS_OFLOW uint32 = 0x00010000
++const tcCRTS_IFLOW uint32 = 0x00020000
++
++const tcCRTSCTS uint32 = tcCCTS_OFLOW
++
++const ioctlTcgetattr = unix.TIOCGETA
++const ioctlTcsetattr = unix.TIOCSETA
++const ioctlTcflsh = unix.TIOCFLUSH
++const ioctlTioccbrk = unix.TIOCCBRK
++const ioctlTiocsbrk = unix.TIOCSBRK
++
++func toTermiosSpeedType(speed uint32) int32 {
++	return int32(speed)
++}
++
++func setTermSettingsBaudrate(speed int, settings *unix.Termios) (error, bool) {
++	baudrate, ok := baudrateMap[speed]
++	if !ok {
++		return nil, true
++	}
++	// XXX: Is Cflag really needed
++	// revert old baudrate
++	for _, rate := range baudrateMap {
++		settings.Cflag &^= rate
++	}
++	// set new baudrate
++	settings.Cflag |= baudrate
++
++	settings.Ispeed = toTermiosSpeedType(baudrate)
++	settings.Ospeed = toTermiosSpeedType(baudrate)
++	return nil, false
++}
++
++func (port *unixPort) setSpecialBaudrate(speed uint32) error {
++	// TODO: unimplemented
++	return &PortError{code: InvalidSpeed}
++}
diff --git a/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__resetbuf__linux__bsd.go b/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__resetbuf__linux__bsd.go
new file mode 100644
index 0000000000..e17f4f7b9d
--- /dev/null
+++ b/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__resetbuf__linux__bsd.go
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- ../go.bug.st/serial@v1.6.1/serial_resetbuf_linux_bsd.go.orig	2024-01-28 00:48:25.219422094 +0000
++++ ../go.bug.st/serial@v1.6.1/serial_resetbuf_linux_bsd.go
+@@ -4,7 +4,7 @@
+ // license that can be found in the LICENSE file.
+ //
+ 
+-//go:build linux || freebsd || openbsd
++//go:build linux || freebsd || netbsd || openbsd
+ 
+ package serial
+ 
diff --git a/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__unix.go b/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__unix.go
new file mode 100644
index 0000000000..381171b35b
--- /dev/null
+++ b/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_serial__unix.go
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- ../go.bug.st/serial@v1.6.1/serial_unix.go.orig	2024-01-28 00:49:55.881495066 +0000
++++ ../go.bug.st/serial@v1.6.1/serial_unix.go
+@@ -4,7 +4,7 @@
+ // license that can be found in the LICENSE file.
+ //
+ 
+-//go:build linux || darwin || freebsd || openbsd
++//go:build linux || darwin || freebsd || netbsd || openbsd
+ 
+ package serial
+ 
diff --git a/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_unixutils_pipe.go b/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_unixutils_pipe.go
new file mode 100644
index 0000000000..3b2c3f9f3c
--- /dev/null
+++ b/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_unixutils_pipe.go
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- ../go.bug.st/serial@v1.6.1/unixutils/pipe.go.orig	2024-01-28 00:52:11.742808166 +0000
++++ ../go.bug.st/serial@v1.6.1/unixutils/pipe.go
+@@ -4,7 +4,7 @@
+ // license that can be found in the LICENSE file.
+ //
+ 
+-//go:build linux || darwin || freebsd || openbsd
++//go:build linux || darwin || freebsd || netbsd || openbsd
+ 
+ package unixutils
+ 
diff --git a/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_unixutils_select.go b/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_unixutils_select.go
new file mode 100644
index 0000000000..b64ac8914e
--- /dev/null
+++ b/arduino-cli/patches/patch-.._go.bug.st_serial@v1.6.1_unixutils_select.go
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- ../go.bug.st/serial@v1.6.1/unixutils/select.go.orig	2024-01-28 00:53:25.346247430 +0000
++++ ../go.bug.st/serial@v1.6.1/unixutils/select.go
+@@ -4,7 +4,7 @@
+ // license that can be found in the LICENSE file.
+ //
+ 
+-//go:build linux || darwin || freebsd || openbsd
++//go:build linux || darwin || freebsd || netbsd || openbsd
+ 
+ package unixutils
+ 
diff --git a/arduino-cli/patches/patch-executils_executils__netbsd.go b/arduino-cli/patches/patch-executils_executils__netbsd.go
new file mode 100644
index 0000000000..ba4a72b1c8
--- /dev/null
+++ b/arduino-cli/patches/patch-executils_executils__netbsd.go
@@ -0,0 +1,26 @@
+$NetBSD$
+
+--- executils/executils_netbsd.go.orig	2024-01-28 00:41:35.190432655 +0000
++++ executils/executils_netbsd.go
+@@ -0,0 +1,21 @@
++// This file is part of arduino-cli.
++//
++// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
++//
++// This software is released under the GNU General Public License version 3,
++// which covers the main part of arduino-cli.
++// The terms of this license can be found at:
++// https://www.gnu.org/licenses/gpl-3.0.en.html
++//
++// You can be released from the requirements of the above licenses by purchasing
++// a commercial license. Buying such a license is mandatory if you want to
++// modify or otherwise use the software for commercial activities involving the
++// Arduino software without disclosing the source code of your own applications.
++// To purchase a commercial license, send an email to license%arduino.cc@localhost.
++
++package executils
++
++import "os/exec"
++
++func tellCommandNotToSpawnShell(_ *exec.Cmd) {
++}
diff --git a/arduino-cli/patches/patch-go.mod b/arduino-cli/patches/patch-go.mod
new file mode 100644
index 0000000000..450f2fec63
--- /dev/null
+++ b/arduino-cli/patches/patch-go.mod
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- go.mod.orig	2024-01-28 00:36:42.886410216 +0000
++++ go.mod
+@@ -4,6 +4,7 @@ go 1.21
+ 
+ // We must use this fork until https://github.com/mailru/easyjson/pull/372 is merged
+ replace github.com/mailru/easyjson => github.com/cmaglie/easyjson v0.8.1
++replace go.bug.st/serial v1.6.1 => ../go.bug.st/serial@v1.6.1
+ 
+ require (
+ 	github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371
diff --git a/arduino-cli/patches/patch-i18n_detect__netbsd.go b/arduino-cli/patches/patch-i18n_detect__netbsd.go
new file mode 100644
index 0000000000..badf21a4c4
--- /dev/null
+++ b/arduino-cli/patches/patch-i18n_detect__netbsd.go
@@ -0,0 +1,25 @@
+$NetBSD$
+
+--- i18n/detect_netbsd.go.orig	2024-01-28 00:43:33.666625579 +0000
++++ i18n/detect_netbsd.go
+@@ -0,0 +1,20 @@
++// This file is part of arduino-cli.
++//
++// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
++//
++// This software is released under the GNU General Public License version 3,
++// which covers the main part of arduino-cli.
++// The terms of this license can be found at:
++// https://www.gnu.org/licenses/gpl-3.0.en.html
++//
++// You can be released from the requirements of the above licenses by purchasing
++// a commercial license. Buying such a license is mandatory if you want to
++// modify or otherwise use the software for commercial activities involving the
++// Arduino software without disclosing the source code of your own applications.
++// To purchase a commercial license, send an email to license%arduino.cc@localhost.
++
++package i18n
++
++func getLocaleIdentifier() string {
++	return getLocaleIdentifierFromEnv()
++}


Home | Main Index | Thread Index | Old Index