Build directly from GitHub generated sources
Hello, we're currently building from the maintainer provided tarball. This MR switches it to use GitHub's generated sources instead. For context, this is what the release page says:
[..] To download the source code for fish, we suggest the file named "fish-3.7.1.tar.xz". The file downloaded from "Source code (tar.gz)" will not build correctly. [..]
Digging into it some more, I found this comment:
[..] the autogenerated tarball won't figure out its version, falling back to "unknown" (this is also checked in the tests, which fail as a result). [..]
And indeed, the difference between the GitHub generated sources and the maintainer provided ones are just docs (which we're building anyway) and a file called version:
$ wget https://github.com/fish-shell/fish-shell/releases/download/3.7.1/fish-3.7.1.tar.xz -O maintainer.tar.xz
$ wget https://github.com/fish-shell/fish-shell/archive/refs/tags/3.7.1.tar.gz -O generated.tar.gz
$ mkdir maintainer generated
$ tar xf maintainer.tar.xz --directory maintainer
$ tar xf generated.tar.gz --directory generated
$ diff -rd maintainer/fish-3.7.1/ generated/fish-shell-3.7.1/
Only in maintainer/fish-3.7.1/: user_doc
Only in maintainer/fish-3.7.1/: version
$ cat maintainer/fish-3.7.1/version
3.7.1
Since we're always building a known version, we can simply create the file ourselves in "prepare". The rest of the changes is just clean up and dealing with the different name (the project on GitHub is called "fish-shell", not just "fish", and that's what GitHub puts in the generated tarball).
Given the recent events, I should probably explicitly mention that I have no suspicion that something fishy is going on, but I see no reason not to use the official GitHub generated sources if only for increased transparency.