aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb
blob: 05a8a47631a49c16cf8ec407565e0c290e5d920f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
SUMMARY = "Library for interacting with ID3 tags in MP3 files"
HOMEPAGE = "http://sourceforge.net/projects/mad/"
BUGTRACKER = "http://sourceforge.net/tracker/?group_id=12349&atid=112349"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
			file://COPYRIGHT;md5=5e6279efb87c26c6e5e7a68317a6a87a \
			file://version.h;beginline=1;endline=8;md5=86ac68b67f054b7afde9e149bbc3fe63"
SECTION = "libs"
DEPENDS = "zlib gperf-native"
PR = "r7"

SRC_URI = "ftp://ftp.mars.org/pub/mpeg/libid3tag-${PV}.tar.gz \
           file://addpkgconfig.patch \
           file://obsolete_automake_macros.patch \
"

SRC_URI[md5sum] = "e5808ad997ba32c498803822078748c3"
SRC_URI[sha256sum] = "63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151"

S = "${WORKDIR}/libid3tag-${PV}"

inherit autotools pkgconfig
""" import inspect import types available_types = {} class MissingFlag(TypeError): """A particular flag is required to construct the type, but has not been provided.""" def __init__(self, flag, type): self.flag = flag self.type = type TypeError.__init__(self) def __str__(self): return "Type '%s' requires flag '%s'" % (self.type, self.flag) def factory(var_type): """Return the factory for a specified type.""" if var_type is None: raise TypeError("No type specified. Valid types: %s" % ', '.join(available_types)) try: return available_types[var_type] except KeyError: raise TypeError("Invalid type '%s':\n Valid types: %s" % (var_type, ', '.join(available_types))) def create(value, var_type, **flags): """Create an object of the specified type, given the specified flags and string value.""" obj = factory(var_type) objflags = {} for flag in obj.flags: if flag not in flags: if flag not in obj.optflags: raise MissingFlag(flag, var_type) else: objflags[flag] = flags[flag] return obj(value, **objflags) def get_callable_args(obj): """Grab all but the first argument of the specified callable, returning the list, as well as a list of which of the arguments have default values.""" if type(obj) is type: obj = obj.__init__ args, varargs, keywords, defaults = inspect.getargspec(obj) flaglist = [] if args: if len(args) > 1 and args[0] == 'self': args = args[1:] flaglist.extend(args) optional = set() if defaults: optional |= set(flaglist[-len(defaults):]) return flaglist, optional def factory_setup(name, obj): """Prepare a factory for use.""" args, optional = get_callable_args(obj) extra_args = args[1:] if extra_args: obj.flags, optional = extra_args, optional obj.optflags = set(optional) else: obj.flags = obj.optflags = () if not hasattr(obj, 'name'): obj.name = name def register(name, factory): """Register a type, given its name and a factory callable. Determines the required and optional flags from the factory's arguments.""" factory_setup(name, factory) available_types[factory.name] = factory # Register all our included types for name in dir(types): if name.startswith('_'): continue obj = getattr(types, name) if not callable(obj): continue register(name, obj)