dubyte / dir2opds

Serve an OPDS based on a directory
GNU General Public License v3.0
59 stars 12 forks source link

What version of go is needed? #2

Closed clach04 closed 4 years ago

clach04 commented 4 years ago

Install instructions do not work for:

[pi@raspberrypi:~/go] 24s 2 $ go version
cat go version go1.7.4 linux/arm
[pi@raspberrypi:~/go] $ cat /etc/*elease*
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Issuing:

go get -u github.com/dubyte/dir2opds

Results in:

package github.com/dubyte/dir2opds: cannot download, $GOPATH not set. For more details see: go help gopath

Setting GOPATH progresses a little further:

[pi@raspberrypi:~/go/t] 1 $ env GOPATH=`pwd` go get -u github.com/dubyte/dir2opds
# github.com/dubyte/dir2opds
src/github.com/dubyte/dir2opds/main.go:161: undefined: url.PathEscape
clach04 commented 4 years ago

I did try building (same machine) but that was not successful. I tried out a recent version of Go for Windows, I was able to build via:

go build

I did not try the install option:

go version go1.14.2 windows/amd64

I'm not familiar with the Go ecosystem so I don't know how to progress/debug this further.

dubyte commented 4 years ago

Hello clach04: you don't have to build dir2opds you can take the build for releases: https://github.com/dubyte/dir2opds/releases for the raspbian you could try dir2opds_v0.0.3_Linux-arm6.tar.gz

dubyte commented 4 years ago

If you want to build it I think the 1.7 is ok but you need to set your GOPATH env variable. usually is in $HOME/go so you can create a folder in $HOME called go

then in your $HOME/.bashrc add: export GOPATH="$HOME/go"

and that would be it.

dubyte commented 4 years ago

additionally you could install go 1.14.3 for raspbian using: https://golang.org/doc/install?download=go1.14.3.linux-amd64.tar.gz

clach04 commented 4 years ago

@dubyte thanks for the suggestion, I'll check out newer go versions (note the link you have is for amd64 not ARM). I already had GOPATH set (see issue description, last test build).

I can't use prebuilt binaries for a couple of reasons:

How was https://github.com/dubyte/dir2opds/releases/tag/v0.0.3 built, what version of Go/Rasbian?

I stumbled across https://llllllll.co/t/norns-on-raspberry-pi/14148/233 which indicated Go v1.10.3. was needed as a minimum for url.PathEscape

clach04 commented 4 years ago

Update, found https://github.com/go-gitea/gitea/issues/3123#issuecomment-350401990 which indicates go v1.8 as minimum.

https://github.com/golang/go/commit/7e2bf952a905f16a17099970392ea17545cdd193

dubyte commented 4 years ago

The think is that once that is compiled, you dont need go installed it will just work. is not like java or python. if you download a binary release it should work for in any raspberry with linux.

dubyte commented 4 years ago

if you want to create a pull request for the cbz I can merge it and create a new release.

dubyte commented 4 years ago

if you still have issue to compile it let me know i can help.

dubyte commented 4 years ago

I am adding your suggestions in: https://github.com/dubyte/dir2opds/tree/release_0_4_0 So if you want to take a look and add more stuff please let me know.