mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +00:00
[ci skip] Update Readme and Contributing to be more consistent
Avoid multiple copies of dependencies Indicate that `rodio` is default backend Remove `nightly` requirement for development Fix minor typos
This commit is contained in:
parent
cbba63f60b
commit
b8577eebbd
2 changed files with 36 additions and 47 deletions
|
@ -2,38 +2,30 @@
|
|||
|
||||
## Setup
|
||||
|
||||
In order to contribute to librespot, you will first need to set up a suitable rust build environment, with the necessary dependenices installed. These instructions will walk you through setting up a simple build environment.
|
||||
In order to contribute to librespot, you will first need to set up a suitable Rust build environment, with the necessary dependencies installed. These instructions will walk you through setting up a simple build environment.
|
||||
|
||||
You will need to have C compiler, rust, and portaudio installed.
|
||||
You will need to have C compiler, Rust, and alsa/portaudio libraries installed.
|
||||
|
||||
### Install Rust
|
||||
|
||||
The easiest, and recommended way to get rust setu is to use [rustup](https://rustup.rs). You can install rustup with this command:
|
||||
The easiest, and recommended way to get Rust is to use [rustup](https://rustup.rs). You can install `rustup` with this command:
|
||||
|
||||
```bash
|
||||
curl https://sh.rustup.rs -sSf | sh
|
||||
```
|
||||
|
||||
Follow any prompts it gives you to install rust. Once that’s done, rust is ready to use.
|
||||
|
||||
Follow any prompts it gives you to install Rust. Once that’s done, Rust's standard tools should be setup and ready to use.
|
||||
|
||||
#### Additional Rust tools - `rustfmt`
|
||||
To ensure a consistent codebase, install [`rustfmt`](https://github.com/rust-lang/rustfmt) via `rustup`.
|
||||
This is not optional, as Travis CI is set up to check that code is compliant with this repos style guides.
|
||||
```bash
|
||||
rustup component add rustfmt
|
||||
```
|
||||
|
||||
### Install Other Dependencies
|
||||
On debian / ubuntu, the following command will install these dependencies :
|
||||
|
||||
```bash
|
||||
sudo apt-get install build-essential portaudio19-dev
|
||||
```
|
||||
|
||||
On Fedora systems, the following command will install these dependencies :
|
||||
|
||||
```bash
|
||||
sudo dnf install portaudio-devel make gcc
|
||||
```
|
||||
|
||||
On macOS, using homebrew :
|
||||
|
||||
```bash
|
||||
brew install portaudio
|
||||
```
|
||||
Install the required dependencies as described in the [Readme](https://github.com/librespot-org/librespot#building)
|
||||
|
||||
### Getting the Source
|
||||
|
||||
|
@ -49,22 +41,6 @@ CD to the newly cloned repo...
|
|||
cd librespot
|
||||
```
|
||||
|
||||
### Development Extra Steps
|
||||
|
||||
If you are looking to carry out development on librespot:
|
||||
|
||||
```bash
|
||||
rustup override set nightly
|
||||
```
|
||||
|
||||
The command above overrides the default rust in the directory housing librespot to use the ```nightly``` version, as opposed to the ```stable``` version.
|
||||
|
||||
Then, run the command below to install [rustfmt](https://github.com/rust-lang-nursery/rustfmt) for the ```nightly``` toolchain. This is not optional, as Travis CI is set up to check that code is compliant with rustfmt.
|
||||
|
||||
```bash
|
||||
rustup component add rustfmt-preview
|
||||
```
|
||||
|
||||
## Compiling & Running
|
||||
|
||||
Once your build environment is setup, compiling the code is pretty simple.
|
||||
|
@ -87,7 +63,7 @@ You will most likely want to build debug builds when developing, as they are fas
|
|||
|
||||
There are also a number of compiler feature flags that you can add, in the event that you want to have certain additional features also compiled. The list of these is available on the [wiki](https://github.com/librespot-org/librespot/wiki/Compiling#addition-features).
|
||||
|
||||
By default, librespot compiles with the ```portaudio-backend``` feature. To compile without default features, you can run with:
|
||||
By default, librespot compiles with the ```rodio-backend``` feature. To compile without default features, you can run with:
|
||||
|
||||
```bash
|
||||
cargo build --no-default-features
|
||||
|
@ -112,7 +88,7 @@ If you have encountered a bug, please report it, as we rely on user reports to f
|
|||
Please also make sure that your issues are helpful. To ensure that your issue is helpful, please read over this brief checklist to avoid the more common pitfalls:
|
||||
|
||||
- Please take a moment to search/read previous similar issues to ensure you aren’t posting a duplicate. Duplicates will be closed immediately.
|
||||
- Please include a clear description of what the issue is. Issues with descriptions such as ‘It hangs after 40 minutes’ will be closed immediately.
|
||||
- Please include a clear description of what the issue is. Issues with descriptions such as ‘It hangs after 40 minutes’ will be closed immediately.
|
||||
- Please include, where possible, steps to reproduce the bug, along with any other material that is related to the bug. For example, if librespot consistently crashes when you try to play a song, please include the Spotify URI of that song. This can be immensely helpful in quickly pinpointing and resolving issues.
|
||||
- Lastly, and perhaps most importantly, please include a backtrace where possible. Recent versions of librespot should produce these automatically when it crashes, and print them to the console, but in some cases, you may need to run ‘export RUST_BACKTRACE=full’ before running librespot to enable backtraces.
|
||||
|
||||
|
@ -126,14 +102,13 @@ Fork -> Fix -> PR -> Review -> Merge
|
|||
|
||||
This is how all code is added to the repository, even by those with write access.
|
||||
|
||||
#### Steps before Commiting
|
||||
#### Steps before Committing
|
||||
|
||||
In order to prepare for a PR, you will need to do a couple of things first:
|
||||
|
||||
Make any changes that you are going to make to the code, but do not commit yet.
|
||||
|
||||
Make sure you are using rust ```nightly``` to build librespot. Once this is confirmed, you will need to run the following command:
|
||||
|
||||
Make sure that the code is formatted by running:
|
||||
```bash
|
||||
cargo fmt --all
|
||||
```
|
||||
|
|
24
README.md
24
README.md
|
@ -6,10 +6,10 @@ Current maintainer is @awiouy folks.
|
|||
# librespot
|
||||
*librespot* is an open source client library for Spotify. It enables
|
||||
applications to use Spotify's service, without using the official but
|
||||
closed-source libspotify. Additionally, it will provide extra features
|
||||
closed-source `libspotify`. Additionally, it will provide extra features
|
||||
which are not available in the official library.
|
||||
|
||||
_Note: librespot only works with Spotify Premium. This will remain the case for the forseeable future, as we are unlikely to work on implementing the features such as limited skips and adverts that would be required to make librespot compliant with free accounts._
|
||||
_Note: librespot only works with Spotify Premium. This will remain the case for the foreseeable future, as we are unlikely to work on implementing the features such as limited skips and adverts that would be required to make librespot compliant with free accounts._
|
||||
|
||||
## This fork
|
||||
As the origin by [plietar](https://github.com/plietar/) is no longer actively maintained, this organisation and repository have been set up so that the project may be maintained and upgraded in the future.
|
||||
|
@ -30,9 +30,11 @@ If you run into a bug when using librespot, please search the existing issues be
|
|||
# Building
|
||||
Rust 1.32.0 or later is required to build librespot.
|
||||
|
||||
We recently switched to using [Rodio](https://github.com/tomaka/rodio) for audio playback by default, hence for macOS and Windows, you should just be able to clone and build librespot (with the command below). For linux, you will need to run the additional commands below, depending on your distro.
|
||||
## Additional Dependencies
|
||||
We recently switched to using [Rodio](https://github.com/tomaka/rodio) for audio playback by default, hence for macOS and Windows, you should just be able to clone and build librespot (with the command below).
|
||||
For Linux, you will need to run the additional commands below, depending on your distro.
|
||||
|
||||
On debian / ubuntu, the following command will install these dependencies :
|
||||
On Debian/Ubuntu, the following command will install these dependencies :
|
||||
```shell
|
||||
sudo apt-get install build-essential libasound2-dev
|
||||
```
|
||||
|
@ -42,7 +44,19 @@ On Fedora systems, the following command will install these dependencies :
|
|||
sudo dnf install alsa-lib-devel make gcc
|
||||
```
|
||||
|
||||
Once you've cloned this repository you can build *librespot* using `cargo`.
|
||||
librespot currently offers the a selection of [audio backends](https://github.com/librespot-org/librespot/wiki/Audio-Backends).
|
||||
```
|
||||
Rodio (default)
|
||||
ALSA
|
||||
PortAudio
|
||||
PulseAudio
|
||||
JACK
|
||||
SDL
|
||||
Pipe
|
||||
```
|
||||
Please check the corresponding [compiling wiki entry](https://github.com/librespot-org/librespot/wiki/Compiling#dependencies) for backend specific dependencies.
|
||||
|
||||
Once you've installed the dependencies and cloned this repository you can build *librespot* with the default backend using Cargo.
|
||||
```shell
|
||||
cargo build --release
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue