philippe44 / LMS-uPnP

Integrate UPnP players with LogitechMediaServer
111 stars 17 forks source link

Basic build guide and plugin installation #70

Closed somejavadev closed 1 year ago

somejavadev commented 1 year ago

Hi,

Is there perhaps a basic build guide, eg the core commands to run to build and install the plugin on an ubuntu 20.04 or 22.04 server?

I am currently trying to build it using the build.sh script but I am running into a couple of issues. I have read the documentation around https://github.com/philippe44/cross-compiling/blob/master/README.md#organizing-submodules--packages but I am not too familiar with the c build process.

Branch: master

Currently I have install all the dependencies and I am running ./build.sh x86_64-linux-gnu-gcc

LMS-uPnP/application$ ./build.sh x86_64-linux-gnu-gcc
x86_64-linux-gnu-gcc  -Wno-deprecated-declarations -Wno-format-truncation -Wno-stringop-truncation  -Wall -fPIC -ggdb -O2 -DCODECS -DUSE_SSL -D_GNU_SOURCE -DUPNP_STATIC_LIB -DLINKALL -DRESAMPLE -fdata-sections -ffunction-sections   -Ilibopenssl/targets/linux/x86_64/include -Icrosstools/src -Isqueezelite -Isqueeze2upnp/inc -Ilibpupnp/targets/linux/x86_64/include/upnp -Ilibpupnp/targets/linux/x86_64/include/ixml -Ilibpupnp/targets/linux/x86_64/include/addons -Ilibcodecs/targets/include/flac -Ilibcodecs/targets/include/mad -Ilibcodecs/targets/include/ogg -Ilibcodecs/targets/include/vorbis -Ilibcodecs/targets/include/opus -Ilibcodecs/targets/include/opusfile -Ilibcodecs/targets/include/faad2 -Ilibcodecs/targets/include/shine -Ilibcodecs/targets/include/soxr -Ilibcodecs/targets/include/addons -Ilibmdns/targets/include/mdnsvc -Ilibmdns/targets/include/mdnssd squeezelite/slimproto.c -c -o bin/linux/x86_64/slimproto.o
x86_64-linux-gnu-gcc  -Wno-deprecated-declarations -Wno-format-truncation -Wno-stringop-truncation  -Wall -fPIC -ggdb -O2 -DCODECS -DUSE_SSL -D_GNU_SOURCE -DUPNP_STATIC_LIB -DLINKALL -DRESAMPLE -fdata-sections -ffunction-sections   -Ilibopenssl/targets/linux/x86_64/include -Icrosstools/src -Isqueezelite -Isqueeze2upnp/inc -Ilibpupnp/targets/linux/x86_64/include/upnp -Ilibpupnp/targets/linux/x86_64/include/ixml -Ilibpupnp/targets/linux/x86_64/include/addons -Ilibcodecs/targets/include/flac -Ilibcodecs/targets/include/mad -Ilibcodecs/targets/include/ogg -Ilibcodecs/targets/include/vorbis -Ilibcodecs/targets/include/opus -Ilibcodecs/targets/include/opusfile -Ilibcodecs/targets/include/faad2 -Ilibcodecs/targets/include/shine -Ilibcodecs/targets/include/soxr -Ilibcodecs/targets/include/addons -Ilibmdns/targets/include/mdnsvc -Ilibmdns/targets/include/mdnssd squeezelite/buffer.c -c -o bin/linux/x86_64/buffer.o
x86_64-linux-gnu-gcc  -Wno-deprecated-declarations -Wno-format-truncation -Wno-stringop-truncation  -Wall -fPIC -ggdb -O2 -DCODECS -DUSE_SSL -D_GNU_SOURCE -DUPNP_STATIC_LIB -DLINKALL -DRESAMPLE -fdata-sections -ffunction-sections   -Ilibopenssl/targets/linux/x86_64/include -Icrosstools/src -Isqueezelite -Isqueeze2upnp/inc -Ilibpupnp/targets/linux/x86_64/include/upnp -Ilibpupnp/targets/linux/x86_64/include/ixml -Ilibpupnp/targets/linux/x86_64/include/addons -Ilibcodecs/targets/include/flac -Ilibcodecs/targets/include/mad -Ilibcodecs/targets/include/ogg -Ilibcodecs/targets/include/vorbis -Ilibcodecs/targets/include/opus -Ilibcodecs/targets/include/opusfile -Ilibcodecs/targets/include/faad2 -Ilibcodecs/targets/include/shine -Ilibcodecs/targets/include/soxr -Ilibcodecs/targets/include/addons -Ilibmdns/targets/include/mdnsvc -Ilibmdns/targets/include/mdnssd squeezelite/output_http.c -c -o bin/linux/x86_64/output_http.o
x86_64-linux-gnu-gcc  -Wno-deprecated-declarations -Wno-format-truncation -Wno-stringop-truncation  -Wall -fPIC -ggdb -O2 -DCODECS -DUSE_SSL -D_GNU_SOURCE -DUPNP_STATIC_LIB -DLINKALL -DRESAMPLE -fdata-sections -ffunction-sections   -Ilibopenssl/targets/linux/x86_64/include -Icrosstools/src -Isqueezelite -Isqueeze2upnp/inc -Ilibpupnp/targets/linux/x86_64/include/upnp -Ilibpupnp/targets/linux/x86_64/include/ixml -Ilibpupnp/targets/linux/x86_64/include/addons -Ilibcodecs/targets/include/flac -Ilibcodecs/targets/include/mad -Ilibcodecs/targets/include/ogg -Ilibcodecs/targets/include/vorbis -Ilibcodecs/targets/include/opus -Ilibcodecs/targets/include/opusfile -Ilibcodecs/targets/include/faad2 -Ilibcodecs/targets/include/shine -Ilibcodecs/targets/include/soxr -Ilibcodecs/targets/include/addons -Ilibmdns/targets/include/mdnsvc -Ilibmdns/targets/include/mdnssd squeezelite/output.c -c -o bin/linux/x86_64/output.o
x86_64-linux-gnu-gcc  -Wno-deprecated-declarations -Wno-format-truncation -Wno-stringop-truncation  -Wall -fPIC -ggdb -O2 -DCODECS -DUSE_SSL -D_GNU_SOURCE -DUPNP_STATIC_LIB -DLINKALL -DRESAMPLE -fdata-sections -ffunction-sections   -Ilibopenssl/targets/linux/x86_64/include -Icrosstools/src -Isqueezelite -Isqueeze2upnp/inc -Ilibpupnp/targets/linux/x86_64/include/upnp -Ilibpupnp/targets/linux/x86_64/include/ixml -Ilibpupnp/targets/linux/x86_64/include/addons -Ilibcodecs/targets/include/flac -Ilibcodecs/targets/include/mad -Ilibcodecs/targets/include/ogg -Ilibcodecs/targets/include/vorbis -Ilibcodecs/targets/include/opus -Ilibcodecs/targets/include/opusfile -Ilibcodecs/targets/include/faad2 -Ilibcodecs/targets/include/shine -Ilibcodecs/targets/include/soxr -Ilibcodecs/targets/include/addons -Ilibmdns/targets/include/mdnsvc -Ilibmdns/targets/include/mdnssd squeezelite/main.c -c -o bin/linux/x86_64/main.o
x86_64-linux-gnu-gcc  -Wno-deprecated-declarations -Wno-format-truncation -Wno-stringop-truncation  -Wall -fPIC -ggdb -O2 -DCODECS -DUSE_SSL -D_GNU_SOURCE -DUPNP_STATIC_LIB -DLINKALL -DRESAMPLE -fdata-sections -ffunction-sections   -Ilibopenssl/targets/linux/x86_64/include -Icrosstools/src -Isqueezelite -Isqueeze2upnp/inc -Ilibpupnp/targets/linux/x86_64/include/upnp -Ilibpupnp/targets/linux/x86_64/include/ixml -Ilibpupnp/targets/linux/x86_64/include/addons -Ilibcodecs/targets/include/flac -Ilibcodecs/targets/include/mad -Ilibcodecs/targets/include/ogg -Ilibcodecs/targets/include/vorbis -Ilibcodecs/targets/include/opus -Ilibcodecs/targets/include/opusfile -Ilibcodecs/targets/include/faad2 -Ilibcodecs/targets/include/shine -Ilibcodecs/targets/include/soxr -Ilibcodecs/targets/include/addons -Ilibmdns/targets/include/mdnsvc -Ilibmdns/targets/include/mdnssd squeezelite/stream.c -c -o bin/linux/x86_64/stream.o
x86_64-linux-gnu-gcc  -Wno-deprecated-declarations -Wno-format-truncation -Wno-stringop-truncation  -Wall -fPIC -ggdb -O2 -DCODECS -DUSE_SSL -D_GNU_SOURCE -DUPNP_STATIC_LIB -DLINKALL -DRESAMPLE -fdata-sections -ffunction-sections   -Ilibopenssl/targets/linux/x86_64/include -Icrosstools/src -Isqueezelite -Isqueeze2upnp/inc -Ilibpupnp/targets/linux/x86_64/include/upnp -Ilibpupnp/targets/linux/x86_64/include/ixml -Ilibpupnp/targets/linux/x86_64/include/addons -Ilibcodecs/targets/include/flac -Ilibcodecs/targets/include/mad -Ilibcodecs/targets/include/ogg -Ilibcodecs/targets/include/vorbis -Ilibcodecs/targets/include/opus -Ilibcodecs/targets/include/opusfile -Ilibcodecs/targets/include/faad2 -Ilibcodecs/targets/include/shine -Ilibcodecs/targets/include/soxr -Ilibcodecs/targets/include/addons -Ilibmdns/targets/include/mdnsvc -Ilibmdns/targets/include/mdnssd squeezelite/decode.c -c -o bin/linux/x86_64/decode.o
x86_64-linux-gnu-gcc  -Wno-deprecated-declarations -Wno-format-truncation -Wno-stringop-truncation  -Wall -fPIC -ggdb -O2 -DCODECS -DUSE_SSL -D_GNU_SOURCE -DUPNP_STATIC_LIB -DLINKALL -DRESAMPLE -fdata-sections -ffunction-sections   -Ilibopenssl/targets/linux/x86_64/include -Icrosstools/src -Isqueezelite -Isqueeze2upnp/inc -Ilibpupnp/targets/linux/x86_64/include/upnp -Ilibpupnp/targets/linux/x86_64/include/ixml -Ilibpupnp/targets/linux/x86_64/include/addons -Ilibcodecs/targets/include/flac -Ilibcodecs/targets/include/mad -Ilibcodecs/targets/include/ogg -Ilibcodecs/targets/include/vorbis -Ilibcodecs/targets/include/opus -Ilibcodecs/targets/include/opusfile -Ilibcodecs/targets/include/faad2 -Ilibcodecs/targets/include/shine -Ilibcodecs/targets/include/soxr -Ilibcodecs/targets/include/addons -Ilibmdns/targets/include/mdnsvc -Ilibmdns/targets/include/mdnssd squeezelite/pcm.c -c -o bin/linux/x86_64/pcm.o
In file included from squeezelite/output.c:22:
squeezelite/squeezelite.h:25:10: fatal error: platform.h: No such file or directory
   25 | #include "platform.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:109: bin/linux/x86_64/output.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from squeezelite/output_http.c:22:
squeezelite/squeezelite.h:25:10: fatal error: platform.h: No such file or directory
   25 | #include "platform.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:109: bin/linux/x86_64/output_http.o] Error 1
In file included from squeezelite/main.c:29:
squeezelite/squeezelite.h:25:10: fatal error: platform.h: No such file or directory
   25 | #include "platform.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:109: bin/linux/x86_64/main.o] Error 1
In file included from squeezelite/buffer.c:24:
squeezelite/squeezelite.h:25:10: fatal error: platform.h: No such file or directory
   25 | #include "platform.h"
      |          ^~~~~~~~~~~~
compilation terminated.
In file included from squeezelite/pcm.c:21:
squeezelite/squeezelite.h:25:10: fatal error: platform.h: No such file or directory
   25 | #include "platform.h"
      |          ^~~~~~~~~~~~
compilation terminated.
In file included from squeezelite/slimproto.c:39:
squeezelite/squeezelite.h:25:10: fatal error: platform.h: No such file or directory
   25 | #include "platform.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:109: bin/linux/x86_64/buffer.o] Error 1
make: *** [Makefile:109: bin/linux/x86_64/pcm.o] Error 1
make: *** [Makefile:109: bin/linux/x86_64/slimproto.o] Error 1
In file included from squeezelite/stream.c:24:
squeezelite/squeezelite.h:25:10: fatal error: platform.h: No such file or directory
   25 | #include "platform.h"
      |          ^~~~~~~~~~~~
