aboutsummaryrefslogtreecommitdiff
path: root/package/minidlna/minidlna.mk
blob: 85ad018bfc50342d698d70275793ac73ee011dde (plain)
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
################################################################################
#
# minidlna
#
################################################################################

MINIDLNA_VERSION = 1.0.26
MINIDLNA_SITE = http://downloads.sourceforge.net/project/minidlna/minidlna/$(MINIDLNA_VERSION)
MINIDLNA_LICENSE = GPLv2 BSD-3c
MINIDLNA_LICENSE_FILES = LICENCE LICENCE.miniupnpd

MINIDLNA_DEPENDENCIES = \
	ffmpeg flac libvorbis libogg libid3tag libexif libjpeg sqlite \
	host-xutil_makedepend

MINIDLNA_CFLAGS=$(TARGET_CFLAGS) \
	-I"$(STAGING_DIR)/usr/include/libavutil" \
	-I"$(STAGING_DIR)/usr/include/libavcodec" \
	-I"$(STAGING_DIR)/usr/include/libavformat"

MINIDLNA_COMMON_LIBS = \
	-lpthread -lexif -ljpeg -lsqlite3 -lavformat -lavutil -lavcodec \
	-lid3tag -lFLAC -logg -lvorbis

ifeq ($(BR2_PACKAGE_GETTEXT),y)
MINIDLNA_DEPENDENCIES += gettext
# we need to link with libintl
MINIDLNA_COMMON_LIBS += -lintl
endif

ifeq ($(BR2_PACKAGE_LIBICONV),y)
MINIDLNA_DEPENDENCIES += libiconv
MINIDLNA_COMMON_LIBS += -liconv
endif

MINIDLNA_MAKE_OPTS += LIBS='$(MINIDLNA_COMMON_LIBS)'

# genconfig.sh uses absolute paths to find libav, so help it out
define MINIDLNA_BUILD_CMDS
	PREFIX=$(STAGING_DIR)/usr \
		$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
		CFLAGS="$(MINIDLNA_CFLAGS)" -C $(@D) depend
	$(SED) '/HAVE_LIBAV/d' $(@D)/config.h
	echo "#define HAVE_LIBAVUTIL_AVUTIL_H 1" >>$(@D)/config.h
	echo "#define HAVE_LIBAVFORMAT_AVFORMAT_H 1" >>$(@D)/config.h
	echo "#define HAVE_LIBAVCODEC_AVCODEC_H 1" >>$(@D)/config.h
	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
		CFLAGS="$(MINIDLNA_CFLAGS)" $(MINIDLNA_MAKE_OPTS) -C $(@D) all
endef

define MINIDLNA_INSTALL_TARGET_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
		-C $(@D) DESTDIR=$(TARGET_DIR) install
endef

$(eval $(generic-package))