swill / kad

Keyboard Automated Design (KAD) is a Golang library for designing mechanical keyboards
http://builder.swillkb.com
GNU Affero General Public License v3.0
232 stars 58 forks source link

Can't figure out how to install and use #4

Closed RichardBronosky closed 5 years ago

RichardBronosky commented 6 years ago

Just trying to install it, I get:

$ go get github.com/swill/kad
# github.com/swill/kad
/home/bruno/go/src/github.com/swill/kad/kad.go:435:9: canvas.FloatDecimals undefined (type *svg.SVG has no field or method FloatDecimals)/home/bruno/go/src/github.com/swill/kad/kad.go:436:9: canvas.StartviewUnitF undefined (type *svg.SVG has no field or method StartviewUnitF)
/home/bruno/go/src/github.com/swill/kad/kad.go:444:12: canvas.PolygonF undefined (type *svg.SVG has no field or method PolygonF)

I have extremely limited golang experience.

swill commented 6 years ago

Hmmm. I thought I had fixed that. It is because you have grabbed the upstream svgo instead of my fork. You need to install this repo: https://github.com/swill/svgo

I will see if I can use the upstream version now that he supports floats. I implemented a different way of supporting floats before he supported them and I have not had a chance to rewrite all my logic to use the upstream version yet.

Let me know if you have problems. Cheers...

RichardBronosky commented 6 years ago

I would have expected this to work. What am I missing?

bruno@BrunoPC:~/go$ rm -rf pkg/linux_amd64/github.com src/github.com
bruno@BrunoPC:~/go$ find . -iname '*svg*'
bruno@BrunoPC:~/go$ go get github.com/swill/svgo; go get github.com/swill/kad
# github.com/swill/kad
src/github.com/swill/kad/kad.go:435:9: canvas.FloatDecimals undefined (type *svg.SVG has no field or method FloatDecimals)
src/github.com/swill/kad/kad.go:436:9: canvas.StartviewUnitF undefined (type *svg.SVG has no field or method StartviewUnitF)
src/github.com/swill/kad/kad.go:444:12: canvas.PolygonF undefined (type *svg.SVG has no field or method PolygonF)
swill commented 6 years ago

You should be able to just do:

$ go install github.com/swill/svgo

Then you can get the code and start playing with:

$ go get github.com/swill/kad

Let me know if that helps. Basically, you have pulled the code for my svgo library, but you did not do a go install in that directory, so it did not get setup in your bin directory. You will probably want to remove the old svgo library as well, but you did that with the rm command.

RichardBronosky commented 6 years ago

I get no feedback from go install github.com/swill/svgo but it does return ($?) 0. However, I still get the same error when I go get github.com/swill/kad.

swill commented 6 years ago

Oh, I know what is happening. My bad... Ok, so the problem is that it is pulling the master branch and I did the work on the float branch because I was preparing a pull request to be merged upstream. Since it didn't get upstreamed and I was the only person using it, I didn't end up changing it.

Here is the process to get this working. So sorry for the issues getting this working.

mkdir -p $GOPATH/src/github.com/swill
cd $GOPATH/src/github.com/swill
git clone https://github.com/swill/svgo.git
cd svgo
git checkout float
go install

So sorry about this being so complicated. This time I think I do actually have you sorted out.

Let me know if you have issues. Cheers...

RichardBronosky commented 6 years ago

That did it! I was able to go get and run the tests. Other than not having (or wanting) inkscape installed they seemed to work.

Thank you for walking me through this! I'll try to contribute something that makes it worth your time.

hhkbp2 commented 4 years ago

We could use the go module to specify the branch of dependencies.