You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Martin Storsjö ebb15e3209 contrib: asdcplib: Apply a patch to fix compilation with latest Clang 2 years ago
..
SDL_image contrib/SDL_image: disable SDL_image for macOS 6 years ago
a52 contrib: using make -C should spread the threads from "make -j" properly 6 years ago
amf contrib: AMF: improve sparse checkout 2 years ago
aom contrib: aom: update to 3.5.0 4 years ago
aribb24 contribs: use $(GITHUB) consistently 3 years ago
aribb25 contrib: aribb25: don't build the sample app 3 years ago
asdcplib contrib: asdcplib: Apply a patch to fix compilation with latest Clang 2 years ago
ass contribs: update libass to 0.17.1 3 years ago
bluray Contrib: update libbluray to 1.3.2 4 years ago
bpg contrib: bpg: update to 0.9.7 10 years ago
breakpad contrib: breakpad: Fix build with newest Xcode 4 years ago
caca contribs: use $(GITHUB) consistently 3 years ago
cddb contrib: cddb: get rid of gettext dependency 6 years ago
chromaprint contrib: support CMAKE_GENERATOR other than makefile 6 years ago
crystalhd contrib: crystalhd: fix forward declaration of a struct 4 years ago
d3d9 contrib: d3d9: fix patch file path 6 years ago
d3d11 contrib: d3d11: include pthreads IDL 3 years ago
daala contrib: daala: update upstream URL 4 years ago
dav1d contrib: dav1d: update to 1.4.0 3 years ago
dca contrib: dca: Bump to 0.0.7 6 years ago
dvbpsi Contribs: update libdvbpsi to 1.3.3 5 years ago
dvdcss Contribs: update libdvcss to 1.4.3 5 years ago
dvdnav contribs: rectify minimum libdvdnav version 5 years ago
dvdread contrib: dvdread: do not use btn_it and its parent as packed structures 4 years ago
ebml contrib: ebml: update to 1.4.3 3 years ago
faad2 contrib: Bump faad2 to 2.10.0 4 years ago
ffi contrib: use http links instead of ftp 5 years ago
ffmpeg contrib: ffmpeg: upgrade to 4.4.4 3 years ago
flac contrib: update to flac 1.3.4 5 years ago
fluid contribs: Bump libfluidsynth to 2.1.8 5 years ago
fluidlite contribs: use $(GITHUB) consistently 3 years ago
fontconfig contrib: using make -C should spread the threads from "make -j" properly 6 years ago
freetype2 Contribs: update Freetype to 2.12.1 4 years ago
fribidi contribs: use $(GITHUB) consistently 3 years ago
gcrypt contrib: gcrypt: disable asm for macOS aarch64 for now 6 years ago
gettext contrib: gettext: Backport a gettext patch for fixing building on latest mingw-w64 6 years ago
glew contrib: glew: Ensure the .pc has a valid prefix configured 5 years ago
glib Contribs: move more contribs to VideoLAN mirror 10 years ago
gme contrib: gme: backport assert patch 2 years ago
gmp contrib: gmp: add patches to fix arm64 assembly 6 years ago
gnutls contrib: gnutls: Backport a patch to avoid -Wint-conversion errors 4 years ago
goom contrib: goom: Fix building for i386 with clang 6 years ago
gpg-error contrib: use http links instead of ftp 5 years ago
growl contribs: growl: Replace CFNetwork with CoreServices framework for intel builds 4 years ago
gsm Contribs: use VideoLAN ftp first and then fallback on upstream 10 years ago
harfbuzz contribs: use $(GITHUB) consistently 3 years ago
iconv contrib: iconv: Rework the ANDROID_API check to not use bc 8 years ago
jack contribs: use $(GITHUB) consistently 3 years ago
jpeg contribs: jpeg: Don't build executables 8 years ago
kate contrib: Update config.sub/guess for kate/caca/sdl/SDL_image 9 years ago
lame contrib: lame: Don't use -mtune=native/-march=native 5 years ago
libarchive Contribs: update libarchive to 3.6.1 4 years ago
libdsm contribs: use $(GITHUB) consistently 3 years ago
libmpeg2 contrib: using make -C should spread the threads from "make -j" properly 6 years ago
libplacebo contrib: limit the use of pthreads-w32 to winstore builds for now 5 years ago
libtasn1 contribs: libtasn1: Don't build executables 8 years ago
libxml2 Contribs: update libxml2 to 2.9.14 4 years ago
live555 contrib: live555: remove unused patch 4 years ago
lua contrib: lua: rewrite prefix in pkg-config file 5 years ago
mad contrib: arm: Disable the assembly when building mad, gmp and nettle for windows 8 years ago
matroska contrib: matroska: update libmatroska to 1.6.3 6 years ago
mfx contribs: use $(GITHUB) consistently 3 years ago
microdns contribs: use $(GITHUB) consistently 3 years ago
modplug contrib: modplug: Force building with a specific older C++ version 4 years ago
mpcdec contrib: support CMAKE_GENERATOR other than makefile 6 years ago
mpg123 Contribs: update mpg123 to 1.30.1 4 years ago
mysofa contribs: use $(GITHUB) consistently 3 years ago
ncurses contrib: ncurses: update to 6.3 5 years ago
nettle contrib: update nettle to 3.7.3 4 years ago
nfs contribs: use $(GITHUB) consistently 3 years ago
ogg contrib: update libogg to 1.3.3 9 years ago
openjpeg contribs: use $(GITHUB) consistently 3 years ago
opus contrib: opus: update to 1.3 8 years ago
orc Revert "contribs: orc: Don't build anything more than the library" 10 years ago
png contrib: png: update to 1.6.37 7 years ago
postproc contrib: postproc: add RISC-V 4 years ago
projectM contrib: projectM: Force building with a specific older C++ version 4 years ago
protobuf contribs: use $(GITHUB) consistently 3 years ago
pthreads contrib: mingw64: patch dxvahd.h before mingw-w64 11 3 years ago
qt contrib: qt: fix windows build with gcc 12 3 years ago
qtsvg contrib: using make -C should spread the threads from "make -j" properly 6 years ago
regex contrib: regex: Apply a patch to add missing function declarations 4 years ago
samplerate contrib: ensure GPL is enabled if needed 9 years ago
schroedinger contrib: schroedinger: fix static linking with pkg-config 10 years ago
sdl contrib: Update config.sub/guess for kate/caca/sdl/SDL_image 9 years ago
shout contrib: libshout: Apply a patch to avoid implicit declarations of gettimeofday 4 years ago
sidplay2 contrib: sidplay: Fix out of bound access 6 years ago
smb2 contribs: use $(GITHUB) consistently 3 years ago
soxr contrib: soxr: fix neon detection for aarch64 hosts 3 years ago
sparkle contribs: use $(GITHUB) consistently 3 years ago
spatialaudio contribs: use $(GITHUB) consistently 3 years ago
speex contrib: speex: update to 1.2.1 4 years ago
speexdsp contrib: speexdsp: update to 1.2.1 4 years ago
sqlite Contribs: move more contribs to VideoLAN mirror 10 years ago
srt Contribs: update SRT to 1.4.4 5 years ago
ssh2 Contribs: update ssh2 to 1.10.0 4 years ago
taglib contrib: Bump taglib to 1.12 5 years ago
theora contrib: theora: disable doc generation 7 years ago
tiff Contribs: update libtiff to 3.0.9 8 years ago
tiger contrib: tiger: fix pkg-config for static linking. 10 years ago
tremor contrib: update tremor download link 6 years ago
twolame Contribs: update Twolame to 0.4.0 5 years ago
upnp contrib/upnp: disable reuseaddr and fix option 3 years ago
vncclient contribs: use $(GITHUB) consistently 3 years ago
vorbis contrib: vorbis: use HAVE_CLANG 6 years ago
vpx Contribs: update libvpx to 1.13.1 3 years ago
x264 contrib: limit the use of pthreads-w32 to winstore builds for now 5 years ago
x265 contrib: x265: add patch to enable detect512 4 years ago
xau Contribs: Xau requires xproto 10 years ago
xcb contribs: xcb: fix static linking 10 years ago
xcb-proto Contribs: add xcb-proto 10 years ago
xorg-macros Contribs: add xorg-macros 10 years ago
xproto contrib: xproto: depend on xorg-macros 7 years ago
zlib contrib: zlib: update to 1.2.13 4 years ago
zvbi contrib: zvbi: Add a custom patch to avoid implicit declarations of functions on Windows 4 years ago
README contrib: documentation update 13 years ago
change_prefix.sh contrib: use POSIX options for find(1) 11 years ago
gen-meson-crossfile.py contrib: gen-meson-crossfile: Add a missing newline 6 years ago
get-arch.sh contrib: Map armv*-* triplets to ARCH=arm 9 years ago
help.txt contribs: add "make help" 10 years ago
main.mak contrib: do not require gtkdocize 3 years ago
pkg-static.sh pkg-static.sh: also merge Requires.private with Requires 12 years ago

