1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from cerbero.tools.libtool import LibtoolLibrary
class Recipe(recipe.Recipe):
name = 'librtmp'
version = '2.4_p20200229'
stype = SourceType.TARBALL
btype = BuildType.MAKEFILE
url = 'https://gstreamer.freedesktop.org/data/src/mirror/rtmpdump-%(version)s.tar.xz'
tarball_checksum = 'ac4ebe131254da6f49d17b77df42b1419155fb09d38d8a8bf785fdc16bfca418'
# Binaries are GPLv2+, but we don't distribute them
licenses = [License.LGPLv2_1Plus, {License.MIT: ['LICENSE-vcpkg-changes.txt']}]
srcdir = 'librtmp'
tarball_dirname = 'rtmpdump-%(version)s'
patches = [
# Our patches, upstream is non-existent
name + '/0001-Fix-support-for-cross-compilation.patch',
# vcpkg patches, porting to openssl and fixing windows bugs, since
# upstream is non-existent
name + '/0003-Port-to-openssl-1.1.1.patch',
name + '/0004-Port-to-newer-MSVC.patch',
name + '/0005-Fix-debug-build.patch',
name + '/0006-Add-license-for-vcpkg-changes.patch',
name + '/0007-Make-libdir-configurable.patch',
]
# openssl on Linux
use_system_libs = True
files_libs = ['librtmp']
files_devel = ['include/librtmp', '%(libdir)s/pkgconfig/librtmp.pc']
def prepare(self):
# Pick system openssl if on Linux and not cross-compiling
if self.config.target_platform != Platform.LINUX or self.config.cross_compiling():
self.deps.append('openssl')
if self.config.target_platform == Platform.WINDOWS:
system = 'mingw'
elif self.config.target_platform in [Platform.DARWIN, Platform.IOS]:
system = 'darwin'
elif self.config.target_platform in [Platform.LINUX, Platform.ANDROID]:
system = 'posix'
# LDFLAGS are passed via XLDFLAGS, and are needed for at least Android
cc = self.get_env('CC')
ld = self.get_env('LD')
prefix = self.config.prefix
cflags = self.get_env('CFLAGS')
ldflags = self.get_env('LDFLAGS')
self.make += ['SYS=' + system, 'prefix=' + prefix, 'CRYPTO=OPENSSL', 'XCFLAGS=' + cflags,
'XLDFLAGS=' + ldflags, 'CC=' + cc, 'LD=' + ld, 'libdir=' + self.config.libdir]
self.make_install = self.make + ['install']
def post_install(self):
soversion = 1
# On Windows, rtmp installs a duplicate DLL by trying to symlink which
# results in a copy under MinGW since symlinks aren't supported there.
if self.config.target_platform == Platform.WINDOWS:
dlldir = os.path.join(self.config.prefix, 'bin')
real_rtmp_dll = os.path.join(dlldir, 'librtmp-{}.dll'.format(soversion))
dupe_rtmp_dll = os.path.join(dlldir, 'librtmp.dll')
if os.path.isfile(dupe_rtmp_dll) and os.path.isfile(real_rtmp_dll):
os.remove(dupe_rtmp_dll)
deps = ['ssl', 'crypto']
libtool_la = LibtoolLibrary('rtmp', soversion, None, None,
self.config.libdir, self.config.target_platform, deps)
libtool_la.save()
super().post_install()
|