# Copyright 2017-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # Auto-Generated by cargo-ebuild 0.2.0 EAPI=7 CRATES=" aes-0.3.2 aes-ctr-0.3.0 aes-soft-0.3.3 aesni-0.6.0 aho-corasick-0.6.10 alga-0.9.1 alsa-0.2.2 alsa-sys-0.1.2 ansi_term-0.11.0 approx-0.3.2 arc-swap-0.3.11 arrayvec-0.4.11 atty-0.2.13 autocfg-0.1.5 backtrace-0.3.33 backtrace-sys-0.1.31 base64-0.10.1 base64-0.9.3 bindgen-0.32.3 bit-set-0.5.1 bit-vec-0.5.1 bitflags-0.3.3 bitflags-0.7.0 bitflags-0.9.1 bitflags-1.1.0 block-buffer-0.7.3 block-cipher-trait-0.6.2 block-modes-0.3.3 block-padding-0.1.4 byte-tools-0.3.1 byteorder-1.3.2 bytes-0.4.12 c2-chacha-0.2.2 cc-1.0.47 cexpr-0.2.3 cfg-if-0.1.9 chrono-0.4.7 clang-sys-0.21.2 clap-2.33.0 cloudabi-0.0.3 core-foundation-sys-0.5.1 coreaudio-rs-0.9.1 coreaudio-sys-0.2.2 cpal-0.8.2 crossbeam-deque-0.7.1 crossbeam-epoch-0.7.2 crossbeam-queue-0.1.2 crossbeam-utils-0.6.6 crypto-mac-0.7.0 ctr-0.3.2 digest-0.8.1 dns-sd-0.1.3 env_logger-0.4.3 env_logger-0.6.2 error-chain-0.12.1 failure-0.1.5 failure_derive-0.1.5 fake-simd-0.1.2 fnv-1.0.6 fuchsia-cprng-0.1.1 fuchsia-zircon-0.3.3 fuchsia-zircon-sys-0.3.3 futures-0.1.28 futures-cpupool-0.1.8 gcc-0.3.55 generic-array-0.12.3 getopts-0.2.19 getrandom-0.1.6 glob-0.2.11 hex-0.3.2 hmac-0.7.1 httparse-1.3.4 humantime-1.2.0 hyper-0.11.27 hyper-proxy-0.4.1 idna-0.1.5 iovec-0.1.2 itoa-0.4.4 jack-0.5.7 jack-sys-0.2.0 kernel32-sys-0.2.2 language-tags-0.2.2 lazy_static-1.3.0 lewton-0.9.4 libc-0.2.65 libloading-0.4.3 libm-0.1.4 libmdns-0.2.4 libpulse-sys-0.0.0 librespot-0.1.1 librespot-audio-0.1.1 librespot-connect-0.1.1 librespot-core-0.1.1 librespot-metadata-0.1.1 librespot-playback-0.1.1 librespot-protocol-0.1.1 librespot-tremor-0.1.0 linear-map-1.2.0 lock_api-0.1.5 log-0.3.9 log-0.4.7 matches-0.1.8 matrixmultiply-0.2.2 memchr-1.0.2 memchr-2.2.1 memoffset-0.5.1 mime-0.3.13 mio-0.6.19 mio-named-pipes-0.1.6 mio-uds-0.6.7 miow-0.2.1 miow-0.3.3 multimap-0.4.0 nalgebra-0.18.0 net2-0.2.33 nix-0.10.0 nix-0.9.0 nodrop-0.1.13 nom-3.2.1 num-0.1.42 num-bigint-0.2.2 num-complex-0.2.3 num-integer-0.1.41 num-iter-0.1.39 num-traits-0.2.8 num_cpus-1.10.1 ogg-0.7.0 ogg-sys-0.0.9 opaque-debug-0.2.2 owning_ref-0.4.0 parking_lot-0.7.1 parking_lot_core-0.4.0 pbkdf2-0.3.0 peeking_take_while-0.1.2 percent-encoding-1.0.1 pkg-config-0.3.15 portaudio-rs-0.3.1 portaudio-sys-0.1.1 ppv-lite86-0.2.5 proc-macro2-0.2.3 proc-macro2-0.4.30 protobuf-2.8.1 protobuf-codegen-2.8.1 protobuf-codegen-pure-2.8.1 quick-error-1.2.2 quote-0.4.2 quote-0.6.13 rand-0.3.23 rand-0.4.6 rand-0.5.6 rand-0.6.5 rand-0.7.0 rand_chacha-0.1.1 rand_chacha-0.2.1 rand_core-0.3.1 rand_core-0.4.0 rand_core-0.5.0 rand_hc-0.1.0 rand_hc-0.2.0 rand_isaac-0.1.1 rand_jitter-0.1.4 rand_os-0.1.3 rand_pcg-0.1.2 rand_xorshift-0.1.1 rawpointer-0.1.0 rdrand-0.4.0 redox_syscall-0.1.56 regex-0.2.11 regex-syntax-0.5.6 relay-0.1.1 remove_dir_all-0.5.2 rodio-0.9.0 rpassword-3.0.2 rustc-demangle-0.1.15 rustc_version-0.2.3 ryu-1.0.0 safemem-0.3.0 scoped-tls-0.1.2 scopeguard-0.3.3 scopeguard-1.0.0 sdl2-0.32.2 sdl2-sys-0.32.6 semver-0.9.0 semver-parser-0.7.0 serde-1.0.97 serde_derive-1.0.97 serde_json-1.0.40 sha-1-0.8.1 sha2-0.8.0 shannon-0.2.0 shell-words-0.1.0 signal-hook-0.1.10 signal-hook-registry-1.1.0 slab-0.3.0 slab-0.4.2 smallvec-0.2.1 smallvec-0.6.10 socket2-0.2.4 socket2-0.3.10 spin-0.5.0 stable_deref_trait-1.1.1 stdweb-0.1.3 stream-cipher-0.3.0 strsim-0.8.0 subtle-1.0.0 syn-0.15.42 synstructure-0.10.2 take-0.1.0 tempfile-3.1.0 termcolor-1.0.5 textwrap-0.11.0 thread_local-0.3.6 time-0.1.42 tokio-0.1.22 tokio-codec-0.1.1 tokio-core-0.1.17 tokio-current-thread-0.1.6 tokio-executor-0.1.8 tokio-fs-0.1.6 tokio-io-0.1.12 tokio-process-0.2.4 tokio-proto-0.1.1 tokio-reactor-0.1.9 tokio-service-0.1.0 tokio-signal-0.2.7 tokio-sync-0.1.6 tokio-tcp-0.1.3 tokio-threadpool-0.1.15 tokio-timer-0.2.11 tokio-udp-0.1.3 tokio-uds-0.2.5 try-lock-0.1.0 typenum-1.10.0 ucd-util-0.1.5 unicase-2.4.0 unicode-bidi-0.3.4 unicode-normalization-0.1.8 unicode-width-0.1.5 unicode-xid-0.1.0 url-1.7.2 utf8-ranges-1.0.3 uuid-0.7.4 vec_map-0.8.1 vergen-3.0.4 version_check-0.1.5 void-1.0.2 vorbis-0.1.0 vorbis-encoder-0.1.4 vorbis-sys-0.0.8 vorbisfile-sys-0.0.8 want-0.0.4 which-1.0.5 winapi-0.2.8 winapi-0.3.7 winapi-build-0.1.1 winapi-i686-pc-windows-gnu-0.4.0 winapi-util-0.1.2 winapi-x86_64-pc-windows-gnu-0.4.0 wincolor-1.0.1 ws2_32-sys-0.2.1 " inherit cargo systemd DESCRIPTION="An open source client library for Spotify, with support for Spotify Connect" HOMEPAGE="https://github.com/librespot-org/librespot" SRC_URI="$(cargo_crate_uris ${CRATES})" DOCS+=( README.md docs/{authentication,connection}.md ) RESTRICT="mirror" LICENSE="MIT" # Update to proper Gentoo format SLOT="0" KEYWORDS="~amd64 ~arm" IUSE="alsa pulseaudio portaudio jack sdl" get_features() { local out=( ) if use alsa; then out+=( alsa-backend ) fi if use pulseaudio; then out+=( pulseaudio-backend ) fi if use portaudio; then out+=( portaudio-backend ) fi if use jack; then out+=( jackaudio-backend ) fi if use sdl; then out+=( sdl-backend ) fi printf "%s," "${out[@]}" | sed 's/,$//g' } DEPEND=" media-libs/alsa-lib pulseaudio? ( media-sound/pulseaudio ) portaudio? ( media-libs/portaudio ) jack? ( virtual/jack ) sdl? ( media-libs/libsdl2 ) " RDEPEND="" # @FUNCTION: cargo_src_unpack # @DESCRIPTION: # Unpacks the package and the cargo registry cargo_src_unpack() { debug-print-function ${FUNCNAME} "$@" mkdir -p "${ECARGO_VENDOR}" || die mkdir -p "${S}" || die local archive shasum pkg for archive in ${A}; do case "${archive}" in *.crate) ebegin "Loading ${archive} into Cargo registry" tar -xf "${DISTDIR}"/${archive} --warning=no-timestamp -C "${ECARGO_VENDOR}/" # generate sha256sum of the crate itself as cargo needs this shasum=$(sha256sum "${DISTDIR}"/${archive} | cut -d ' ' -f 1) pkg=$(basename ${archive} .crate) cat <<- EOF > ${ECARGO_VENDOR}/${pkg}/.cargo-checksum.json { "package": "${shasum}", "files": {} } EOF # if this is our target package we need it in ${WORKDIR} too # to make ${S} (and handle any revisions too) if [[ ${P} == ${pkg}* ]]; then tar -xf "${DISTDIR}"/${archive} -C "${WORKDIR}" || die fi eend $? ;; cargo-snapshot*) ebegin "Unpacking ${archive}" mkdir -p "${S}"/target/snapshot tar -xzf "${DISTDIR}"/${archive} -C "${S}"/target/snapshot --strip-components 2 || die # cargo's makefile needs this otherwise it will try to # download it touch "${S}"/target/snapshot/bin/cargo || die eend $? ;; *) unpack ${archive} ;; esac done cargo_gen_config } src_compile() { debug-print-function ${FUNCNAME} "$@" local features="$(get_features)" if [[ "${features}" ]]; then cargo_src_compile --features "${features}" else cargo_src_compile fi } src_install() { debug-print-function ${FUNCNAME} "$@" local features="$(get_features)" if [[ "${features}" ]]; then cargo_src_install --features "${features}" else cargo_src_install fi systemd_dounit "${FILESDIR}"/"${PN}".service systemd_install_serviced "${FILESDIR}"/"${PN}".service.conf }