README

Writing rules
==============

At the bare minimum, a package in contrib must provide two Makefile
targets in src/foo/rules.mak:
- .foo to build and install the package, and
- .sum-foo to fetch or create a source tarball and verify it,
where foo the package name.


Tarball
--------

.sum-foo typically depends on a separate target that fetches the source
code. In that case, .sum-foo needs only verify that the tarball
is correct, e.g.:


$(TARBALLS)/libfoo-$(FOO_VERSION).tar.bz2:
$(call download,$(FOO_URL))

# This will use the default rule: check SHA-512
.sum-foo: libfoo-$(FOO_VERSION).tar.bz2

NOTE: contrary to the previous VLC contribs, this system always uses
a source tarball, even if the source code is downloaded from a VCS.
This serves two purposes:
- offline builds (or behind a firewall),
- source code requirements compliance.


Compilation
------------

Similarly, .foo typically depends on the source code directory. In this
case, care must be taken that the directory name only exists if the
source code is fully ready. Otherwise Makefile dependencies will break
(this is not an issue for files, only directories).

libfoo: libfoo-$(FOO_VERSION).tar.bz2 .sum-foo
$(UNPACK) # to libfoo-$(FOO_VERSION)
### apply patches here ###
# last command: make the target directory
$(MOVE)

.foo: libfoo
cd $< && $(HOSTVARS) ./configure $(HOSTCONF)
cd $< && $(MAKE) install
touch $@

