blob: a7b6b000761d200118033115f9a55a76d619f3e4 [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001SUMMARY = "C and C++ cross-platform library for decoding tracked music files (modules)"
2DESCRIPTION = "libopenmpt is a cross-platform C++ and C library to decode tracked \
3music files (modules) into a raw PCM audio stream. It also comes with openmpt123, a \
4cross-platform command-line or terminal based module file player. libopenmpt is based \
5on the player code of the OpenMPT project."
6HOMEPAGE = "https://lib.openmpt.org/libopenmpt/"
7SECTION = "libs"
8
9LICENSE = "BSD-3-Clause"
10LIC_FILES_CHKSUM = "file://LICENSE;md5=ae09d6164bdecb499183479fd32b66fb"
11
12DEPENDS = "virtual/libiconv"
13
14SRC_URI = "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${PV}+release.autotools.tar.gz \
15 file://run-ptest \
16 "
17SRC_URI[md5sum] = "d21fb799695cbe10a1e9aeaea23ed708"
18SRC_URI[sha256sum] = "50c0d62ff2d9afefa36cce9f29042cb1fb8d4f0b386b81a0fc7734f35e21e6b6"
19
20S = "${WORKDIR}/libopenmpt-${PV}+release.autotools"
21
22inherit autotools pkgconfig ptest
23
24PACKAGECONFIG ??= " \
25 openmpt123 \
26 ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
27 flac mpg123 ogg sndfile vorbis vorbisfile zlib \
28 ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
29"
30
31PACKAGECONFIG[openmpt123] = "--enable-openmpt123,--disable-openmpt123"
32PACKAGECONFIG[tests] = "--enable-tests,--disable-tests"
33
34# These packageconfigs affect openmpt123
35PACKAGECONFIG[flac] = "--with-flac,--without-flac,flac"
36PACKAGECONFIG[mpg123] = "--with-mpg123,--without-mpg123,mpg123"
37PACKAGECONFIG[ogg] = "--with-ogg,--without-ogg,libogg"
38PACKAGECONFIG[portaudio] = "--with-portaudio,--without-portaudio,portaudio-v19"
39PACKAGECONFIG[pulseaudio] = "--with-pulseaudio,--without-pulseaudio,pulseaudio"
40PACKAGECONFIG[sdl2] = "--with-sdl2,--without-sdl2,virtual/libsdl2"
41PACKAGECONFIG[sndfile] = "--with-sndfile,--without-sndfile,libsndfile1"
42PACKAGECONFIG[vorbis] = "--with-vorbis,--without-vorbis,libvorbis"
43PACKAGECONFIG[vorbisfile] = "--with-vorbisfile,--without-vorbisfile,libvorbis"
44PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
45
46EXTRA_OECONF += " \
47 --disable-doxygen-doc \
48 --disable-examples \
49 --without-portaudiocpp \
50"
51
52do_compile_ptest() {
53 oe_runmake ${PARALLEL_MAKE} libopenmpttest
54}
55
56do_install_ptest() {
57 install -d ${D}${PTEST_PATH}/test
58 install -m 0755 ${B}/libopenmpttest ${D}${PTEST_PATH}
59 install -m 0644 ${S}/test/test.mptm ${D}${PTEST_PATH}/test
60 install -m 0644 ${S}/test/test.s3m ${D}${PTEST_PATH}/test
61 install -m 0644 ${S}/test/test.xm ${D}${PTEST_PATH}/test
62
63 install -d ${D}${PTEST_PATH}/libopenmpt
64 install -m 0644 ${S}/libopenmpt/libopenmpt_version.mk ${D}${PTEST_PATH}/libopenmpt
65}
66
67python __anonymous() {
68 packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
69 if ("sdl" in packageconfig) and ("sdl2" in packageconfig):
70 bb.error("sdl and sdl2 packageconfigs cannot be both enabled")
71}
72
73PACKAGES =+ "${PN}-openmpt123 ${PN}-openmpt123-doc"
74FILES:${PN}-openmpt123 = "${bindir}/openmpt123"
75FILES:${PN}-openmpt123-doc = "${mandir}/man1/openmpt123*"
76
77# Since version 0.3, libopenmpt uses SemVer 2.0.0 versioning.
78# The SemVer versioning scheme is incompatible with Debian/Ubuntu
79# package version names.
80DEBIAN_NOAUTONAME:${PN} = "1"
81
82RDEPENDS:${PN}:libc-glibc = " \
83 glibc-gconv-cp1252 \
84 glibc-gconv-ibm437 \
85 glibc-gconv-iso8859-1 \
86 glibc-gconv-iso8859-15 \
87"