Skip to content

Commit e35a3e6

Browse files
committed
Import as much depends as we can from vlc
1 parent 9f98e75 commit e35a3e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3120
-0
lines changed

contrib/src/README

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
Writing rules
2+
==============
3+
4+
At the bare minimum, a package in contrib must provide two Makefile
5+
targets in src/foo/rules.mak:
6+
- .foo to build and install the package, and
7+
- .sum-foo to fetch or create a source tarball and verify it,
8+
where foo the package name.
9+
10+
11+
Tarball
12+
--------
13+
14+
.sum-foo typically depends on a separate target that fetches the source
15+
code. In that case, .sum-foo needs only verify that the tarball
16+
is correct, e.g.:
17+
18+
19+
$(TARBALLS)/libfoo-$(FOO_VERSION).tar.bz2:
20+
$(call download,$(FOO_URL))
21+
22+
# This will use the default rule: check SHA-512
23+
.sum-foo: libfoo-$(FOO_VERSION).tar.bz2
24+
25+
NOTE: contrary to the previous VLC contribs, this system always uses
26+
a source tarball, even if the source code is downloaded from a VCS.
27+
This serves two purposes:
28+
- offline builds (or behind a firewall),
29+
- source code requirements compliance.
30+
31+
32+
Compilation
33+
------------
34+
35+
Similarly, .foo typically depends on the source code directory. In this
36+
case, care must be taken that the directory name only exists if the
37+
source code is fully ready. Otherwise Makefile dependencies will break
38+
(this is not an issue for files, only directories).
39+
40+
libfoo: libfoo-$(FOO_VERSION).tar.bz2 .sum-foo
41+
$(UNPACK) # to libfoo-$(FOO_VERSION)
42+
### apply patches here ###
43+
# last command: make the target directory
44+
$(MOVE)
45+
46+
.foo: libfoo
47+
cd $< && $(HOSTVARS) ./configure $(HOSTCONF)
48+
cd $< && $(MAKE) install
49+
touch $@
50+
51+
Conditional builds
52+
-------------------
53+
54+
As far as possible, build rules should determine automatically whether
55+
a package is useful (for VLC media player) or not. Useful packages
56+
should be listed in the PKGS special variable. See some examples:
57+
58+
# FFmpeg is always useful
59+
PKGS += ffmpeg
60+
61+
# DirectX headers are useful only on Windows
62+
ifdef HAVE_WIN32
63+
PKGS += directx
64+
endif
65+
66+
# x264 is only useful when stream output is enabled
67+
ifdef BUILD_ENCODERS
68+
PKGS += x264
69+
endif
70+
71+
If a package is a dependency of another package, but it is not a
72+
direct dependency of VLC, then it should NOT be added to PKGS. The
73+
build system will automatically build it via dependencies (see below).
74+
75+
Some packages may be provided by the target system. This is especially
76+
common when building natively on Linux or BSD. When this situation is
77+
detected, the package name should be added to the PKGS_FOUND special
78+
variable. The build system will then skip building this package:
79+
80+
# Asks pkg-config if foo version 1.2.3 or later is present:
81+
ifeq ($(call need_pkg,'foo >= 1.2.3'),)
82+
PKGS_FOUND += foo
83+
endif
84+
85+
Note: The need_pkg function always return 1 during cross-compilation.
86+
This is a known bug.
87+
88+
89+
Dependencies
90+
-------------
91+
92+
If package bar depends on package foo, the special DEPS_bar variable
93+
should be defined as follow:
94+
95+
DEPS_bar = foo $(DEPS_foo)
96+
97+
Note that dependency resolution is unfortunately _not_ recursive.
98+
Therefore $(DEPS_foo) really should be specified explicitly as shown
99+
above. (In practice, this will not make any difference insofar as there
100+
are no pure second-level nested dependencies. For instance, libass
101+
depends on FontConfig, which depends on FreeType, but libass depends
102+
directly on FreeType anyway.)
103+
104+
Also note that DEPS_bar is set "recursively" with =, rather than
105+
"immediately" with :=. This is so that $(DEPS_foo) is expanded
106+
correctly, even if DEPS_foo it is defined after DEPS_bar.
107+
108+
Implementation note:
109+
110+
If you must know, the main.mak build hackery will automatically
111+
emit a dependency from .bar onto .dep-foo:
112+
113+
.bar: .dep-foo
114+
115+
...whereby .dep-foo will depend on .foo:
116+
117+
.dep-foo: .foo
118+
touch $@
119+
120+
...unless foo was detected in the target distribution:
121+
122+
.dep-foo:
123+
touch $@
124+
125+
So you really only need to set DEPS_bar.

