~ubuntu-branches/ubuntu/trusty/kid3/trusty

« back to all changes in this revision

Viewing changes to buildlibs.sh

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2009-11-08 15:55:34 UTC
  • mfrom: (1.1.10 upstream) (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20091108155534-4ses1tpuj8nxjxj6
Tags: 1.3-1ubuntu1
* Merged from Debian, remaining Ubuntu changes:
  + debian/control:
    - Build-depend on libmp4v2-dev.
  + debian/rules:
    - Build WITH_MP4V2.
* Removed Ubuntu patch fix_gnome_file_dialog.diff, fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
test -d source || mkdir source
29
29
cd source
30
30
 
31
 
test -f faad2_2.0.0+cvs20040908+mp4v2+bmp-0ubuntu3.6.06.1.diff.gz ||
32
 
wget http://archive.ubuntu.com/ubuntu/pool/multiverse/f/faad2/faad2_2.0.0+cvs20040908+mp4v2+bmp-0ubuntu3.6.06.1.diff.gz
33
 
test -f faad2_2.0.0+cvs20040908+mp4v2+bmp.orig.tar.gz ||
34
 
wget http://archive.ubuntu.com/ubuntu/pool/multiverse/f/faad2/faad2_2.0.0+cvs20040908+mp4v2+bmp.orig.tar.gz
 
31
test -f mp4v2-1.9.1.tar.bz2 ||
 
32
wget http://mp4v2.googlecode.com/files/mp4v2-1.9.1.tar.bz2
35
33
 
36
34
test -f flac_1.2.1-1.2.diff.gz ||
37
35
wget http://ftp.de.debian.org/debian/pool/main/f/flac/flac_1.2.1-1.2.diff.gz
43
41
test -f id3lib3.8.3_3.8.3.orig.tar.gz ||
44
42
wget http://ftp.de.debian.org/debian/pool/main/i/id3lib3.8.3/id3lib3.8.3_3.8.3.orig.tar.gz
45
43
 
46
 
test -f libogg_1.1.3-2.diff.gz ||
47
 
wget http://ftp.de.debian.org/debian/pool/main/libo/libogg/libogg_1.1.3-2.diff.gz
48
 
test -f libogg_1.1.3.orig.tar.gz ||
49
 
wget http://ftp.de.debian.org/debian/pool/main/libo/libogg/libogg_1.1.3.orig.tar.gz
50
 
 
51
 
test -f libvorbis_1.2.0.dfsg-3.1.diff.gz ||
52
 
wget http://ftp.de.debian.org/debian/pool/main/libv/libvorbis/libvorbis_1.2.0.dfsg-3.1.diff.gz
53
 
test -f libvorbis_1.2.0.dfsg.orig.tar.gz ||
54
 
wget http://ftp.de.debian.org/debian/pool/main/libv/libvorbis/libvorbis_1.2.0.dfsg.orig.tar.gz
55
 
 
56
 
test -f taglib_1.5-6.diff.gz ||
57
 
wget http://ftp.de.debian.org/debian/pool/main/t/taglib/taglib_1.5-6.diff.gz
58
 
test -f taglib_1.5.orig.tar.gz ||
59
 
wget http://ftp.de.debian.org/debian/pool/main/t/taglib/taglib_1.5.orig.tar.gz
 
44
test -f libogg_1.1.4~dfsg-1.diff.gz ||
 
45
wget http://ftp.de.debian.org/debian/pool/main/libo/libogg/libogg_1.1.4~dfsg-1.diff.gz
 
46
test -f libogg_1.1.4~dfsg.orig.tar.gz ||
 
47
wget http://ftp.de.debian.org/debian/pool/main/libo/libogg/libogg_1.1.4~dfsg.orig.tar.gz
 
48
 
 
49
test -f libvorbis-1.2.3.tar.gz ||
 
50
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.3.tar.gz
 
51
 
 
52
test -f taglib_1.6-3.diff.gz ||
 
53
wget http://ftp.de.debian.org/debian/pool/main/t/taglib/taglib_1.6-3.diff.gz
 
54
test -f taglib_1.6.orig.tar.gz ||
 
55
wget http://ftp.de.debian.org/debian/pool/main/t/taglib/taglib_1.6.orig.tar.gz
60
56
 
61
57
test -f zlib_1.2.3-13.diff.gz ||
62
58
wget http://ftp.de.debian.org/debian/pool/main/z/zlib/zlib_1.2.3-13.diff.gz
66
62
 
67
63
# Create patch files
68
64
 
69
 
test -f faad2_2.0.0_mac.patch ||
70
 
cat >faad2_2.0.0_mac.patch <<"EOF"
71
 
diff -ru faad2.orig/common/mp4v2/mp4util.h faad2/common/mp4v2/mp4util.h
72
 
--- faad2.orig/common/mp4v2/mp4util.h   2003-06-29 23:41:00.000000000 +0200
73
 
+++ faad2/common/mp4v2/mp4util.h        2009-04-18 07:37:27.000000000 +0200
74
 
@@ -22,6 +22,9 @@
75
 
 #ifndef __MP4_UTIL_INCLUDED__
76
 
 #define __MP4_UTIL_INCLUDED__
77
 
 #include <assert.h>
78
 
+#ifdef __APPLE__
79
 
+#include <sys/time.h>
80
 
+#endif
81
 
 
82
 
 #ifndef ASSERT
83
 
 #ifdef NDEBUG
84
 
diff -ru faad2.orig/common/mp4v2/systems.h faad2/common/mp4v2/systems.h
85
 
--- faad2.orig/common/mp4v2/systems.h   2009-04-22 22:38:40.000000000 +0200
86
 
+++ faad2/common/mp4v2/systems.h        2009-04-18 07:59:13.000000000 +0200
87
 
@@ -37,6 +37,14 @@
88
 
 #include <win32_ver.h>
89
 
 #endif
90
 
 #define NEED_SDL_VIDEO_IN_MAIN_THREAD
91
 
+#elif defined __APPLE__
92
 
+#ifndef PACKAGE
93
 
+#define PACKAGE "mpeg4ip"
94
 
+#endif
95
 
+#ifndef VERSION
96
 
+#define VERSION "0.9.8.6"
97
 
+#endif
98
 
+#define HAVE_STDINT_H
99
 
 #else
100
 
 #undef PACKAGE
101
 
 #undef VERSION
102
 
EOF
103
 
 
104
 
test -f faad2_2.0.0_mingw.patch ||
105
 
cat >faad2_2.0.0_mingw.patch <<"EOF"
106
 
diff -ru faad2.orig/common/mp4ff/mp4ff_int_types.h faad2/common/mp4ff/mp4ff_int_types.h
107
 
--- faad2.orig/common/mp4ff/mp4ff_int_types.h   Fri Nov  2 06:37:08 2007
108
 
+++ faad2/common/mp4ff/mp4ff_int_types.h        Sun Nov  4 12:10:52 2007
109
 
@@ -1,7 +1,7 @@
110
 
 #ifndef _MP4FF_INT_TYPES_H_
111
 
 #define _MP4FF_INT_TYPES_H_
112
 
 
113
 
-#ifdef _WIN32
114
 
+#if defined(_WIN32) && !defined(__MINGW32__)
115
 
 
116
 
 typedef char int8_t;
117
 
 typedef unsigned char uint8_t;
118
 
@@ -20,4 +20,4 @@
119
 
 #endif
120
 
 
121
 
 
122
 
-#endif
123
 
\ No newline at end of file
124
 
+#endif
125
 
diff -ru faad2.orig/common/mp4v2/systems.h faad2/common/mp4v2/systems.h
126
 
--- faad2.orig/common/mp4v2/systems.h   Fri Nov  2 06:40:12 2007
127
 
+++ faad2/common/mp4v2/systems.h        Sun Nov  4 12:11:32 2007
128
 
@@ -26,7 +26,16 @@
129
 
 #ifdef WIN32
130
 
 #define HAVE_IN_PORT_T
131
 
 #define HAVE_SOCKLEN_T
132
 
+#ifdef __MINGW32__
133
 
+#ifndef PACKAGE
134
 
+#define PACKAGE "mpeg4ip"
135
 
+#endif
136
 
+#ifndef VERSION
137
 
+#define VERSION "0.9.8.6"
138
 
+#endif
139
 
+#else
140
 
 #include <win32_ver.h>
141
 
+#endif
142
 
 #define NEED_SDL_VIDEO_IN_MAIN_THREAD
143
 
 #else
144
 
 #undef PACKAGE
145
 
@@ -49,6 +58,14 @@
146
 
 #include <time.h>
147
 
 #include <limits.h>
148
 
 
149
 
+#ifdef __MINGW32__
150
 
+#include <stdint.h>
151
 
+#include <ctype.h>
152
 
+typedef unsigned __int64 u_int64_t;
153
 
+typedef unsigned __int32 u_int32_t;
154
 
+typedef unsigned __int16 u_int16_t;
155
 
+typedef unsigned __int8 u_int8_t;
156
 
+#else
157
 
 typedef unsigned __int64 uint64_t;
158
 
 typedef unsigned __int32 uint32_t;
159
 
 typedef unsigned __int16 uint16_t;
160
 
@@ -64,6 +81,7 @@
161
 
 typedef unsigned short in_port_t;
162
 
 typedef int socklen_t;
163
 
 typedef int ssize_t;
164
 
+#endif
165
 
 #define snprintf _snprintf
166
 
 #define strncasecmp _strnicmp
167
 
 #define strcasecmp _stricmp
168
 
@@ -95,7 +113,9 @@
169
 
 }