Conditional builds
-------------------

As far as possible, build rules should determine automatically whether
a package is useful (for VLC media player) or not. Useful packages
should be listed in the PKGS special variable. See some examples:

# FFmpeg is always useful
PKGS += ffmpeg

# DirectX headers are useful only on Windows
ifdef HAVE_WIN32
PKGS += directx
endif

# x264 is only useful when stream output is enabled
ifdef BUILD_ENCODERS
PKGS += x264
endif

If a package is a dependency of another package, but it is not a
direct dependency of VLC, then it should NOT be added to PKGS. The
build system will automatically build it via dependencies (see below).

Some packages may be provided by the target system. This is especially
common when building natively on Linux or BSD. When this situation is
detected, the package name should be added to the PKGS_FOUND special
variable. The build system will then skip building this package:

# Asks pkg-config if foo version 1.2.3 or later is present:
ifeq ($(call need_pkg,'foo >= 1.2.3'),)
PKGS_FOUND += foo
endif

Note: The need_pkg function always return 1 during cross-compilation.
This is a known bug.


Dependencies
-------------

If package bar depends on package foo, the special DEPS_bar variable
should be defined as follow:

DEPS_bar = foo $(DEPS_foo)

Note that dependency resolution is unfortunately _not_ recursive.
Therefore $(DEPS_foo) really should be specified explicitly as shown
above. (In practice, this will not make any difference insofar as there
are no pure second-level nested dependencies. For instance, libass
depends on FontConfig, which depends on FreeType, but libass depends
directly on FreeType anyway.)

Also note that DEPS_bar is set "recursively" with =, rather than
"immediately" with :=. This is so that $(DEPS_foo) is expanded
correctly, even if DEPS_foo it is defined after DEPS_bar.

Implementation note:

If you must know, the main.mak build hackery will automatically
emit a dependency from .bar onto .dep-foo:

.bar: .dep-foo

...whereby .dep-foo will depend on .foo:

.dep-foo: .foo
touch $@

...unless foo was detected in the target distribution:

.dep-foo:
touch $@

So you really only need to set DEPS_bar.