contrib/src/change_prefix.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
# ***************************************************************************
3+
# change_prefix.sh : allow to transfer a contrib dir
4+
# ***************************************************************************
5+
# Copyright © 2012 VideoLAN and its authors
6+
#
7+
# Authors: Rafaël Carré
8+
#
9+
# This program is free software; you can redistribute it and/or modify
10+
# it under the terms of the GNU General Public License as published by
11+
# the Free Software Foundation; either version 2 of the License, or
12+
# (at your option) any later version.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program; if not, write to the Free Software
21+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22+
# ***************************************************************************
23+
24+
set -e
25+
26+
LANG=C
27+
export LANG
28+
29+
if test "$1" = "-h" -o "$1" = "--help" -o $# -gt 2; then
30+
echo "Usage: $0 [old prefix] [new prefix]
31+
32+
Without arguments, this script assumes old prefix = @@CONTRIB_PREFIX@@,
33+
and new prefix = current directory.
34+
"
35+
fi
36+
37+
if [ $# != 2 ]
38+
then
39+
old_prefix=@@CONTRIB_PREFIX@@
40+
new_prefix=`pwd`
41+
else
42+
old_prefix=$1
43+
new_prefix=$2
44+
fi
45+
46+
# process [dir] [filemask] [text only]
47+
process() {
48+
for file in `find $1 -maxdepth 1 -type f -name "$2"`
49+
do
50+
if [ -n "$3" ]
51+
then
52+
file $file | sed "s/^.*: //" | grep -q 'text\|shell' || continue
53+
fi
54+
echo "Fixing up $file"
55+
sed -i.orig -e "s,$old_prefix,$new_prefix,g" $file
56+
rm -f $file.orig
57+
done
58+
}
59+
60+
process bin/ "*" check
61+
process lib/ "*.la"
62+
process lib/pkgconfig/ "*.pc"

contrib/src/freetype2/SHA512SUMS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9ab7b77c5c09b1eb5baee7eb16da8a5f6fa7168cfa886bfed392b2fe80a985bcedecfbb8ed562c822ec9e48b061fb5fcdd9eea69eb44f970c2d1c55581f31d25 freetype-2.5.3.tar.gz

contrib/src/freetype2/rules.mak

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# freetype2
2+
3+
FREETYPE2_VERSION := 2.5.3
4+
FREETYPE2_URL := $(SF)/freetype/freetype2/$(FREETYPE2_VERSION)/freetype-$(FREETYPE2_VERSION).tar.gz
5+
6+
PKGS += freetype2
7+
ifeq ($(call need_pkg,"freetype2"),)
8+
PKGS_FOUND += freetype2
9+
endif
10+
11+
$(TARBALLS)/freetype-$(FREETYPE2_VERSION).tar.gz:
12+
$(call download,$(FREETYPE2_URL))
13+
14+
.sum-freetype2: freetype-$(FREETYPE2_VERSION).tar.gz
15+
16+
freetype: freetype-$(FREETYPE2_VERSION).tar.gz .sum-freetype2
17+
$(UNPACK)
18+
$(call pkg_static, "builds/unix/freetype2.in")
19+
$(MOVE)
20+
21+
DEPS_freetype2 = zlib $(DEPS_zlib)
22+
23+
.freetype2: freetype
24+
sed -i.orig s/-ansi// $</builds/unix/configure
25+
cd $< && GNUMAKE=$(MAKE) $(HOSTVARS) ./configure --with-harfbuzz=no --with-zlib=yes --without-png $(HOSTCONF)
26+
cd $< && $(MAKE) && $(MAKE) install
27+
touch $@

contrib/src/get-arch.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /bin/sh
2+
3+
HOST="$1"
4+
if test -z "$HOST"; then
5+
echo "Usage: $0 <target machine>" >&2
6+
exit 1
7+
fi
8+
9+
case "$HOST" in
10+
amd64-*)
11+
ARCH="x86_64"
12+
;;
13+
i[3456]86-*)
14+
ARCH="i386"
15+
;;
16+
powerpc-*|ppc-*)
17+
ARCH="ppc"
18+
;;
19+
powerpc64-*|ppc64-*)
20+
ARCH="ppc64"
21+
;;
22+
*-*)
23+
ARCH="${HOST%%-*}"
24+
;;
25+
*)
26+
echo "$HOST: invalid machine specification" >&2
27+
exit 1
28+
esac
29+
echo $ARCH