170
 
 #endif
171
 
 
172
 
+#ifndef __MINGW32__
173
 
 #define PATH_MAX MAX_PATH
174
 
+#endif
175
 
 #define MAX_UINT64 -1
176
 
 #define LLD "%I64d"
177
 
 #define LLU "%I64u"
178
 
@@ -114,7 +134,7 @@
179
 
 #define LOG_INFO 6
180
 
 #define LOG_DEBUG 7
181
 
 
182
 
-#if     !__STDC__ && _INTEGRAL_MAX_BITS >= 64
183
 
+#if     (!__STDC__ || defined __MINGW32__) && _INTEGRAL_MAX_BITS >= 64
184
 
 #define VAR_TO_FPOS(fpos, var) (fpos) = (var)
185
 
 #define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)(_FPOSOFF(fpos))
186
 
 #else
187
 
diff -ru faad2.orig/libfaad/common.h faad2/libfaad/common.h
188
 
--- faad2.orig/libfaad/common.h Fri Nov  2 06:37:08 2007
189
 
+++ faad2/libfaad/common.h      Sun Nov  4 12:10:12 2007
190
 
@@ -303,6 +303,7 @@
191
 
     }
192
 
   #elif (defined(__i386__) && defined(__GNUC__))
193
 
     #define HAS_LRINTF
