emicklei / melrose

interactive programming of melodies, producing MIDI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Darwin: Go install fails because 'portmidi.h' is not found

mzacho opened this issue · comments

Running

go install github.com/emicklei/melrose/cmd/melrose@latest

this installation fails due to an error in the lib github.com/rakyll/portmidi:

go: downloading github.com/emicklei/melrose v0.45.0
go: downloading github.com/emicklei/melrose/cmd/melrose v0.0.0-20200403205005-3fddc42e072a
go: downloading github.com/emicklei/melrose v0.6.1
go: downloading github.com/peterh/liner v1.2.0
go: downloading github.com/antonmedv/expr v1.8.2
go: downloading github.com/rakyll/portmidi v0.0.0-20191102002215-74e95e8bc9b1
go: downloading github.com/mattn/go-runewidth v0.0.8
# github.com/rakyll/portmidi
go/pkg/mod/github.com/rakyll/portmidi@v0.0.0-20191102002215-74e95e8bc9b1/portmidi.go:22:11: fatal error: 'portmidi.h' file not found
 #include <portmidi.h>
          ^~~~~~~~~~~~
1 error generated.

There's an open issue in the project to distribute portmidi.h and porttime headers as part of the repo, to which I proposed a fix a while ago, however it seems like no ones maintaining the project anymore.

thank you for reporting this. I am surprised to see the portmidi dependency. I believe it is no longer used. Will check it now.

i was able to reproduce it on a clean machine

ernest_micklei@cloudshell:~ (staticwebsites-276808)$ go install -v github.com/emicklei/melrose/cmd/melrose@latest
go: downloading github.com/emicklei/melrose/cmd/melrose v0.0.0-20200403205005-3fddc42e072a
go: downloading github.com/emicklei/melrose v0.45.0
go: downloading github.com/emicklei/melrose v0.6.1
go: downloading github.com/peterh/liner v1.2.0
go: downloading github.com/rakyll/portmidi v0.0.0-20191102002215-74e95e8bc9b1
go: downloading github.com/antonmedv/expr v1.8.2
go: downloading github.com/mattn/go-runewidth v0.0.8
github.com/mattn/go-runewidth
github.com/emicklei/melrose
github.com/antonmedv/expr/file
github.com/emicklei/melrose/notify
github.com/antonmedv/expr/ast
github.com/antonmedv/expr/parser/lexer
github.com/antonmedv/expr/vm
github.com/peterh/liner
github.com/antonmedv/expr/parser
github.com/rakyll/portmidi
# github.com/rakyll/portmidi
gopath/pkg/mod/github.com/rakyll/portmidi@v0.0.0-20191102002215-74e95e8bc9b1/portmidi.go:22:11: fatal error: portmidi.h: No such file or directory
   22 | // #include <portmidi.h>
      |           ^~~~~~~~~~~~
compilation terminated.
github.com/antonmedv/expr/conf
github.com/antonmedv/expr/checker
github.com/antonmedv/expr/compiler
github.com/antonmedv/expr/optimizer
github.com/antonmedv/expr
github.com/emicklei/melrose/dsl

this command does not have this problem, can you try?

go install -v github.com/emicklei/melrose/...@latest

better do this:

go install -v github.com/emicklei/melrose/cmd/melrose...@latest

I've never seen this syntax before? Reference?

Seems to work on my machine as well :-)

Once upon a time, this package folder cmd/melrose had a go.mod. This is being cached in proxy.golang.org
The entry cannot be removed afaik. A workaround is to put back this go.mod and update it too on each release.

go install github.com/emicklei/melrose/cmd/melrose@latest
go: downloading github.com/emicklei/melrose/cmd/melrose v0.0.0-20220828123158-ba7d32bd6817
go: downloading github.com/emicklei/melrose v0.46.1
....

now works