rust-lang / rust-installer

The Bourne shell installer used by Rust and Cargo
Apache License 2.0
60 stars 68 forks source link

Allow setting --docdir #49

Closed orbea closed 8 years ago

orbea commented 8 years ago

This will allow setting --docdir during configure, this is useful because not all linux distributions install documentation to /usr/share/doc. For example in Slackware documentation is installed to /usr/doc/$PRGNAM-$VERSION and /usr/share/doc is a symlink to /usr/doc.

To use this ./configure --docdir=/usr/doc/$PRGNAM-$VERSION can be used.

Here is the PR for the main rust repo. https://github.com/rust-lang/rust/pull/36360

giannicic commented 8 years ago

Just to inform that currently "rust make install" isn't working due to install: error: Option '--docdir=/usr/local/share/doc/rust' is not recognized

Not sure but I think that this PR is intended to handle the docdir option used in rust make install

orbea commented 8 years ago

I am under the impression for --docdir to work both this PR and the one that was already merged (Linked in the op) are needed, I haven't tested it with just the merged PR yet though. At the very least it was working with both of them applied locally.

brson commented 8 years ago

Thanks for the PR.

As written, this is hard-coded to work with the rustc package produced by the rustc build, because it specifies "share/doc/rust". This is sufficient to work with make install for the main-repo because all of its docs are installed to "share/doc/rust", but it will not, e.g. work for the combined installer on the website, which additionally includes (I believe) cargo docs in "share/doc/cargo", nor would it work for make install from the cargo repo. There is generally no rust-specific behavior encoded in the install script, as in this patch.

A simple solution would be to omit the "/rust" directory when doing the rewriting here, with the consequence that changing --docdir will preserve the "rust" subdirectory. If that's not sufficient for your purposes then a suitable solution may require some more consideration.

orbea commented 8 years ago

The "/rust" directory was included in this as in Slackware it would be named "$PRGNAM-$VERSION" where $PRGNAM = rustc to match the source tarballs at the main rust site.

I think ideally a more complete solution will have to be found, but I am unfortunately not in that great of a position to test the combined installed on the website or the make install in the cargo repo.

orbea commented 8 years ago

Should be fixed.

brson commented 8 years ago

Closing in favor of https://github.com/rust-lang/rust-installer/pull/54. Thanks <3

orbea commented 8 years ago

Thanks!