How do I install lua dev libraries on MacOS? [closed] - macos

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I need to install liblua5.3-dev for compiling a code project called Domoticz. I tried using 'brew' and 'luarocks' but it seems it doesn't provide me the development libraries but only a runtime/interpretor.
How do I install liblua5.3-dev on macOS (Catalina)?

You should just try the official way:
curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz
tar zxf lua-5.3.5.tar.gz
cd lua-5.3.5
make macosx test

Related

Is there a canonical way to add build scripts to a Go project? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 10 months ago.
Improve this question
Coming from the Node.js world, whenever you need a script (such as a build script there), a very common way of handling this is by adding it to the scripts block in the package.json file, so that you can the script by calling npm run <scriptname>. In other words, Node.js (respectively npm) has a built-in way to deal with (simple) scripts.
Does an equivalent to this exist in the Go world?
To put it differently: Suppose I have some commands such as doing a build, cleaning the build directory, creating a new version, and so on, is there a better way to do this than by adding a bunch of (platform-dependant) Bash script files?
In case there isn't – is there at least a common way of where to put these scripts? Or is this all left to the developer?
You can use Makefile
this one is what I use sometimes:
BINARY_NAME=main
build:
go mod tidy
go build -o ${BINARY_NAME} main.go
clean:
go clean
rm ${BINARY_NAME}

ipfs-update isn't showing the expected version list [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 1 year ago.
Improve this question
I ran
go get -u github.com/ipfs/ipfs-update
and got in the end of what it looks like an installation going on the following
go get: installing executables with 'go get' in module mode is deprecated.
Use 'go install pkg#version' instead.
For more information, see https://golang.org/doc/go-get-install-deprecation or run 'go help get' or 'go help install'.
github.com/ipfs/ipfs-update
go/pkg/mod/github.com/ipfs/ipfs-update#v1.7.1/main.go:318:21: cannot use lib.NewIpfsFetcher(distPath, 0) (type *lib.IpfsFetcher) as type migrations.Fetcher in argument to migrations.NewMultiFetcher:
*lib.IpfsFetcher does not implement migrations.Fetcher (missing Close method)
Then, used
ipfs-update versions
but didn't see the latest version.
To get that working I've used instead
go install github.com/ipfs/ipfs-update#latest
Then once running
ipfs-update versions
I got
Then could simply run
ipfs-update install v0.11.0

Getting error when trying to 'go get' the geos package [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
i have tried to run a new project of golang i've installed everything but I faced the following problem
$ go get github.com/paulsmith/gogeos/geos
#### #github.com/paulsmith/gogeos/geos
In file included from ..\..\go\pkg\mod\github.com\paulsmith\gogeos#v0.1.2\geos\coordseq.go:4:
./geos.h:1:10: fatal error: geos_c.h: No such file or directory
1 | #include <geos_c.h>
| ^~~~~~~~~~
compilation terminated.
Looking at the installation instructions on the project's page, it seems like you have to install GEOS first; see this part: https://github.com/paulsmith/gogeos#requirements
It can be as easy as $ apt-get install libgeos-dev on Ubuntu, but the link above has instructions for a from-source installation as well.
What happens in your case is that the Go package likely uses cgo to load C code from GEOS, and it fails immediately because GEOS is not installed, and cgo cannot find the headers files.

Go (lang) can not find module [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I did go get github.com/nanobox-io/golang-scribble, but when i try to run the main.go i get the error
[jerome#thearch beer-server]$ go run main.go
../../pkg/storage/json/repository.go:14:2: cannot find package "github.com/nanobox.io/golang-scribble" in any of:
/usr/lib/go/src/github.com/nanobox.io/golang-scribble (from $GOROOT)
/home/jerome/Documents/code/go/domainhex/src/github.com/nanobox.io/golang-scribble (from $GOPATH)
so i searched it:
[jerome#thearch nanobox-io]$ find /home/jerome/Documents/code/go/domainhex/src/github.com/nanobox.io -name golang-scribble
find: ‘/home/jerome/Documents/code/go/domainhex/src/github.com/nanobox.io’: No such file or directory
There is the thing completly weird, i cd follow the link and the package golang-scribble is present at the right place. So i pwd to get the path and use it to run the same cmd as previously
[jerome#thearch nanobox-io]$ pwd
/home/jerome/Documents/code/go/domainhex/src/github.com/nanobox-io
[jerome#thearch nanobox-io]$ ls
golang-scribble
[jerome#thearch nanobox-io]$ find /home/jerome/Documents/code/go/domainhex/src/github.com/nanobox-io -name golang-scribble
/home/jerome/Documents/code/go/domainhex/src/github.com/nanobox-io/golang-scribble
I don t know what's wrong ?
If i add some other package like github.com/google/uuid or julienschmidt/httprouter, it works perfectly.
extra-info
go version go1.16.2 linux/amd64
GO111MODULE="auto"
GOPATH="/home/jerome/Documents/code/go/domainhex"
Operating System: Arch Linux
Kernel: Linux 5.11.6-arch1-1
Architecture: x86-64
You are doing go get on github.com/nanobox-io/golang-scribble but you're importing github.com/nanobox.io/golang-scribble, the difference being nanobox-io vs nanobox.io. Try changing your import statement to github.com/nanobox-io/golang-scribble.

“module 'socket.http' not found:” --Lua on iMac [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
When I run my code in terminal, I get this error/message:
module 'socket.http' not found:
no field package.preload['socket.http']
no file '/usr/local/share/lua/5.2/socket/http.lua'
no file '/usr/local/share/lua/5.2/socket/http/init.lua'
no file '/usr/local/lib/lua/5.2/socket/http.lua'
no file '/usr/local/lib/lua/5.2/socket/http/init.lua'
no file './socket/http.lua'
no file '/usr/local/lib/lua/5.2/socket/http.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './socket/http.so'
no file '/usr/local/lib/lua/5.2/socket.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './socket.so'
Some sources led me to look into LuaSocket, but I still have no idea on what to do or how I would install that.
There are several places where a guide to install LuaSocket is available. Some of them are listed as follows:
http://w3.impa.br/~diego/software/luasocket/installation.html
https://github.com/diegonehab/luasocket/tree/cvs-diego
http://luarocks.org/
My preferred method would be to install LuaRocks and then use the following command in terminal:
luarocks install luasocket
A few more points. While configuring luarocks you may need to point to lua installation directory for example:
./configure --with-lua=/opt/lua53/
There are similar options:
--with-lua-bin
--with-lua-include
You can use any of these but make sure the desired directory structure is available in the directory you have mentioned!

Resources