Compiling with build.sh#
With the build.sh script you can easily build myMPD and create your own packages. Downstream packagers should use cmake directly.
Compiling and installing#
The build.sh script provides three compile targets for myMPD.
Hint
If compilation fails and you are building on top of an old version, try to run ./build.sh cleanup before.
Release#
./build.sh releaseBuilds release binaries
Directory: release
Assets embedded in binary
Binary is stripped
Install prefix is
/usr
./build.sh installinstalls the release binaries (run as root)
You can use ./build.sh releaseinstall to compile and install in one step.
Debug#
./build.sh debugBuilds debug binaries
Directory: debug
Plain assets in htdocs directory
Use this to debug mympd with valgrind or gdb
Sanitizers#
./build.sh <asan|tsan|ubsan>Builds debug binaries linked with address sanitizers
Directory: debug
Plain assets in htdocs directory
You must eventually preload the sanitizer library, e.g.
LD_PRELOAD=libasan.so.6 debug/bin/mympd
Removing#
./build.sh uninstallto remove only binaries./build.sh purgeto remove all
Create distribution specific packages#
You can self create packages for your distribution:
./build.sh pkgalpinefor Alpine Linux./build.sh pkgarchfor Arch based distributions (e.g. Manjaro)./build.sh pkgdebianfor Debian based distributions (e.g. Ubuntu or Raspbian)./build.sh pkgrpmfor RPM based distributions (e.g. openSUSE, Fedora)./build.sh pkgdockerto create a Docker image based on Alpine LinuxFor gentoo you have to create a local overlay, the ebuild file is in the directory
contrib/packaging/gentooBuild a OpenWrt package
Cross compiling debian packages#
The build script can use sbuild and qemu to cross compile debian packages, thanks to #264 @tsunulukai.
Set target distributions:
export DISTROS="bullseye buster"Set target architectures:
export TARGETS="armhf armel"sudo -E ./build.sh sbuild_chrootsto create chroot environments for buildsudo -E ./build.sh sbuild_buildto build the packages
The successfully build packages can be found in the packager/builds directory.