194
 
+#if !defined __MINGW32__ && !defined __APPLE__
195
 
     // from http://www.stereopsis.com/FPU.html
196
 
     static INLINE int lrintf(float f)
197
 
     {
198
 
@@ -314,6 +315,7 @@
199
 
             : "m" (f));
200
 
         return i;
201
 
     }
202
 
+#endif
203
 
   #endif
204
 
 
205
 
 
206
 
EOF
207
 
 
208
 
test -f faad2-mkinstalldirs.diff ||
209
 
cat >faad2-mkinstalldirs.diff <<"EOF"
210
 
diff -ruN faad2.orig/mkinstalldirs faad2/mkinstalldirs
211
 
--- faad2.orig/mkinstalldirs    Thu Jan  1 00:00:00 1970
212
 
+++ faad2/mkinstalldirs Mon Mar  3 23:26:04 2008
213
 
@@ -0,0 +1,40 @@
214
 
+#! /bin/sh
215
 
+# mkinstalldirs --- make directory hierarchy
216
 
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
217
 
+# Created: 1993-05-16
218
 
+# Public domain
219
 
+
220
 
+# $Id: mkinstalldirs,v 1.1 1999/11/01 04:12:39 scott Exp $
221
 
+
222
 
+errstatus=0
223
 
+
224
 
