1 # Copyright (C) 2003-2011 the VideoLAN team
3 # This file is under the same license as the vlc package.
11 ifeq ($(shell curl
--version
>/dev
/null
2>&1 || echo FAIL
),)
12 download
= curl
-f
-L
-- "$(1)" > "$@.tmp" && touch
$@.tmp
&& mv
$@.tmp
$@
13 else ifeq ($(shell wget
--version
>/dev
/null
2>&1 || echo FAIL
),)
14 download
= rm -f
$@.tmp
&& \
15 wget
--passive
-c
-p
-O
$@.tmp
"$(1)" && \
18 else ifeq ($(which fetch
>/dev
/null
2>&1 || echo FAIL
),)
19 download
= rm -f
$@.tmp
&& \
20 fetch
-p
-o
$@.tmp
"$(1)" && \
24 download
= $(error Neither curl nor wget found
!)
27 download_pkg
= $(call download
,$(VIDEOLAN
)/$(2)/$(lastword
$(subst /, ,$(@
)))) || \
28 ( $(call download
,$(1)) && echo
"Please upload package $(lastword $(subst /, ,$(@))) to our FTP" ) \
29 && grep
$(@
) SHA512SUMS| shasum
-a
512 -c
31 UNPACK
= $(RM
) -R
$@ \
32 $(foreach f
,$(filter %.
tar.gz
%.tgz
,$^
), && tar xvzf
$(f
)) \
33 $(foreach f
,$(filter %.
tar.bz2
,$^
), && tar xvjf
$(f
)) \
34 $(foreach f
,$(filter %.
tar.xz
,$^
), && tar xvJf
$(f
)) \
35 $(foreach f
,$(filter %.zip
,$^
), && unzip
$(f
))
37 UNPACK_DIR
= $(patsubst %.
tar,%,$(basename $(notdir $<)))
38 APPLY
= (cd
$(UNPACK_DIR
) && patch
-p1
) <
39 MOVE
= mv
$(UNPACK_DIR
) $@
&& touch
$@
47 yasm-
$(YASM_VERSION
).
tar.gz
:
48 $(call download_pkg
,$(YASM_URL
),yasm
)
50 yasm
: yasm-
$(YASM_VERSION
).
tar.gz
55 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
58 CLEAN_FILE
+= .buildyasm
60 DISTCLEAN_PKG
+= yasm-
$(YASM_VERSION
).
tar.gz
62 nasm-
$(NASM_VERSION
).
tar.gz
:
63 $(call download_pkg
,$(NASM_URL
),nasm
)
65 nasm
: nasm-
$(NASM_VERSION
).
tar.gz
70 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
73 CLEAN_FILE
+= .buildnasm
75 DISTCLEAN_PKG
+= nasm-
$(NASM_VERSION
).
tar.gz
79 cmake-
$(CMAKE_VERSION
).
tar.gz
:
80 $(call download_pkg
,$(CMAKE_URL
),cmake
)
82 cmake
: cmake-
$(CMAKE_VERSION
).
tar.gz
84 $(APPLY
) cmake-winstore.patch
88 (cd
$<; .
/configure
--prefix=$(PREFIX
) $(CMAKEFLAGS
) && $(MAKE
) && $(MAKE
) install)
91 CLEAN_FILE
+= .buildcmake
93 DISTCLEAN_PKG
+= cmake-
$(CMAKE_VERSION
).
tar.gz
96 help2man-
$(HELP2MAN_VERSION
).
tar.xz
:
97 $(call download_pkg
,$(HELP2MAN_URL
),help2man
)
99 help2man
: help2man-
$(HELP2MAN_VERSION
).
tar.xz
103 .buildhelp2man
: help2man
104 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
107 CLEAN_FILE
+= .buildhelp2man
108 CLEAN_PKG
+= help2man
109 DISTCLEAN_PKG
+= help2man-
$(HELP2MAN_VERSION
).
tar.xz
113 libtool-
$(LIBTOOL_VERSION
).
tar.gz
:
114 $(call download_pkg
,$(LIBTOOL_URL
),libtool
)
116 libtool
: libtool-
$(LIBTOOL_VERSION
).
tar.gz
118 $(APPLY
) libtool-2.4
.2-bitcode.patch
119 $(APPLY
) libtool-2.4
.2-san.patch
120 $(APPLY
) libtool-2.4
.6-clang-libs.patch
123 .buildlibtool
: libtool .automake .help2man
124 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
125 ln
-sf libtool
$(PREFIX
)/bin
/glibtool
126 ln
-sf libtoolize
$(PREFIX
)/bin
/glibtoolize
130 DISTCLEAN_PKG
+= libtool-
$(LIBTOOL_VERSION
).
tar.gz
131 CLEAN_FILE
+= .buildlibtool
133 # GNU tar (with xz support)
135 tar-
$(TAR_VERSION
).
tar.bz2
:
136 $(call download_pkg
,$(TAR_URL
),tar)
138 tar: tar-
$(TAR_VERSION
).
tar.bz2
143 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
147 DISTCLEAN_PKG
+= tar-
$(TAR_VERSION
).
tar.bz2
148 CLEAN_FILE
+= .buildtar
152 xz-
$(XZ_VERSION
).
tar.bz2
:
153 $(call download_pkg
,$(XZ_URL
),xz
)
155 xz
: xz-
$(XZ_VERSION
).
tar.bz2
160 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install && rm $(PREFIX
)/lib
/pkgconfig
/liblzma.
pc)
164 DISTCLEAN_PKG
+= xz-
$(XZ_VERSION
).
tar.bz2
165 CLEAN_FILE
+= .buildxz
169 autoconf-
$(AUTOCONF_VERSION
).
tar.gz
:
170 $(call download_pkg
,$(AUTOCONF_URL
),autoconf
)
172 autoconf
: autoconf-
$(AUTOCONF_VERSION
).
tar.gz
176 .buildautoconf
: autoconf .pkg-config
177 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
180 CLEAN_FILE
+= .buildautoconf
181 CLEAN_PKG
+= autoconf
182 DISTCLEAN_PKG
+= autoconf-
$(AUTOCONF_VERSION
).
tar.gz
186 automake-
$(AUTOMAKE_VERSION
).
tar.gz
:
187 $(call download_pkg
,$(AUTOMAKE_URL
),automake
)
189 automake
: automake-
$(AUTOMAKE_VERSION
).
tar.gz
193 .buildautomake
: automake .autoconf
194 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
197 CLEAN_FILE
+= .buildautomake
198 CLEAN_PKG
+= automake
199 DISTCLEAN_PKG
+= automake-
$(AUTOMAKE_VERSION
).
tar.gz
203 m4-
$(M4_VERSION
).
tar.gz
:
204 $(call download_pkg
,$(M4_URL
),m4
)
206 m4
: m4-
$(M4_VERSION
).
tar.gz
208 $(APPLY
) bison-macOS-c41f233c.patch
209 $(APPLY
) bison-macOS-7df04f9.patch
213 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
216 CLEAN_FILE
+= .buildm4
218 DISTCLEAN_PKG
+= m4-
$(M4_VERSION
).
tar.gz
222 pkg-config-
$(PKGCFG_VERSION
).
tar.gz
:
223 $(call download_pkg
,$(PKGCFG_URL
),pkgconfiglite
)
225 pkgconfig
: pkg-config-
$(PKGCFG_VERSION
).
tar.gz
227 mv pkg-config-lite-
$(PKGCFG_VERSION
) pkg-config-
$(PKGCFG_VERSION
)
230 .buildpkg-config
: pkgconfig
231 (cd pkgconfig
; .
/configure
--prefix=$(PREFIX
) --disable-shared
--enable-static
&& $(MAKE
) && $(MAKE
) install)
234 CLEAN_FILE
+= .buildpkg-config
235 CLEAN_PKG
+= pkgconfig
236 DISTCLEAN_PKG
+= pkg-config-
$(PKGCFG_VERSION
).
tar.gz
239 gas-preprocessor-
$(GAS_VERSION
).
tar.gz
:
240 $(call download_pkg
,$(GAS_URL
),gas-preprocessor
)
242 gas
: gas-preprocessor-
$(GAS_VERSION
).
tar.gz
247 mkdir
-p
$(PREFIX
)/bin
248 cp gas
/gas-preprocessor.pl
$(PREFIX
)/bin
/
251 CLEAN_FILE
+= .buildgas
253 DISTCLEAN_PKG
+= gas-preprocessor-
$(GAS_VERSION
).
tar.gz
255 # Ragel State Machine Compiler
256 ragel-
$(RAGEL_VERSION
).
tar.gz
:
257 $(call download_pkg
,$(RAGEL_URL
),ragel
)
259 ragel
: ragel-
$(RAGEL_VERSION
).
tar.gz
261 $(APPLY
) ragel-6.8
-javacodegen.patch
266 (cd ragel
; .
/configure
--prefix=$(PREFIX
) --disable-shared
--enable-static
&& $(MAKE
) && $(MAKE
) install)
269 CLEAN_FILE
+= .buildragel
271 DISTCLEAN_PKG
+= ragel-
$(RAGEL_VERSION
).
tar.gz
275 sed-
$(SED_VERSION
).
tar.bz2
:
276 $(call download_pkg
,$(SED_URL
),sed
)
278 sed
: sed-
$(SED_VERSION
).
tar.bz2
283 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
287 DISTCLEAN_PKG
+= sed-
$(SED_VERSION
).
tar.bz2
288 CLEAN_FILE
+= .buildsed
292 apache-ant-
$(ANT_VERSION
).
tar.bz2
:
293 $(call download_pkg
,$(ANT_URL
),ant
)
295 ant
: apache-ant-
$(ANT_VERSION
).
tar.bz2
300 (mkdir
-p
$(PREFIX
)/bin
&& cp
$</bin
/* $(PREFIX
)/bin
/)
301 (mkdir
-p
$(PREFIX
)/lib
&& cp
$</lib
/* $(PREFIX
)/lib
/)
305 DISTCLEAN_PKG
+= apache-ant-
$(ANT_VERSION
).
tar.bz2
306 CLEAN_FILE
+= .buildant
311 protobuf-
$(PROTOBUF_VERSION
).
tar.gz
:
312 $(call download_pkg
,$(PROTOBUF_URL
),protobuf
)
314 protobuf
: protobuf-
$(PROTOBUF_VERSION
).
tar.gz
318 .buildprotoc
: protobuf
319 (cd
$< && .
/configure
--prefix="$(PREFIX)" --disable-shared
--enable-static
&& $(MAKE
) && $(MAKE
) install)
320 (find
$(PREFIX
) -name
'protobuf*.pc' -exec
rm -f
{} \
;)
323 CLEAN_PKG
+= protobuf
324 DISTCLEAN_PKG
+= protobuf-
$(PROTOBUF_VERSION
).
tar.gz
325 CLEAN_FILE
+= .buildprotoc
331 bison-
$(BISON_VERSION
).
tar.xz
:
332 $(call download_pkg
,$(BISON_URL
),bison
)
334 bison
: bison-
$(BISON_VERSION
).
tar.xz
336 $(APPLY
) bison-macOS-c41f233c.patch
337 $(APPLY
) bison-macOS-7df04f9.patch
341 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
345 DISTCLEAN_PKG
+= bison-
$(BISON_VERSION
).
tar.xz
346 CLEAN_FILE
+= .buildbison
352 flex-
$(FLEX_VERSION
).
tar.gz
:
353 $(call download_pkg
,$(FLEX_URL
),flex
)
355 flex
: flex-
$(FLEX_VERSION
).
tar.gz
360 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
364 DISTCLEAN_PKG
+= flex-
$(FLEX_VERSION
).
tar.gz
365 CLEAN_FILE
+= .buildflex
373 gettext-
$(GETTEXT_VERSION
).
tar.gz
:
374 $(call download_pkg
,$(GETTEXT_URL
),gettext
)
376 gettext
: gettext-
$(GETTEXT_VERSION
).
tar.gz
380 .buildgettext
: gettext
381 (cd
$<; .
/configure
--prefix=$(PREFIX
) && $(MAKE
) && $(MAKE
) install)
385 DISTCLEAN_PKG
+= gettext-
$(GETTEXT_VERSION
).
tar.gz
386 CLEAN_FILE
+= .buildgettext
393 fetch-all
: $(DISTCLEAN_PKG
)
396 rm -fr
$(CLEAN_FILE
) $(CLEAN_PKG
) build
/
399 rm -fr
$(DISTCLEAN_PKG
)
401 .PHONY
: all clean distclean