contrib/src/glew/SHA512SUMS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
03d7a816fde0c445c964280ac9e679a0d2dfca839e87345360adec4fdb2292b4ddfc85538954b052c538ca355e559d8ee3a5ea7ea2a99130687054a92e0df857 glew-1.7.0.tar.gz

contrib/src/glew/rules.mak

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# GLEW
2+
GLEW_VERSION := 1.7.0
3+
GLEW_URL := $(SF)/glew/glew/$(GLEW_VERSION)/glew-$(GLEW_VERSION).tgz
4+
5+
$(TARBALLS)/glew-$(GLEW_VERSION).tar.gz:
6+
$(call download,$(GLEW_URL))
7+
8+
.sum-glew: glew-$(GLEW_VERSION).tar.gz
9+
10+
glew: glew-$(GLEW_VERSION).tar.gz .sum-glew
11+
$(UNPACK)
12+
ifdef HAVE_WIN32
13+
$(APPLY) $(SRC)/glew/win32.patch
14+
endif
15+
$(MOVE)
16+
17+
.glew: glew
18+
cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) -DGLEW_STATIC" $(MAKE)
19+
cd $< && $(HOSTVARS) GLEW_DEST=$(PREFIX) $(MAKE) install
20+
ifdef HAVE_WIN32
21+
-rm $(PREFIX)/lib/*glew32.dll*
22+
endif
23+
touch $@

contrib/src/glew/win32.patch

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
--- glew/Makefile 2011-08-25 16:17:55.000000000 +0200
2+
+++ glew.new/Makefile 2012-02-25 16:47:22.070430867 +0100
3+
@@ -31,7 +31,7 @@
4+
include config/version
5+
6+
SHELL = /bin/sh
7+
-SYSTEM ?= $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;')
8+
+SYSTEM ?= mingw
9+
SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1)
10+
11+
ifeq ($(SYSTEM.SUPPORTED), 1)
12+
@@ -54,9 +54,7 @@
13+
DIST_SRC_ZIP = glew-$(GLEW_VERSION).zip
14+
DIST_SRC_TGZ = glew-$(GLEW_VERSION).tgz
15+
16+
-AR = ar
17+
INSTALL = install
18+
-STRIP = strip
19+
RM = rm -f
20+
LN = ln -sf
21+
ifeq ($(MAKECMDGOALS), debug)
22+
@@ -84,7 +82,7 @@
23+
VISUALINFO.BIN.OBJS = $(VISUALINFO.BIN.SRCS:.c=.o)
24+
BIN.LIBS = -Llib $(LDFLAGS.DYNAMIC) -l$(NAME) $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
25+
26+
-all debug: glew.lib glew.lib.mx glew.bin
27+
+all debug: glew.lib glew.lib.mx
28+
29+
%.o: %.c
30+
$(CC) -c $(CFLAGS) -o $@ $<
31+
@@ -180,42 +178,20 @@
32+
install.lib: glew.lib
33+
$(INSTALL) -d -m 0755 $(LIBDIR)
34+
# runtime
35+
-ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
36+
- $(INSTALL) -d -m 0755 $(BINDIR)
37+
- $(STRIP) -x lib/$(LIB.SHARED)
38+
- $(INSTALL) -m 0755 lib/$(LIB.SHARED) $(BINDIR)/
39+
-else
40+
$(STRIP) -x lib/$(LIB.SHARED)
41+
$(INSTALL) -m 0644 lib/$(LIB.SHARED) $(LIBDIR)/
42+
$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.SONAME)
43+
-endif
44+
# development files
45+
-ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
46+
- $(INSTALL) -m 0644 lib/$(LIB.DEVLNK) $(LIBDIR)/
47+
-else
48+
- $(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.DEVLNK)
49+
-endif
50+
$(STRIP) -x lib/$(LIB.STATIC)
51+
$(INSTALL) -m 0644 lib/$(LIB.STATIC) $(LIBDIR)/
52+
53+
install.lib.mx: glew.lib.mx
54+
$(INSTALL) -d -m 0755 $(LIBDIR)
55+
# runtime
56+
-ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
57+
- $(INSTALL) -d -m 0755 $(BINDIR)
58+
- $(STRIP) -x lib/$(LIB.SHARED.MX)
59+
- $(INSTALL) -m 0755 lib/$(LIB.SHARED.MX) $(BINDIR)/
60+
-else
61+
$(STRIP) -x lib/$(LIB.SHARED.MX)
62+
$(INSTALL) -m 0644 lib/$(LIB.SHARED.MX) $(LIBDIR)/
63+
$(LN) $(LIB.SHARED.MX) $(LIBDIR)/$(LIB.SONAME.MX)
64+
-endif
65+
# development files
66+
-ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
67+
- $(INSTALL) -m 0644 lib/$(LIB.DEVLNK.MX) $(LIBDIR)/
68+
-else
69+
- $(LN) $(LIB.SHARED.MX) $(LIBDIR)/$(LIB.DEVLNK.MX)
70+
-endif
71+
$(STRIP) -x lib/$(LIB.STATIC.MX)
72+
$(INSTALL) -m 0644 lib/$(LIB.STATIC.MX) $(LIBDIR)/
73+
74+
diff -ruN glew/config/Makefile.mingw glew.new/config/Makefile.mingw
75+
--- glew/config/Makefile.mingw 2011-08-25 16:17:55.000000000 +0200
76+
+++ glew.new/config/Makefile.mingw 2012-02-25 16:42:36.603751173 +0100
77+
@@ -1,8 +1,6 @@
78+
NAME = glew32
79+
-CC = gcc
80+
# use gcc for linking, with ld it does not work
81+
-LD = gcc
82+
-CFLAGS.SO = -DGLEW_BUILD
83+
+CFLAGS.SO = -DGLEW_BUILD -DSTATIC
84+
LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
85+
LDFLAGS.EXTRA = -L/mingw/lib
86+
WARN = -Wall -W
87+
@@ -12,9 +10,9 @@
88+
LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib
89+
LIB.SHARED = $(NAME).dll
90+
LIB.STATIC = lib$(NAME).a # the static lib will be broken (see CFLAGS.SO)
91+
-LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK)
92+
+#LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK)
93+
LIB.SONAME.MX = lib$(NAME)mx.dll
94+
LIB.DEVLNK.MX = lib$(NAME)mx.dll.a # for mingw this is the dll import lib
95+
LIB.SHARED.MX = $(NAME)mx.dll
96+
LIB.STATIC.MX = lib$(NAME)mx.a # the static lib will be broken (see CFLAGS.SO)
97+
-LDFLAGS.SO.MX = -shared -Wl,-soname,$(LIB.SONAME.MX) -Wl,--out-implib,lib/$(LIB.DEVLNK.MX)
98+
+#LDFLAGS.SO.MX = -shared -Wl,-soname,$(LIB.SONAME.MX) -Wl,--out-implib,lib/$(LIB.DEVLNK.MX)
99+
--- glew/include/GL/glew.h 2011-08-25 16:17:55.000000000 +0200
100+
+++ glew.new/include/GL/glew.h 2012-02-25 16:39:44.970410007 +0100
101+
@@ -151,7 +151,7 @@
102+
#endif
103+
#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__)
104+
# ifdef _WIN64
105+
-typedef __int64 ptrdiff_t;
106+
+# include <stdint.h>
107+
# else
108+
typedef _W64 int ptrdiff_t;
109+
# endif

contrib/src/iconv/SHA512SUMS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b96774fefc4fa1d07948fcc667027701373c34ebf9c4101000428e048addd85a5bb5e05e59f80eb783a3054a3a8a3c0da909450053275bbbf3ffde511eb3f387 libiconv-1.14.tar.gz

0 commit comments

Comments
 (0)