+for file
225
 
+do
226
 
+   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
227
 
+   shift
228
 
+
229
 
+   pathcomp=
230
 
+   for d
231
 
+   do
232
 
+     pathcomp="$pathcomp$d"
233
 
+     case "$pathcomp" in
234
 
+       -* ) pathcomp=./$pathcomp ;;
235
 
+     esac
236
 
+
237
 
+     if test ! -d "$pathcomp"; then
238
 
+        echo "mkdir $pathcomp"
239
 
+
240
 
+        mkdir "$pathcomp" || lasterr=$?
241
 
+
242
 
+        if test ! -d "$pathcomp"; then
243
 
+         errstatus=$lasterr
244
 
+        fi
245
 
+     fi
246
 
+
247
 
+     pathcomp="$pathcomp/"
248
 
+   done
249
 
+done
250
 
+
251
 
+exit $errstatus
252
 
+
253
 
+# mkinstalldirs ends here
254
 
EOF
255
 
 
256
65
test -f fink_flac.patch ||
257
66
cat >fink_flac.patch <<"EOF"
258
67
diff -ruN flac-1.2.1/patches/fixrpath.sh flac-1.2.1.new/patches/fixrpath.sh
386
195
 #  define LINKOPTION_USE_DYNAMIC    3 //if your project links id3lib dynamic
387
196
EOF
388
197
 
389
 
test -f taglib-1.5-no_declspec.diff ||
390
 
cat >taglib-1.5-no_declspec.diff <<"EOF"
391
 
diff -ru taglib-1.5.orig/taglib/taglib_export.h taglib-1.5/taglib/taglib_export.h
392
 
--- taglib-1.5.orig/taglib/taglib_export.h      Mon Feb  4 15:14:46 2008
393
 
+++ taglib-1.5/taglib/taglib_export.h   Mon Mar  3 20:07:58 2008
394
 
@@ -26,7 +26,7 @@
395
 
 #ifndef TAGLIB_EXPORT_H
396
 
 #define TAGLIB_EXPORT_H
397
 
 
398
 
-#if defined(_WIN32) || defined(_WIN64)
399
 
+#if (defined(_WIN32) || defined(_WIN64)) && !defined __MINGW32__
400
 
 #ifdef MAKE_TAGLIB_LIB
401
 
 #define TAGLIB_EXPORT __declspec(dllexport)
402
 
 #else
403
 
EOF
404
 
 
405
198
cd ..
406
199
 
407
200
 
421
214
 
422
215
# libogg
423
216
 
424
 
if ! test -d libogg-1.1.3; then
425
 
tar xzf source/libogg_1.1.3.orig.tar.gz
426
 
cd libogg-1.1.3/
427
 
gunzip -c ../source/libogg_1.1.3-2.diff.gz | patch -p1
 
217
if ! test -d libogg-1.1.4~dfsg.orig; then
 
218
tar xzf source/libogg_1.1.4~dfsg.orig.tar.gz
 
219
cd libogg-1.1.4~dfsg.orig/
 