compilation terminated.
In file included from squeezelite/decode.c:24:
squeezelite/squeezelite.h:25:10: fatal error: platform.h: No such file or directory
   25 | #include "platform.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:109: bin/linux/x86_64/stream.o] Error 1
make: *** [Makefile:109: bin/linux/x86_64/decode.o] Error 1

Not sure what I am doing wrong or I am missing here. Then lastly once this is done what is the process of installing the plugin?

Could you possibly point me into the right direction?

philippe44 commented 1 year ago

You have probably not cloned with sub-modules

somejavadev commented 1 year ago

Thank you, I forgot the --recurse-submodules -j8 flags when cloning. And then one other thing, once done does one simply copy the new static lib in the /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/UPnPBridge/Bin/ or is there another way one install it into your LMS?

philippe44 commented 1 year ago

No, installing the plugin is a different thing. There is a binary application (helper) that you compile using what you just got. That helper can run anywhere, including on the computer that runs LMS. That's like building any C/C++ app.

Then there is a Perl part that interacts with the LMS server. This Perl part is optional in my bridges but strongly recommended. To understand how LMS plugins work, you need to read about these.

Now if you are not familiar with all these and the concepts, I very strongly advise against building everything by yourself, especially the binary helpers. All is already pre-build and ready to use and install, just go on LMS forum.