2014-08-04 08:44:21 +00:00
|
|
|
def __cp_to_variant__(ctx, variant, basename):
|
2014-10-11 18:35:10 +00:00
|
|
|
src = ctx.bldnode.search_node(basename).read()
|
2014-08-04 08:44:21 +00:00
|
|
|
node = ctx.bldnode.make_node("{0}/{1}".format(variant, basename))
|
|
|
|
node.parent.mkdir()
|
|
|
|
node.write(src)
|
|
|
|
|
2013-07-16 11:28:28 +00:00
|
|
|
def __write_config_h__(ctx):
|
|
|
|
ctx.start_msg("Writing configuration header:")
|
|
|
|
ctx.write_config_header('config.h')
|
2014-08-04 08:44:21 +00:00
|
|
|
__cp_to_variant__(ctx, ctx.options.variant, 'config.h')
|
2013-07-16 11:28:28 +00:00
|
|
|
ctx.end_msg("config.h", "PINK")
|
|
|
|
|
2015-01-02 02:06:06 +00:00
|
|
|
# Approximately escape the string as C string literal
|
|
|
|
def __escape_c_string(s):
|
|
|
|
return s.replace("\"", "\\\"").replace("\n", "\\n")
|
|
|
|
|
2015-03-11 22:33:05 +00:00
|
|
|
def __get_features_string__(ctx):
|
2015-07-26 13:00:47 +00:00
|
|
|
import inflector
|
2015-03-11 22:33:05 +00:00
|
|
|
stuff = []
|
|
|
|
for dependency_identifier in ctx.satisfied_deps:
|
2015-07-26 13:00:47 +00:00
|
|
|
defkey = inflector.define_key(dependency_identifier)
|
2015-03-11 22:33:05 +00:00
|
|
|
if ctx.is_defined(defkey) and ctx.get_define(defkey) == "1":
|
|
|
|
stuff.append(dependency_identifier)
|
|
|
|
stuff.sort()
|
|
|
|
return " ".join(stuff)
|
|
|
|
|
2015-01-02 02:18:16 +00:00
|
|
|
def __add_mpv_defines__(ctx):
|
2013-07-16 11:28:28 +00:00
|
|
|
from sys import argv
|
|
|
|
ctx.define("CONFIGURATION", " ".join(argv))
|
2016-01-11 15:35:30 +00:00
|
|
|
ctx.define("MPV_CONFDIR", ctx.env.CONFLOADDIR)
|
2015-03-11 22:33:05 +00:00
|
|
|
ctx.define("FULLCONFIG", __escape_c_string(__get_features_string__(ctx)))
|
demux_mkv: change license to LGPL
Most contributors have agreed. This claims it's based on gstreamer code,
but this was LGPL at the time (and still is). Contributors whose code
was removed were not accounted for. There are still some potentially
problematic cases:
06eee1b67 is potentially the most problematic case. Most of these
changes are gone due to mpv not using BITMAPINFOHEADER anymore. Some
of the other changes are rather trivial. If someone contests this and
claims that copyrightable changes are left, the original change can
simply be reverted.
62bfae140 has only 2 lines left: a "char *name;" struct field, and a
line that prints a message. All other code was removed. The parsing code
in particular was made declarative, which replaced reading this element
explicitly (and other elements, see 1b22101c77e). I'm putting the log
message under HAVE_GPL, but I don't think the declaration is
copyrightable, or the mere concept of reading this element. Redoing the
other 2 lines of code would result in the same program text.
d41e860ba was applied by someone who (potentially) disagreed. The patch
itself is from someone who did agree, though. It's unknown whether the
applier changed the patch. But it seems unlikely, and the change was
mostly rewritten.
50a86fcc3 all demux_mkv changes were reverted (old stdout slave mode)
3a406e94d same
2e40bfa13 the old MPlayer subtitle code was completely removed
316bb1d44 completely removed in 1cf4802c1d
87f93d9d7 same
11bfc6780 relative seeks were removed in 92ba630796
be54f4813 the corresponding demux_mkv code was removed in 5dabaaf093
efd53eed6 all internal vobsub handling is now in FFmpeg
d7f693a20 removed in f3db4b0b937
e8a1b3713 removed in 522ee6b7831
cfb890259 removed, see 6b1374b203 for analysis
c80808b5a same
2017-04-21 10:18:55 +00:00
|
|
|
ctx.define("HAVE_GPL", 1)
|
2013-07-16 11:28:28 +00:00
|
|
|
|
|
|
|
def configure(ctx):
|
2015-01-02 02:18:16 +00:00
|
|
|
__add_mpv_defines__(ctx)
|
2013-07-16 11:28:28 +00:00
|
|
|
__write_config_h__(ctx)
|