220
gunzip -c ../source/libogg_1.1.4~dfsg-1.diff.gz | patch -p1
428
221
for f in debian/patches/*.diff; do patch -p0 <$f; done
429
222
cd ..
430
223
fi
431
224
 
432
225
# libvorbis
433
226
 
434
 
if ! test -d libvorbis-1.2.0; then
435
 
tar xzf source/libvorbis_1.2.0.dfsg.orig.tar.gz
436
 
cd libvorbis-1.2.0/
437
 
gunzip -c ../source/libvorbis_1.2.0.dfsg-3.1.diff.gz | patch -p1
438
 
for f in debian/patches/*.diff; do patch -p1 <$f; done
439
 
cd ..
 
227
if ! test -d libvorbis-1.2.3; then
 
228
tar xzf source/libvorbis-1.2.3.tar.gz
440
229
fi
441
230
 
442
231
# libflac
467
256
 
468
257
# taglib
469
258
 
470
 
if ! test -d taglib-1.5; then
471
 
tar xzf source/taglib_1.5.orig.tar.gz
472
 
cd taglib-1.5/
473
 
gunzip -c ../source/taglib_1.5-6.diff.gz | patch -p1
 
259
if ! test -d taglib-1.6; then
 
260
tar xzf source/taglib_1.6.orig.tar.gz
 
261
cd taglib-1.6/
 
262
gunzip -c ../source/taglib_1.6-3.diff.gz | patch -p1
474
263
for f in debian/patches/general/*.diff; do patch -p1 <$f; done
475
 
patch -p1 <../source/taglib-1.5-no_declspec.diff
476
264
cd ..
477
265
fi
478
266
 
479
267
# mp4v2
480
268
 
481
 
if ! test -d faad2; then
482
 
tar xzf source/faad2_2.0.0+cvs20040908+mp4v2+bmp.orig.tar.gz
483
 
cd faad2/
484
 
gunzip -c ../source/faad2_2.0.0+cvs20040908+mp4v2+bmp-0ubuntu3.6.06.1.diff.gz | patch -p1
485
 
patch -p1 <debian/patches/01_systems.h.diff 
486
 
patch -p1 <debian/patches/04_mp4ff.h_fix.diff 
487
 
patch -p1 <debian/patches/06_pure_virtual_fix.diff 
488
 
patch -p1 <debian/patches/07_remove_static.diff 
489
 
patch -p0 <debian/patches/09_amd64.diff
490
 
patch -p1 <../source/faad2_2.0.0_mingw.patch
491
 
patch -p1 <../source/faad2-mkinstalldirs.diff
492
 
patch -p1 <../source/faad2_2.0.0_mac.patch
493
 
cd ..
 
269
if ! test -d mp4v2-1.9.1; then
 
270
tar xjf source/mp4v2-1.9.1.tar.bz2
494
271
fi
495
272
 
496
273
 
501
278
# zlib
502
279
 
503
280
cd zlib-1.2.3/zlib-1.2.3
504
 
test -f Makefile || ./configure
 
281
./configure
505
282
make
506
283
mkdir -p inst/usr/local
507
284
make install prefix=`pwd`/inst/usr/local
511
288
 
512
289
# libogg
513
290
 
514
 
cd libogg-1.1.3/
 
291
cd libogg-1.1.4~dfsg.orig/
515
292
test -f Makefile || ./configure --enable-shared=no --enable-static=yes
516
293
make
517
294
mkdir inst
518
295
make install DESTDIR=`pwd`/inst
519
296
cd inst
520
 
tar czf ../../bin/libogg-1.1.3.tgz usr
 
297
tar czf ../../bin/libogg-1.1.4.tgz usr
521
298
cd ../..
522
299
 
523
300
# libvorbis
524
301
 
525
 
cd libvorbis-1.2.0/
 
302
cd libvorbis-1.2.3/
526
303
test -f Makefile || ./configure --enable-shared=no --enable-static=yes --with-ogg=/usr/local
527
304
make
528
305
mkdir inst
529
306
make install DESTDIR=`pwd`/inst
530
307
cd inst
531
 
tar czf ../../bin/libvorbis-1.2.0.tgz usr
 
308
tar czf ../../bin/libvorbis-1.2.3.tgz usr
532
309
cd ../..
533
310
 
534
311
# libflac
556
333
 
557
334
# taglib
558
335
 
559
 
cd taglib-1.5/
560
 
test -f Makefile || CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure --enable-shared=no --enable-static=yes
 
336
cd taglib-1.6/
 
337
test -f Makefile || CPPFLAGS="-I/usr/local/include -DTAGLIB_STATIC" LDFLAGS=-L/usr/local/lib ./configure --enable-shared=no --enable-static=yes --enable-mp4 --enable-asf
561
338
make
562
339
mkdir inst
563
340
make install DESTDIR=`pwd`/inst
564
341
cd inst
565
 
tar czf ../../bin/taglib-1.5.tgz usr
 
342
tar czf ../../bin/taglib-1.6.tgz usr
566
343
cd ../..
567
344
 
568
345
# mp4v2
569
346
 
570
 
cd faad2/
571
 
aclocal
572
 
automake
573
 
autoconf
574
 
if ! test -f configure.orig; then
575
 
  mv configure configure.orig
576
 
  sed 's/  PKG_CHECK_MODULES(BMP, bmp)/#  PKG_CHECK_MODULES(BMP, bmp)/' configure.orig >configure
577
 
  chmod +x configure
578
 
fi
579
 
test -f Makefile || ./configure --with-mp4v2 --without-xmms --without-bmp --enable-shared=no --enable-static=yes
580
 
make
 
347
cd mp4v2-1.9.1/
 
348
test -f Makefile || ./configure --enable-shared=no --enable-static=yes --disable-gch
581
349
mkdir inst
582
350
make install DESTDIR=`pwd`/inst
583
351
cd inst
584
 
tar czf ../../bin/faad2-2.0.0.tgz usr
 
352
tar czf ../../bin/mp4v2-1.9.1.tgz usr
585
353
cd ../..
586
354
 
587
355
 
588
356
# Install to root directory
589
357
 
590
 
if test $(uname) = "Darwin"; then
591
 
  sudo chmod go+w /usr/local
 
358
BUILDROOT=/
 
359
if test $(uname) = "Linux"; then
 
360
  test -d buildroot || mkdir buildroot
 
361
  BUILDROOT=`pwd`/buildroot/
 
362
  # Static build can be tested from Linux in kid3 directory
 
363
  if ! test -d kid3; then
 
364
    mkdir kid3
 
365
    cat >kid3/build.sh <<"EOF"
 
366
BUILDPREFIX=$(cd ..; pwd)/buildroot/usr/local
 
367
../../kid3/kid3-qt/configure --prefix= --with-bindir= --with-datarootdir= --with-docdir= --with-translationsdir= --without-musicbrainz --enable-debug --enable-gcc-pch --with-qmake=qmake-qt4 --with-extra-includes="$BUILDPREFIX/include $BUILDPREFIX/include/taglib" --with-extra-defines="ID3LIB_LINKOPTION=1 FLAC__NO_DLL" --with-extra-libs="-L$BUILDPREFIX/lib"
 
368
sed -i 's#-L/usr/lib##g; s#-I/usr/include/taglib##g' kid3/Makefile
 
369
EOF
 
370
    chmod +x kid3/build.sh
 
371
  fi
 
372
elif test $(uname) = "Darwin"; then
 
373
  sudo chmod go+w ${BUILDROOT}usr/local
592
374
fi
593
375
 
594
 
tar xzf bin/zlib-1.2.3.tgz -C /
595
 
tar xzf bin/libogg-1.1.3.tgz -C /
596
 
tar xzf bin/libvorbis-1.2.0.tgz -C /
597
 
tar xzf bin/flac-1.2.1.tgz -C /
598
 
tar xzf bin/id3lib-3.8.3.tgz -C /
599
 
tar xzf bin/taglib-1.5.tgz -C /
600
 
tar xzf bin/faad2-2.0.0.tgz -C /
 
376
tar xzf bin/zlib-1.2.3.tgz -C $BUILDROOT
 
377
tar xzf bin/libogg-1.1.4.tgz -C $BUILDROOT
 
378
tar xzf bin/libvorbis-1.2.3.tgz -C $BUILDROOT
 
379
tar xzf bin/flac-1.2.1.tgz -C $BUILDROOT
 
380
tar xzf bin/id3lib-3.8.3.tgz -C $BUILDROOT
 
381
tar xzf bin/taglib-1.6.tgz -C $BUILDROOT
 
382
tar xzf bin/mp4v2-1.9.1.tgz -C $BUILDROOT
601
383
 
602
384
if test $(uname) = "Darwin"; then
603
 
  sudo chmod go-w /usr/local
 
385
  sudo chmod go-w ${BUILDROOT}usr/local
604
386
fi