Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 06/12] librtmp: new package
Date: Sun, 19 Jan 2014 16:25:09 +0100	[thread overview]
Message-ID: <20140119152509.GB3387@free.fr> (raw)
In-Reply-To: <1389831355-19983-7-git-send-email-maxime.hadjinlian@gmail.com>

On 2014-01-16 01:15 +0100, Maxime Hadjinlian spake thusly:
> rtmpdump - RTMPDump Real-Time Messaging Protocol API
> This package was originally found at : https://github.com/huceke/buildroot-rbp
> By gimli <ebsi4711@gmail.com>
> 
> Note that this package will only install librtmp in this state.
> Hence the name librtmp instead of rtmpdump

Just call it rtmpdump, even if it currently only install librtmp: when
we also build rtmpdump, we'd have to rename the package, which would
require adding yet another Config.in.legacy option.

Better to avoid it from the beginning if we can, no?

You may just have the prompt read "librtmp" if you prefer (I'm OK with
that), but just name the package from its upstream name.

(IIRC, we already have some package (eg. flex?) that by default only
install a library, and require a specific option to activate the tool).

[--SNIP--]
> diff --git a/package/librtmp/librtmp.mk b/package/librtmp/librtmp.mk
> new file mode 100644
> index 0000000..3cb1b91
> --- /dev/null
> +++ b/package/librtmp/librtmp.mk
> @@ -0,0 +1,51 @@
> +################################################################################
> +#
> +#librtmp
> +#
> +################################################################################
> +
> +LIBRTMP_VERSION = e0056c51cc1710c9a44d2a2c4e2f344fa9cabcf4
> +LIBRTMP_SITE = git://git.ffmpeg.org/rtmpdump
> +LIBRTMP_INSTALL_STAGING = YES
> +# Note that LIBRTMP is GPLv2 but librtmp has its own license and since we only

s/LIBRTMP/rtmdump/

> +# care about the librtmp, it's LGPLv2.1+

s/the librtmp/librtmp/

> +LIBRTMP_LICENSE = LGPLv2.1+
> +LIBRTMP_LICENSE_FILES = librtmp/COPYING
> +LIBRTMP_DEPENDENCIES = zlib

> +ifeq ($(BR2_PACKAGE_GNUTLS),y)
> +    LIBRTMP_DEPENDENCIES += gnutls
> +else
> +    ifeq ($(BR2_PACKAGE_POLARSSL),y)

We normaly don't indent nested ifeq-blocks.

> +        LIBRTMP_DEPENDENCIES += polarssl
> +    else
> +        LIBRTMP_DEPENDENCIES += openssl

What if opensl is not selected in the menuconfig?
You need to replicate these dependencies in the Config.in, too.

I was able to build librtmp without any of those dependencies, not even
with openssl, so I guess it also is optional?

What if all are selected? Which does librtmp will pick?
Don't you need to pass some flagsto the build to set which lib to use?

> +    endif
> +endif
> +
> +ifeq ($(BR2_PREFER_STATIC_LIB),y)
> +	LIBRTMP_PIC =
> +else
> +	LIBRTMP_PIC = -fPIC
> +endif
> +
> +define LIBRTMP_BUILD_CMDS
> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(TARGET_CFLAGS) $(LIBRTMP_PIC)" CROSS_COMPILE="$(TARGET_CROSS)" -C $(@D)/librtmp
> +endef
> +
> +define LIBRTMP_FIX_PREFIX
> +	sed -ie "s|prefix=/usr/local|prefix=/usr|" $(@D)/librtmp/Makefile
> +endef

Try to keep the definitions and hooks ordered: move the definition
before the BUILD_CMDS. It makes it easier to review and follow.

Also, should we netter do that with a patch, instead?
Or you could pass prefix=/usr as a make argument, it will override the
definition in the Makefile.

> +define LIBRTMP_INSTALL_STAGING_CMDS
> +	mkdir -p $(STAGING_DIR)/usr/local/lib
> +	$(MAKE) -C $(@D)/librtmp install DESTDIR=$(STAGING_DIR)
> +endef
> +
> +define LIBRTMP_INSTALL_TARGET_CMDS
> +	mkdir -p $(STAGING_DIR)/usr/local/lib
> +	$(MAKE) -C $(@D)/librtmp install DESTDIR=$(TARGET_DIR)
> +endef
> +
> +LIBRTMP_POST_EXTRACT_HOOKS += LIBRTMP_FIX_PREFIX

Put this just below the definition.

> +$(eval $(generic-package))
> -- 
> 1.8.5.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  parent reply	other threads:[~2014-01-19 15:25 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-16  0:15 [Buildroot] [PATCH v2 00/12] Introducing XBMC Maxime Hadjinlian
2014-01-16  0:15 ` [Buildroot] [PATCH v2 01/12] libass: new package Maxime Hadjinlian
2014-01-17  8:08   ` Peter Korsgaard
2014-01-18 11:41   ` Bernd Kuhls
2014-01-16  0:15 ` [Buildroot] [PATCH v2 02/12] libbluray: " Maxime Hadjinlian
2014-01-16  0:15 ` [Buildroot] [PATCH v2 03/12] libcdio: " Maxime Hadjinlian
2014-01-16  0:15 ` [Buildroot] [PATCH v2 04/12] libnfs: " Maxime Hadjinlian
2014-01-16  0:15 ` [Buildroot] [PATCH v2 05/12] libplist: " Maxime Hadjinlian
2014-01-16  0:15 ` [Buildroot] [PATCH v2 06/12] librtmp: " Maxime Hadjinlian
2014-01-18 18:55   ` Bernd Kuhls
2014-01-19 15:25   ` Yann E. MORIN [this message]
2014-01-16  0:15 ` [Buildroot] [PATCH v2 07/12] libshairplay: " Maxime Hadjinlian
2014-01-19 15:32   ` Yann E. MORIN
2014-01-16  0:15 ` [Buildroot] [PATCH v2 08/12] tinyxml: " Maxime Hadjinlian
2014-01-19 15:41   ` Yann E. MORIN
2014-01-19 15:55     ` Yann E. MORIN
2014-01-16  0:15 ` [Buildroot] [PATCH v2 09/12] sdl: add host version Maxime Hadjinlian
2014-01-19 15:47   ` Yann E. MORIN
2014-01-16  0:15 ` [Buildroot] [PATCH v2 10/12] sdl_image: " Maxime Hadjinlian
2014-01-19 15:53   ` Yann E. MORIN
2014-01-16  0:15 ` [Buildroot] [PATCH v2 11/12] libenca: new package Maxime Hadjinlian
2014-01-17  8:10   ` Peter Korsgaard
2014-01-18 11:49   ` Bernd Kuhls
2014-01-18 12:29     ` Maxime Hadjinlian
2014-01-18 12:55       ` Bernd Kuhls
2014-01-16  0:15 ` [Buildroot] [PATCH v2 12/12] xbmc: " Maxime Hadjinlian
2014-01-18  9:20 ` [Buildroot] [PATCH v2 00/12] Introducing XBMC Bernd Kuhls
2014-01-18 10:31   ` Bernd Kuhls

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140119152509.GB3387@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox