blob: b1634732cf03715485fff0793098341792607bb5 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "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, and libopenmpt_modplug, \
5a wrapper around libopenmpt that provides an interface that is ABI compatile with \
6libmodplug. libopenmpt is based on the player code of the OpenMPT project."
7HOMEPAGE = "https://lib.openmpt.org/libopenmpt/"
8SECTION = "libs"
9
10LICENSE = "BSD-3-Clause"
11LIC_FILES_CHKSUM = "file://LICENSE;md5=e804150573f149befef6c07e173f20c3"
12
13DEPENDS = "virtual/libiconv"
14
15SRC_URI = "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${PV}+release.autotools.tar.gz \
16 file://run-ptest \
17 "
18SRC_URI[md5sum] = "66bbc6fbb5f27a554cb145d805e9ef9d"
19SRC_URI[sha256sum] = "14a137b8d1a20e1b6a5e67cbc9467ab7e5e4e67d5aa38a247afc825685c53939"
20
21S = "${WORKDIR}/libopenmpt-${PV}+release.autotools"
22
23inherit autotools pkgconfig ptest
24
25PACKAGECONFIG ??= " \
26 libopenmpt-modplug openmpt123 \
27 ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
28 flac mpg123 ogg sndfile vorbis vorbisfile zlib \
29 ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
30"
31
32# libopenmpt_modplug is a library that wraps libopenmpt calls into
33# functions that are ABI compatible with libmodplug. This allows for
34# using modplug headers and linking against libopenmpt_modplug
35# instead of against the original libmodplug library.
36# NOTE: The wrapper is compatible to the ABI from libmodplug version
37# 0.8.8 and newer.
38PACKAGECONFIG[libopenmpt-modplug] = "--enable-libopenmpt_modplug,--disable-libopenmpt_modplug"
39PACKAGECONFIG[openmpt123] = "--enable-openmpt123,--disable-openmpt123"
40PACKAGECONFIG[tests] = "--enable-tests,--disable-tests"
41
42# These packageconfigs affect openmpt123
43PACKAGECONFIG[flac] = "--with-flac,--without-flac,flac"
44PACKAGECONFIG[mpg123] = "--with-mpg123,--without-mpg123,mpg123"
45PACKAGECONFIG[ogg] = "--with-ogg,--without-ogg,libogg"
46PACKAGECONFIG[portaudio] = "--with-portaudio,--without-portaudio,portaudio-v19"
47PACKAGECONFIG[pulseaudio] = "--with-pulseaudio,--without-pulseaudio,pulseaudio"
48PACKAGECONFIG[sdl] = "--with-sdl,--without-sdl,virtual/libsdl"
49PACKAGECONFIG[sdl2] = "--with-sdl2,--without-sdl2,virtual/libsdl2"
50PACKAGECONFIG[sndfile] = "--with-sndfile,--without-sndfile,libsndfile1"
51PACKAGECONFIG[vorbis] = "--with-vorbis,--without-vorbis,libvorbis"
52PACKAGECONFIG[vorbisfile] = "--with-vorbisfile,--without-vorbisfile,libvorbis"
53PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
54
55# --disable-libmodplug is necessary, since otherwise we'd
56# have a collision with the libmodplug package, because of the
57# libmodplug.so file. (libmodplug.so from libopenmpt isintended
58# to be used as a drop-in replacement, and according to the
59# documentation, is not complete.)
60EXTRA_OECONF += " \
61 --disable-doxygen-doc \
62 --disable-examples \
63 --disable-libmodplug \
64 --without-portaudiocpp \
65"
66
67do_compile_ptest() {
68 oe_runmake ${PARALLEL_MAKE} libopenmpttest
69}
70
71do_install_ptest() {
72 install -d ${D}${PTEST_PATH}/test
73 install -m 0755 ${B}/libopenmpttest ${D}${PTEST_PATH}
74 install -m 0644 ${S}/test/test.mptm ${D}${PTEST_PATH}/test
75 install -m 0644 ${S}/test/test.s3m ${D}${PTEST_PATH}/test
76 install -m 0644 ${S}/test/test.xm ${D}${PTEST_PATH}/test
77
78 install -d ${D}${PTEST_PATH}/libopenmpt
79 install -m 0644 ${S}/libopenmpt/libopenmpt_version.mk ${D}${PTEST_PATH}/libopenmpt
80}
81
82python __anonymous() {
83 packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
84 if ("sdl" in packageconfig) and ("sdl2" in packageconfig):
85 bb.error("sdl and sdl2 packageconfigs cannot be both enabled")
86}
87
88PACKAGES =+ "${PN}-modplug ${PN}-openmpt123 ${PN}-openmpt123-doc"
Patrick Williams213cb262021-08-07 19:21:33 -050089FILES:${PN}-modplug = "${libdir}/libopenmpt_modplug.so.*"
90FILES:${PN}-openmpt123 = "${bindir}/openmpt123"
91FILES:${PN}-openmpt123-doc = "${mandir}/man1/openmpt123*"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080092
93# Since version 0.3, libopenmpt uses SemVer 2.0.0 versioning.
94# The SemVer versioning scheme is incompatible with Debian/Ubuntu
95# package version names.
Patrick Williams213cb262021-08-07 19:21:33 -050096DEBIAN_NOAUTONAME:${PN} = "1"
97DEBIAN_NOAUTONAME:${PN}-modplug = "1"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080098
Patrick Williams213cb262021-08-07 19:21:33 -050099RDEPENDS:${PN}:libc-glibc = " \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800100 glibc-gconv-cp1252 \
101 glibc-gconv-ibm437 \
102 glibc-gconv-iso8859-1 \
103 glibc-gconv-iso8859-15 \
104"