# Libspotify ?



## unwillexist (Aug 8, 2019)

I need this to work mopidy, It must be very easy to port this library here is Makefile there is issu with that install -T flag.


```
prefix ?= /usr/local

all:
    $(error "Usage: make [prefix=/install/me/here] install | uninstall")

install:
    mkdir -p $(prefix)/include/libspotify
    install include/libspotify/api.h $(prefix)/include/libspotify

    mkdir -p $(prefix)/lib
    install -T lib/libspotify.so.12 $(prefix)/lib/libspotify.so.12.1.51

    cd $(prefix)/lib && ln -sf libspotify.so.12.1.51 libspotify.so.12 && ln -sf libspotify.so.12.1.51 libspotify.so

    mkdir -p $(prefix)/lib/pkgconfig
    sed -e s:PKG_PREFIX:$(prefix):g <lib/pkgconfig/libspotify.pc >$(prefix)/lib/pkgconfig/libspotify.pc

    ldconfig

uninstall:
    rm -rf $(prefix)/include/libspotify
    rm -f  $(prefix)/lib/libspotify.so.12.1.51
    rm -f  $(prefix)/lib/libspotify.so.12
    rm -f  $(prefix)/lib/libspotify.so
    rm -f  $(prefix)/lib/pkgconfig/libspotify.pc
```

What is the problem with that -T flag what is BSD equievelant of it ?


----------



## unwillexist (Aug 8, 2019)

https://github.com/mopidy/libspotify-archive/raw/master/libspotify-12.1.51-Linux-x86_64-release.tar.gz


----------



## ralphbsz (Aug 9, 2019)

Read the man page for install on Linux, figure out what -T does. I just did, but that one sentence "treat DEST as a normal file" isn't immediately obvious and I'm feeling to lazy to understand the whole man page. Unfortunately, the FreeBSD version of install also has a -T option, and it is completely different, and requires arguments. I get the feeling that on FreeBSD, the -T option is actually not needed at all; if the target doesn't exist yet, the target is automatically treated as a file. But please read the man pages yourself.


----------



## unitrunker (Aug 9, 2019)

Please read this older post:

https://forums.freebsd.org/threads/...ng-a-freebsd-binary-to-a-linux-library.41489/


----------



## rigoletto@ (Aug 17, 2019)

You could also have a look if audio/spotifyd fits for you (I don't use spotify at all).


----------



## shkhln (Aug 17, 2019)

unitrunker said:


> https://forums.freebsd.org/threads/...ng-a-freebsd-binary-to-a-linux-library.41489/



Strictly speaking, it is possible to mix in a Linux shared library provided that:
1. it only does syscalls through libc syscall function and not directly (thankfully, that's usually the case);
2. there are necessary conversions in place for ABI differences between FreeBSD libc and Linux glibc;
3. the library doesn't not pass incompatible structs/constants/function pointers to native code through its own API, otherwise it would need wrapping as well.

Now, as far as I can see, libspotify was officially deprecated 4 years ago, so it's absolutely _not_ worth the time investment.


----------

