summaryrefslogtreecommitdiff
path: root/recipes/librtmp
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2014-10-14 19:58:08 +0530
committerEdward Hervey <bilboed@bilboed.com>2014-10-16 09:39:19 +0200
commit3b72a25676f692d775976c6589abc68ee84be725 (patch)
treef0e5bfa23f89a101cb1e09233a2d7bfa0897bc86 /recipes/librtmp
parent2f6d65b03bafb23df429a6a4b9e726a7ff55333f (diff)
Revert "Revert "librtmp.recipe: Use same version as gentoo""
This reverts commit 2f6d65b03bafb23df429a6a4b9e726a7ff55333f and fixes cross-compilation by adding a new patch to the build system. https://bugzilla.gnome.org/show_bug.cgi?id=738579
Diffstat (limited to 'recipes/librtmp')
-rw-r--r--recipes/librtmp/0001-Fix-Makefiles-to-support-several-platforms.patch137
-rw-r--r--recipes/librtmp/0001-Fix-support-for-cross-compilation.patch52
-rw-r--r--recipes/librtmp/librtmp.recipe11
3 files changed, 58 insertions, 142 deletions
diff --git a/recipes/librtmp/0001-Fix-Makefiles-to-support-several-platforms.patch b/recipes/librtmp/0001-Fix-Makefiles-to-support-several-platforms.patch
deleted file mode 100644
index 04bb3734..00000000
--- a/recipes/librtmp/0001-Fix-Makefiles-to-support-several-platforms.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-From b5d245366a0c18004cec1294962dda6f3494954f Mon Sep 17 00:00:00 2001
-From: Andoni Morales Alastruey <ylatuya@gmail.com>
-Date: Wed, 1 Jan 2014 20:51:19 +0100
-Subject: [PATCH] Fix Makefiles to support several platforms
-
----
- librtmp/Makefile | 82 +++++++++++++++++++++++++++++++++-----------------------
- 1 file changed, 48 insertions(+), 34 deletions(-)
-
-diff --git a/librtmp/Makefile b/librtmp/Makefile
-index 6774db7..d864d6b 100644
---- a/librtmp/Makefile
-+++ b/librtmp/Makefile
-@@ -1,13 +1,26 @@
- VERSION=v2.3
-
-+ifndef prefix
- prefix=/usr/local
--
--CC=$(CROSS_COMPILE)gcc
--LD=$(CROSS_COMPILE)ld
--AR=$(CROSS_COMPILE)ar
--
-+endif
-+
-+ifndef CC
-+CC=gcc
-+endif
-+ifndef LD
-+LD=ld
-+endif
-+ifndef AR
-+AR=ar
-+endif
-+
-+ifndef SYS
- SYS=posix
-+endif
-+
-+ifndef CRYPTO
- CRYPTO=OPENSSL
-+endif
- #CRYPTO=GNUTLS
- DEF_POLARSSL=-DUSE_POLARSSL
- DEF_OPENSSL=-DUSE_OPENSSL
-@@ -25,21 +38,29 @@ CRYPTO_LIB=$(LIB_$(CRYPTO)) $(LIBS_$(SYS))
- CRYPTO_REQ=$(REQ_$(CRYPTO))
- CRYPTO_DEF=$(DEF_$(CRYPTO))
-
--SO_posix=so.0
--SO_mingw=dll
--SO_EXT=$(SO_$(SYS))
--
--SHARED=yes
--SODEF_yes=-fPIC
--SOLIB_yes=librtmp.$(SO_EXT)
--SOINST_yes=install_$(SO_EXT)
--SO_DEF=$(SODEF_$(SHARED))
--SO_LIB=$(SOLIB_$(SHARED))
--SO_INST=$(SOINST_$(SHARED))
--
--DEF=-DRTMPDUMP_VERSION=\"$(VERSION)\" $(CRYPTO_DEF) $(XDEF)
--OPT=-O2
--CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) $(SO_DEF)
-+ifeq ($(SYS),posix)
-+LIBRTMP=librtmp.so.0
-+LIBRTMP_L=librtmp.so
-+EXTRA_LDFLAGS=-Wl,-soname,$(LIBRTMP)
-+CREATE_L=ln -sf $(LIBRTMP) $(LIBRTMP_L)
-+INSTALL_LIB=cp $(LIBRTMP) $(LIBDIR)
-+endif
-+ifeq ($(SYS),mingw)
-+LIBRTMP=librtmp.dll
-+LIBRTMP_L=librtmp.dll.a
-+EXTRA_LDFLAGS=-Wl,--out-implib,$(LIBRTMP_L)
-+CREATE_L=
-+INSTALL_LIB=cp $(LIBRTMP) $(BINDIR)
-+endif
-+ifeq ($(SYS),darwin)
-+LIBRTMP=librtmp.0.dylib
-+LIBRTMP_L=librtmp.dylib
-+CREATE_L=ln -sf $(LIBRTMP) $(LIBRTMP_L)
-+INSTALL_LIB=cp $(LIBRTMP) $(LIBDIR)
-+endif
-+INSTALL_L=cp $(LIBRTMP_L) $(LIBDIR)
-+
-+CFLAGS:=$(CFLAGS) -fPIC -DRTMPDUMP_VERSION=\"$(VERSION)\" $(CRYPTO_DEF)
-
- incdir=$(prefix)/include/librtmp
- bindir=$(prefix)/bin
-@@ -52,7 +73,7 @@ MANDIR=$(DESTDIR)$(mandir)
-
- OBJS=rtmp.o log.o amf.o hashswf.o parseurl.o
-
--all: librtmp.a $(SO_LIB)
-+all: librtmp.a $(LIBRTMP)
-
- clean:
- rm -f *.o *.a *.so *.$(SO_EXT)
-@@ -60,9 +81,9 @@ clean:
- librtmp.a: $(OBJS)
- $(AR) rs $@ $?
-
--librtmp.$(SO_EXT): $(OBJS)
-- $(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $^ $> $(CRYPTO_LIB)
-- ln -sf $@ librtmp.so
-+$(LIBRTMP): $(OBJS)
-+ $(CC) -shared $(EXTRA_LDFLAGS) $(LDFLAGS) -o $@ $^ $> $(CRYPTO_LIB)
-+ $(CREATE_L)
-
- log.o: log.c log.h Makefile
- rtmp.o: rtmp.c rtmp.h rtmp_sys.h handshake.h dh.h log.h amf.h Makefile
-@@ -74,18 +95,11 @@ librtmp.pc: librtmp.pc.in Makefile
- sed -e "s;@prefix@;$(prefix);" -e "s;@VERSION@;$(VERSION);" \
- -e "s;@CRYPTO_REQ@;$(CRYPTO_REQ);" librtmp.pc.in > $@
-
--install: install_base $(SO_INST)
--
--install_base: librtmp.a librtmp.pc
-+install: librtmp.a librtmp.pc
- -mkdir -p $(INCDIR) $(LIBDIR)/pkgconfig $(MANDIR)/man3
- cp amf.h http.h log.h rtmp.h $(INCDIR)
- cp librtmp.a $(LIBDIR)
- cp librtmp.pc $(LIBDIR)/pkgconfig
- cp librtmp.3 $(MANDIR)/man3
--
--install_so.0: librtmp.so.0
-- cp librtmp.so.0 $(LIBDIR)
-- cd $(LIBDIR); ln -sf librtmp.so.0 librtmp.so
--
--install_dll: librtmp.dll
-- cp librtmp.dll $(BINDIR)
-+ $(INSTALL_LIB)
-+ $(INSTALL_L)
---
-1.8.3.2
-
diff --git a/recipes/librtmp/0001-Fix-support-for-cross-compilation.patch b/recipes/librtmp/0001-Fix-support-for-cross-compilation.patch
new file mode 100644
index 00000000..fc82178c
--- /dev/null
+++ b/recipes/librtmp/0001-Fix-support-for-cross-compilation.patch
@@ -0,0 +1,52 @@
+From 62a500033bd745684c3fd1802b3cf755755451c7 Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek@centricular.com>
+Date: Tue, 14 Oct 2014 21:02:51 +0530
+Subject: [PATCH] Fix support for cross-compilation
+
+---
+ librtmp/Makefile | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/librtmp/Makefile b/librtmp/Makefile
+index 2c1c790..f4e2a0b 100644
+--- a/librtmp/Makefile
++++ b/librtmp/Makefile
+@@ -1,6 +1,7 @@
+ VERSION=v2.4
+
+-prefix=/usr/local
++prefix?=/usr/local
++pkgconfig?=$(shell which pkg-config)
+
+ incdir=$(prefix)/include/librtmp
+ bindir=$(prefix)/bin
+@@ -11,12 +12,12 @@ INCDIR=$(DESTDIR)$(incdir)
+ LIBDIR=$(DESTDIR)$(libdir)
+ MANDIR=$(DESTDIR)$(mandir)
+
+-CC=$(CROSS_COMPILE)gcc
+-LD=$(CROSS_COMPILE)ld
+-AR=$(CROSS_COMPILE)ar
++CC?=$(CROSS_COMPILE)gcc
++LD?=$(CROSS_COMPILE)ld
++AR?=$(CROSS_COMPILE)ar
+
+-SYS=posix
+-CRYPTO=OPENSSL
++SYS?=posix
++CRYPTO?=OPENSSL
+ #CRYPTO=GNUTLS
+ DEF_POLARSSL=-DUSE_POLARSSL
+ DEF_OPENSSL=-DUSE_OPENSSL
+@@ -29,7 +30,7 @@ LIBZ=-lz
+ LIBS_posix=
+ LIBS_darwin=
+ LIBS_mingw=-lws2_32 -lwinmm -lgdi32
+-LIB_GNUTLS=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ)
++LIB_GNUTLS=$(shell $(pkgconfig) --libs gnutls nettle hogweed) -lgmp $(LIBZ)
+ LIB_OPENSSL=-lssl -lcrypto $(LIBZ)
+ LIB_POLARSSL=-lpolarssl $(LIBZ)
+ PRIVATE_LIBS=$(LIBS_$(SYS))
+--
+1.9.3
+
diff --git a/recipes/librtmp/librtmp.recipe b/recipes/librtmp/librtmp.recipe
index f6d81f2c..685202c6 100644
--- a/recipes/librtmp/librtmp.recipe
+++ b/recipes/librtmp/librtmp.recipe
@@ -4,15 +4,15 @@ from cerbero.tools.libtool import LibtoolLibrary
class Recipe(recipe.Recipe):
name = 'librtmp'
- version = '2.3'
+ version = '2.4_p20131018'
stype = SourceType.TARBALL
btype = BuildType.MAKEFILE
- url = 'http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz'
+ url = 'http://people.freedesktop.org/~bilboed/rtmpdump-2.4_p20131018.tar.bz2'
licenses = [License.LGPLv2_1]
srcdir = 'librtmp'
tarball_dirname = 'rtmpdump-%(version)s'
- patches = ['0001-Fix-Makefiles-to-support-several-platforms.patch']
- deps = ['gnutls', 'libgcrypt']
+ patches = ['0001-Fix-support-for-cross-compilation.patch']
+ deps = ['gnutls', 'libgcrypt', 'nettle']
files_libs = ['librtmp']
files_devel = ['include/librtmp/', 'lib/pkgconfig/librtmp.pc' ]
@@ -24,7 +24,8 @@ class Recipe(recipe.Recipe):
system = 'darwin'
if self.config.target_platform in [Platform.LINUX, Platform.ANDROID]:
system = 'posix'
- self.make = 'make SYS=%s prefix=$CERBERO_PREFIX CRYPTO=GNUTLS' % (system)
+ # LDFLAGS are passed via XLDFLAGS, and are needed for at least Android
+ self.make = 'make SYS=%s prefix="$CERBERO_PREFIX" CRYPTO=GNUTLS XLDFLAGS="$LDFLAGS"' % (system)
self.make_install = 'make install SYS=%s prefix=$CERBERO_PREFIX CRYPTO=GNUTLS' % (system)
def post_install(self):