Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | SUMMARY = "C and C++ cross-platform library for decoding tracked music files (modules)" |
| 2 | DESCRIPTION = "libopenmpt is a cross-platform C++ and C library to decode tracked \ |
| 3 | music files (modules) into a raw PCM audio stream. It also comes with openmpt123, a \ |
| 4 | cross-platform command-line or terminal based module file player, and libopenmpt_modplug, \ |
| 5 | a wrapper around libopenmpt that provides an interface that is ABI compatile with \ |
| 6 | libmodplug. libopenmpt is based on the player code of the OpenMPT project." |
| 7 | HOMEPAGE = "https://lib.openmpt.org/libopenmpt/" |
| 8 | SECTION = "libs" |
| 9 | |
| 10 | LICENSE = "BSD-3-Clause" |
| 11 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e804150573f149befef6c07e173f20c3" |
| 12 | |
| 13 | DEPENDS = "virtual/libiconv" |
| 14 | |
| 15 | SRC_URI = "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${PV}+release.autotools.tar.gz \ |
| 16 | file://run-ptest \ |
| 17 | " |
| 18 | SRC_URI[md5sum] = "66bbc6fbb5f27a554cb145d805e9ef9d" |
| 19 | SRC_URI[sha256sum] = "14a137b8d1a20e1b6a5e67cbc9467ab7e5e4e67d5aa38a247afc825685c53939" |
| 20 | |
| 21 | S = "${WORKDIR}/libopenmpt-${PV}+release.autotools" |
| 22 | |
| 23 | inherit autotools pkgconfig ptest |
| 24 | |
| 25 | PACKAGECONFIG ??= " \ |
| 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. |
| 38 | PACKAGECONFIG[libopenmpt-modplug] = "--enable-libopenmpt_modplug,--disable-libopenmpt_modplug" |
| 39 | PACKAGECONFIG[openmpt123] = "--enable-openmpt123,--disable-openmpt123" |
| 40 | PACKAGECONFIG[tests] = "--enable-tests,--disable-tests" |
| 41 | |
| 42 | # These packageconfigs affect openmpt123 |
| 43 | PACKAGECONFIG[flac] = "--with-flac,--without-flac,flac" |
| 44 | PACKAGECONFIG[mpg123] = "--with-mpg123,--without-mpg123,mpg123" |
| 45 | PACKAGECONFIG[ogg] = "--with-ogg,--without-ogg,libogg" |
| 46 | PACKAGECONFIG[portaudio] = "--with-portaudio,--without-portaudio,portaudio-v19" |
| 47 | PACKAGECONFIG[pulseaudio] = "--with-pulseaudio,--without-pulseaudio,pulseaudio" |
| 48 | PACKAGECONFIG[sdl] = "--with-sdl,--without-sdl,virtual/libsdl" |
| 49 | PACKAGECONFIG[sdl2] = "--with-sdl2,--without-sdl2,virtual/libsdl2" |
| 50 | PACKAGECONFIG[sndfile] = "--with-sndfile,--without-sndfile,libsndfile1" |
| 51 | PACKAGECONFIG[vorbis] = "--with-vorbis,--without-vorbis,libvorbis" |
| 52 | PACKAGECONFIG[vorbisfile] = "--with-vorbisfile,--without-vorbisfile,libvorbis" |
| 53 | PACKAGECONFIG[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.) |
| 60 | EXTRA_OECONF += " \ |
| 61 | --disable-doxygen-doc \ |
| 62 | --disable-examples \ |
| 63 | --disable-libmodplug \ |
| 64 | --without-portaudiocpp \ |
| 65 | " |
| 66 | |
| 67 | do_compile_ptest() { |
| 68 | oe_runmake ${PARALLEL_MAKE} libopenmpttest |
| 69 | } |
| 70 | |
| 71 | do_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 | |
| 82 | python __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 | |
| 88 | PACKAGES =+ "${PN}-modplug ${PN}-openmpt123 ${PN}-openmpt123-doc" |
| 89 | FILES_${PN}-modplug = "${libdir}/libopenmpt_modplug.so.*" |
| 90 | FILES_${PN}-openmpt123 = "${bindir}/openmpt123" |
| 91 | FILES_${PN}-openmpt123-doc = "${mandir}/man1/openmpt123*" |
| 92 | |
| 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. |
| 96 | DEBIAN_NOAUTONAME_${PN} = "1" |
| 97 | DEBIAN_NOAUTONAME_${PN}-modplug = "1" |
| 98 | |
| 99 | RDEPENDS_${PN}_libc-glibc = " \ |
| 100 | glibc-gconv-cp1252 \ |
| 101 | glibc-gconv-ibm437 \ |
| 102 | glibc-gconv-iso8859-1 \ |
| 103 | glibc-gconv-iso8859-15 \ |
| 104 | " |