-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathicc_examin-build.sh
executable file
·1461 lines (1349 loc) · 39.8 KB
/
icc_examin-build.sh
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/sh
# -xv
if [ $# -gt 1 ] ; then
if [ $1 = "-h" ] || [ $1 = "--help" ] || [ $1 = "-?" ]; then
echo ""
echo "$0 help:"
echo "any argument is passed to the configure scripts"
echo "e.g. --prefix=/usr => ./configure --prefix=/usr"
echo ""
exit 0
fi
fi
# options
# uncomment below the packages you are not interessted in
# elektra,openicc,basiccolor,sane,LibRaw,compicc,synnefo,kolor-manager,cinepaint
# export skip=elektra,openicc,basiccolor,sane,LibRaw,compicc,synnefo,kolor-manager,cinepaint
# uncomment the below line to see less messages
# export verbose=0
top="`pwd`"
stop_build=0
target=iccexamin
### Testing the system ###
UNAME_=`uname`
if [ $UNAME_ = "Darwin" ]; then
MD5SUM=md5
SHA1SUM=shasum
OSX_ARCH="-arch `uname -p`"
# allow for fat binaries
export configure_opts_extra=--disable-dependency-tracking
export SKIPBARCH=1
if [ "$OSX_ARCH" = "ppc" ]; then
OSX_ARCH_CARBON="-arch ppc -arch i386"
OSX_ARCH_LIBRARY="-arch i386 -arch ppc"
#OSX_ARCH_LIBRARY=-DCMAKE_OSX_ARCHITECTURES="i386 ppc"
else
OSX_ARCH_CARBON="-arch i386"
OSX_ARCH_COCOA="-arch x86_64"
OSX_ARCH_LIBRARY="-arch i386 -arch x86_64"
#OSX_ARCH_LIBRARY=-DCMAKE_OSX_ARCHITECTURES="i386 x86_64"
fi
else
MD5SUM=md5sum
if [ "`which sha1`" != "" ]; then
SHA1SUM=sha1
else
SHA1SUM=sha1sum
fi
if [ $UNAME_ = "MINGW32_NT-6.1" ]; then
url=ftp://ftp.gnupg.org/gcrypt/binary
packet_file=sha1sum.exe
checksum=10cf8f3c437f979309c42941f21f4023
if [ -f $packet_file ]; then
echo $packet_file already here
else
echo downloading $url/$packet_file
which curl && curl -L $url/$packet_file -o $packet_file || wget $url/$packet_file
fi
if [ `$MD5SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo downloaded $packet_file
else
rm $packet_file
echo download of $packet_file incomplete
fi
cmake_target="-GMSYS Makefiles"
fi
fi
# get host 64-bit capabilities
echo \
"#include <stdio.h>
int main(int argc, char**argv)
{
fprintf(stdout, \"%d\", (int)sizeof(int*));
return 0;
}" > ptr_size.c
gcc -Wall -g ptr_size.c -o ptr-size
BARCH=""
INTPTR_SIZE=`./ptr-size`
if [ $INTPTR_SIZE -eq 4 ]; then
echo_="32-bit build detected"
elif [ $INTPTR_SIZE -gt 4 ]; then
echo_="64-bit build detected"
if [ -z "$SKIPBARCH" ]; then
BARCH=64
else
echo_="ignore 64-bit build"
fi
FPIC=-fPIC
test -n "$ECHO" && $ECHO "BUILD_64 = 1" >> $CONF
elif [ $INTPTR_SIZE -ne 0 ]; then
echo_="$INTPTR_SIZE-byte intptr_t detected"
else
echo_="CPU bus width not detected"
fi
echo "$echo_"
LIB=lib$BARCH
UNAME_=`uname`
if [ $UNAME_ = "MINGW32_NT-6.1" ]; then
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/$LIB/pkgconfig
fi
# get processor count
echo \
"#include <stdio.h>
#include <omp.h>
int main(int argc, char**argv)
{
int i;
#pragma omp parallel
for(i = 0; i < 2; ++i) ;
fprintf(stdout, \"%d\", omp_get_num_procs());
return 0;
}" > omp.c
gcc -fopenmp -Wall -g omp.c -o processors
cpus=`./processors`
if [ -n "$cpus" ]; then
MAKE_CPUS="-j$cpus"
echo will add MAKE_CPUS=$MAKE_CPUS
fi
# environment
export kde_prefix=$HOME/.kde4/
if [ -z $prefix ]; then
export prefix=$HOME/.local
fi
switch=prefix
if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
prefix="`echo \"$1\" | sed s/\"--$switch=\"//`"
fi
if [ -z $libdir ]; then
libdir=$prefix/$LIB
fi
switch=libdir
if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
libdir="`echo \"$1\" | sed s/\"--$switch=\"//`"
fi
conf_opts="--prefix=$prefix --libdir=$libdir $configure_opts_extra"
if [ -z "$LDFLAGS" ]; then
export LDFLAGS=-L$libdir
fi
if [ -z "$LD_LIBRARY_PATH" ]; then
LD_LIBRARY_PATH=$libdir
else
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$libdir
fi
if [ -z "$PKG_CONFIG_PATH" ]; then
PKG_CONFIG_PATH=$libdir/pkgconfig
else
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libdir/pkgconfig
fi
if [ -z "$PATH" ]; then
PATH=$prefix/bin
else
PATH=$PATH:$prefix/bin
fi
if [ -z "$kde_prefix" ]; then
kde_prefix=$HOME/.kde4/
fi
if [ -z "$verbose" ]; then
verbose=1
fi
if [ $verbose -eq 0 ]; then
v=--disable-verbose
else
v=--enable-silent-rules
fi
export PATH PKG_CONFIG_PATH LD_LIBRARY_PATH kde_prefix
### dependency testing ###
# pkg-config
packet=pkg-config
packet_dir=$packet-0.29.1
packet_file=$packet_dir.tar.gz
url=http://pkgconfig.freedesktop.org/releases/
packet_ready=0
checksum=271ce928f6d673cc16cbced2bfd14a5f2e5d3d37
#b59dddd6b5320bd74c0f74b3339618a327096b2a
pkg-config --version
if [ $? -eq 0 ]; then
echo "$packet found, skipping $packet build and installation"
packet_ready=1
else
if [ -d $packet_dir ]; then
echo "$packet + $packet_dir found, skipping $packet download"
packet_ready=1
fi
if [ -f $packet_file ]; then
echo $packet_file already here
else
echo downloading $url/$packet_file
which curl && curl -L $url/$packet_file -o $packet_file || wget $url/$packet_file
if [ $verbose -gt 0 ]; then sleep 1; fi
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo sha1sum for $packet_file passed
else
echo sha1sum for $packet_file failed
exit 1
fi
if [ -d $packet_dir ]; then
echo remove $packet_dir
if [ $verbose -gt 0 ]; then sleep 1; fi
rm -r $packet_dir
fi
tar xzf $packet_file
cd $packet_dir
make clean
CFLAGS=-I./glib-1.2.10 ./configure --with-internal-glib $conf_opts $@
make $MAKE_CPUS
make install
fi
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
fltk="FLTK: `fltk-config --version`"
if [ $? -gt 0 ]; then
fltk="!!! FLTK is missed"
#stop_build=1
# FLTK
echo building FLTK ...
packet=fltk
url=http://www.fltk.org/pub/fltk/1.3.3/
packet_dir=$packet-1.3.3
packet_file="$packet_dir"-source.tar.gz
checksum=9ccdb0d19dc104b87179bd9fd10822e3
if [ -f $packet_file ]; then
echo $packet_file already here
else
echo "downloading $url$packet_file"
which curl && curl -L "$url$packet_file" -o $packet_file || wget "$url$packet_file"
if [ $verbose -gt 0 ]; then sleep 1; fi
fi
if [ `$MD5SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo md5sum for $packet_file passed
else
echo md5sum for $packet_file failed
exit 1
fi
packet_ready=0
pkg-config --atleast-version=1.1.7 $packet
if [ $? -eq 0 ]; then
if [ -d $packet_dir ]; then
echo "$packet + $packet_dir found, skipping $packet build and installation"
packet_ready=1
fi
else
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH
pkg-config --modversion $packet
fi
if [ $packet_ready -lt 1 ]; then
if [ -d $packet_dir ]; then
echo remove $packet_dir
if [ $verbose -gt 0 ]; then sleep 1; fi
rm -r $packet_dir
fi
echo unpacking $packet_file ...
tar xzf $packet_file
cd $packet_dir
make clean
fltk_conf_opts="`echo $conf_opts | sed s/--disable-dependency-tracking//g`"
./configure $fltk_conf_opts --enable-gl --enable-shared --enable-threads --enable-xinerama --enable-xft $@
make $MAKE_CPUS
make install
fi
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
fi
pkg-config --atleast-version=2.8 lcms2
if [ $? -eq 0 ]; then
lcms="littleCMS: `pkg-config --modversion lcms2`"
else
lcms="littleCMS version is too old; need at least lcms-1.14"
#stop_build=1
# lcms
echo building lcms ...
packet=lcms2
packet_dir=$packet-2.8
packet_file="$packet_dir".tar.gz
url="http://sourceforge.net/projects/lcms/files/lcms/2.8/"
checksum=e9535ec4a572b8fc7a1c405c35e6f4dc97714197
if [ -f $packet_file ]; then
echo $packet_file already here
else
echo "downloading $url$packet_file"
which curl && curl -L "$url$packet_file" -o $packet_file || wget "$url$packet_file"
if [ $verbose -gt 0 ]; then sleep 1; fi
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo sha1sum for $packet_file passed
else
echo sha1sum for $packet_file failed
exit 1
fi
packet_ready=0
pkg-config --atleast-version=1.17 $packet
if [ $? -eq 0 ]; then
if [ -d $packet_dir ]; then
echo "$packet + $packet_dir found, skipping $packet build and installation"
packet_ready=1
fi
else
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH
pkg-config --modversion $packet
fi
if [ $packet_ready -lt 1 ]; then
if [ -d $packet_dir ]; then
echo remove $packet_dir
if [ $verbose -gt 0 ]; then sleep 1; fi
rm -r $packet_dir
fi
echo unpacking $packet_file ...
tar xzf $packet_file
cd $packet_dir
make clean
CFLAGS="$CFLAGS $OSX_ARCH_LIBRARY" CXXFLAGS="$CXXFLAGS $OSX_ARCH_LIBRARY" LDFLAGS="$LDFLAGS $OSX_ARCH_LIBRARY" ./configure $conf_opts $@
make $MAKE_CPUS
make install
fi
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
fi
packet=libxml-2.0
pkg-config --atleast-version=2.0 $packet
if [ $? -eq 0 ]; then
libxml2="$packet: `pkg-config --modversion $packet`"
else
libxml2="$packet version is too old; need at least $packet"
if [ $UNAME_ = "MINGW32_NT-6.1" ]; then
echo downloading $packet ...
packet_dir=libxml2-2.7.8.win32
packet_file="$packet_dir".zip
url="ftp://ftp.zlatkovic.com/libxml/"
checksum=cc021bcb0b84a5e34c5aeed6df43c10ed4c15d35
if [ -f $packet_file ]; then
echo $packet_file already here
else
echo "downloading $url$packet_file"
which curl && curl -L "$url$packet_file" -o $packet_file || wget "$url$packet_file"
if [ $verbose -gt 0 ]; then sleep 1; fi
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo sha1sum for $packet_file passed
else
echo sha1sum for $packet_file failed
exit 1
fi
packet_ready=0
pkg-config --atleast-version=1.0 $packet
if [ $? -eq 0 ]; then
if [ -d $packet_dir ]; then
echo "$packet + $packet_dir found, skipping $packet build and installation"
packet_ready=1
fi
else
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH
pkg-config --modversion $packet
fi
if [ $packet_ready -lt 1 ]; then
if [ -d $packet_dir ]; then
echo remove $packet_dir
if [ $verbose -gt 0 ]; then sleep 1; fi
rm -r $packet_dir
fi
echo unpacking $packet_file ...
unzip -q $packet_file
cd $packet_dir
cp -a bin/* $prefix/bin/
cp -a include/* $prefix/include/
cp -a lib/* $prefix/$LIB/
fi
fi
libpng="$packet: `pkg-config --modversion $packet`"
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
fi
packet=libpng
pkg-config --atleast-version=1.0 $packet
if [ $? -eq 0 ]; then
libpng="$packet: `pkg-config --modversion $packet`"
else
libpng="$packet version is too old; need at least $packet 1.0"
#stop_build=1
echo building $packet ...
packet_dir=$packet-1.5.2
packet_file="$packet_dir".tar.gz
url="http://sourceforge.net/projects/libpng/files/libpng15/older-releases/1.5.2/"
checksum=71c30b9b23169a2dac5b0a77954d9d91f8d944fe
if [ -f $packet_file ]; then
echo $packet_file already here
else
echo "downloading $url$packet_file"
which curl && curl -L "$url$packet_file" -o $packet_file || wget "$url$packet_file"
if [ $verbose -gt 0 ]; then sleep 1; fi
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo sha1sum for $packet_file passed
else
echo sha1sum for $packet_file failed
exit 1
fi
packet_ready=0
pkg-config --atleast-version=1.0 $packet
if [ $? -eq 0 ]; then
if [ -d $packet_dir ]; then
echo "$packet + $packet_dir found, skipping $packet build and installation"
packet_ready=1
fi
else
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH
pkg-config --modversion $packet
fi
if [ $packet_ready -lt 1 ]; then
if [ -d $packet_dir ]; then
echo remove $packet_dir
if [ $verbose -gt 0 ]; then sleep 1; fi
rm -r $packet_dir
fi
echo unpacking $packet_file ...
tar xzf $packet_file
cd $packet_dir
make clean
CFLAGS="$CFLAGS $OSX_ARCH_LIBRARY" CXXFLAGS="$CXXFLAGS $OSX_ARCH_LIBRARY" LDFLAGS="$LDFLAGS $OSX_ARCH_LIBRARY" ./configure $conf_opts $@
make $MAKE_CPUS
make install
fi
libpng="$packet: `pkg-config --modversion $packet`"
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
fi
packet=freetype2
pkg-config --atleast-version=1.0 $packet
if [ $? -eq 0 ]; then
freetype="$packet: `pkg-config --modversion $packet`"
else
freetype="$packet version is too old; need at least $packet 1.0"
#stop_build=1
packet=freetype
echo building $packet ...
packet_dir=$packet-2.7
packet=freetype2
packet_file="$packet_dir".tar.gz
url="http://download.savannah.gnu.org/releases/freetype/"
checksum=5dbaca27c80d8a620dd4093fd2a9f934a043ae2b
if [ -f $packet_file ]; then
echo $packet_file already here
else
echo "downloading $url$packet_file"
which curl && curl -L "$url$packet_file" -o $packet_file || wget "$url$packet_file"
if [ $verbose -gt 0 ]; then sleep 1; fi
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo sha1sum for $packet_file passed
else
echo sha1sum for $packet_file failed
exit 1
fi
packet_ready=0
pkg-config --atleast-version=1.0 $packet
if [ $? -eq 0 ]; then
if [ -d $packet_dir ]; then
echo "$packet + $packet_dir found, skipping $packet build and installation"
packet_ready=1
fi
else
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH
pkg-config --modversion $packet
fi
if [ $packet_ready -lt 1 ]; then
if [ -d $packet_dir ]; then
echo remove $packet_dir
if [ $verbose -gt 0 ]; then sleep 1; fi
rm -r $packet_dir
fi
echo unpacking $packet_file ...
tar xzf $packet_file
cd $packet_dir
make clean
CFLAGS="$CFLAGS $OSX_ARCH_LIBRARY" CXXFLAGS="$CXXFLAGS $OSX_ARCH_LIBRARY" LDFLAGS="$LDFLAGS $OSX_ARCH_LIBRARY" ./configure $conf_opts $@
make $MAKE_CPUS
make install
fi
freetype="$packet: `pkg-config --modversion $packet`"
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
fi
packet=ftgl
pkg-config --atleast-version=1.0 $packet
if [ $? -eq 0 ]; then
ftgl="$packet: `pkg-config --modversion $packet`"
else
ftgl="$packet version is too old; need at least $packet 1.0"
#stop_build=1
echo building $packet ...
packet_dir=$packet-2.1.3-rc5
packet_file="$packet_dir".tar.gz
url="http://downloads.sourceforge.net/project/ftgl/FTGL Source/2.1.3~rc5/"
checksum=b9c11d3a594896333f1bbe46e10d8617713b4fc6
if [ -f $packet_file ]; then
echo $packet_file already here
else
echo "downloading $url$packet_file"
which curl && curl -L "$url$packet_file" -o $packet_file || wget "$url$packet_file"
if [ $verbose -gt 0 ]; then sleep 1; fi
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo sha1sum for $packet_file passed
else
echo sha1sum for $packet_file failed
exit 1
fi
packet_ready=0
pkg-config --atleast-version=1.0 $packet
packet_dir="$packet-2.1.3~rc5"
if [ $? -eq 0 ]; then
if [ -d $packet_dir ]; then
echo "$packet + $packet_dir found, skipping $packet build and installation"
packet_ready=1
fi
else
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH
pkg-config --modversion $packet
fi
if [ $packet_ready -lt 1 ]; then
if [ -d $packet_dir ]; then
echo remove $packet_dir
if [ $verbose -gt 0 ]; then sleep 1; fi
rm -r $packet_dir
fi
echo unpacking $packet_file ...
tar xzf $packet_file
cd $packet_dir
make clean
CFLAGS="$CFLAGS $OSX_ARCH_LIBRARY" CXXFLAGS="$CXXFLAGS $OSX_ARCH_LIBRARY" LDFLAGS="$LDFLAGS $OSX_ARCH_LIBRARY" ./configure $conf_opts $@
make $MAKE_CPUS
make install
fi
ftgl="$packet: `pkg-config --modversion $packet`"
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
fi
packet=cmake
$packet --version
if [ $? -eq 0 ]; then
cmake="$packet: `cmake --version`"
else
cmake="$packet version is too old; need at least $packet 2.8"
#stop_build=1
echo building $packet ...
packet_dir=$packet-3.6.1
packet_file="$packet_dir".tar.gz
url="http://www.cmake.org/files/v3.6/"
checksum=a37785b3f256a31ee21a047569bc74a8f57067bb
if [ -f $packet_file ]; then
echo $packet_file already here
else
echo "downloading $url$packet_file"
which curl && curl -L "$url$packet_file" -o $packet_file || wget "$url$packet_file"
if [ $verbose -gt 0 ]; then sleep 1; fi
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo sha1sum for $packet_file passed
else
echo sha1sum for $packet_file failed
exit 1
fi
packet_ready=0
pkg-config --atleast-version=1.0 $packet
if [ $? -eq 0 ]; then
if [ -d $packet_dir ]; then
echo "$packet + $packet_dir found, skipping $packet build and installation"
packet_ready=1
fi
else
$packet --version
fi
if [ $packet_ready -lt 1 ]; then
if [ -d $packet_dir ]; then
echo remove $packet_dir
if [ $verbose -gt 0 ]; then sleep 1; fi
rm -r $packet_dir
fi
echo unpacking $packet_file ...
tar xzf $packet_file
cd $packet_dir
which c++
./configure --prefix=$prefix
make
make install
fi
cmake="$packet: `cmake --version`"
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
fi
packet=gettext
$packet --version
if [ $? -eq 0 ]; then
gettext="$packet: found"
else
#stop_build=1
echo building $packet ...
packet_dir=$packet-0.19.8
packet_file="$packet_dir".tar.gz
url="http://ftp.gnu.org/gnu/gettext/"
checksum=4b3dc947a729fac8a14bde473454730919382b23
if [ -f $packet_file ]; then
echo $packet_file already here
else
echo "downloading $url$packet_file"
which curl && curl -L "$url$packet_file" -o $packet_file || wget "$url$packet_file"
if [ $verbose -gt 0 ]; then sleep 1; fi
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo sha1sum for $packet_file passed
else
echo sha1sum for $packet_file failed
exit 1
fi
packet_ready=0
if [ $packet_ready -lt 1 ]; then
if [ -d $packet_dir ]; then
echo remove $packet_dir
if [ $verbose -gt 0 ]; then sleep 1; fi
rm -r $packet_dir
fi
echo unpacking $packet_file ...
tar xzf $packet_file
cd $packet_dir
which c++
./configure --prefix=$prefix
make
make install
fi
gettext="$packet: `gettext --version | grep gettext`"
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
fi
echo "$fltk"
echo "$freetype"
echo "$ftgl"
echo "$lcms"
echo "$libxml2"
echo "$libpng"
echo "$cmake"
echo "$gettext"
echo ""
echo "$0 $@"
echo "PATH = $PATH"
echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
echo "PKG_CONFIG_PATH = $PKG_CONFIG_PATH"
echo "prefix = $prefix"
echo "kde_prefix = $kde_prefix"
echo "skip = $skip"
if [ $stop_build -gt 0 ]; then
echo ""
echo "some dependencies are missed; see above"
echo ""
exit 1
fi
if [ $verbose -gt 0 ]; then sleep 1; fi
# Git
packet=git
packet_dir=$packet-1.9.4
packet_file=$packet_dir.tar.gz
url=https://kernel.org/pub/software/scm/git/
packet_ready=0
git="git: `git --version`"
if [ $? -eq 0 ]; then
echo "$packet found, skipping $packet build and installation"
packet_ready=1
echo "$git"
else
if [ -d $packet_dir ]; then
echo "$packet + $packet_dir found, skipping $packet download"
fi
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH
pkg-config --modversion $packet
if [ -f $packet_file ]; then
echo $packet_file already here
else
echo downloading $url/$packet_file
which curl && curl -L $url/$packet_file -o $packet_file || wget $url/$packet_file
if [ $verbose -gt 0 ]; then sleep 1; fi
fi
if [ -d $packet_dir ]; then
echo remove $packet_dir
if [ $verbose -gt 0 ]; then sleep 1; fi
rm -r $packet_dir
fi
tar xzf $packet_file
cd $packet_dir
make clean
./configure $conf_opts $@
make $MAKE_CPUS
make install
fi
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
# yajl
git_repo=yajl
echo checkout $git_repo
if [ -d $git_repo ]; then
cd $git_repo
git pull
else
git clone git://github.com/lloyd/$git_repo $git_repo
cd $git_repo
git checkout master
url=https://build.opensuse.org/source/home:bekun:devel/libyajl
packet_file=lib_suffix.patch
checksum=6a884be9da38be55afeab2c83759867bc2a73bff
echo download and apply $packet_file
if [ -f $packet_file ]; then
a=1
else
which curl && curl -L https://build.opensuse.org/source/home:bekun:devel/libyajl/libyajl-lib_suffix.patch?rev=074e0464184ff3fb87ceafb5149c600f -o $packet_file || wget $url/$packet_file
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo sha1sum for $packet_file passed
else
echo sha1sum for $packet_file failed
exit 1
fi
patch -p1 < $packet_file
mkdir build
fi
update_yajl=0
if [ $verbose -gt 0 ]; then sleep 2; fi
git_version="`cat .git/refs/heads/master`"
if [[ ! -d build ]]; then
mkdir build
update_yajl=1
fi
old_git_version="`cat old_gitrev.txt`"
update_oyranos=0
pkg-config --atleast-version=0.8 $git_repo
if [ $? -ne 0 ] || [ $update_yajl = 1 ] ||
[ "$git_version" != "$old_git_version" ]; then
cd build
echo "$git_repo `pkg-config --modversion $git_repo`"
update_oyranos=1
# the first cmake call finds good defaults, the second add all the script flags
cmake "$cmake_target" -DCMAKE_INSTALL_PREFIX="$prefix" -DLIB_SUFFIX=$BARCH -DCMAKE_BUILD_TYPE=Debug ..
cmake "$cmake_target" -DCMAKE_C_FLAGS="$CFLAGS $OSX_ARCH_LIBRARY" -DCMAKE_CXX_FLAGS="$CXXFLAGS $OSX_ARCH_LIBRARY" -DCMAKE_LD_FLAGS="$LDFLAGS $OSX_ARCH_LIBRARY" -DCMAKE_INSTALL_PREFIX="$prefix" -DLIB_SUFFIX=$BARCH -DCMAKE_BUILD_TYPE=Debug ..
if [ $UNAME_ = "MINGW32_NT-6.1" ]; then
make
else
make $MAKE_CPUS
fi
make install
make check
cd "$top/$git_repo"
echo "$git_version" > old_gitrev.txt
else
echo no changes in git $git_version
fi
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
# Elektra
git_repo=libelektra
echo checkout $git_repo
if [ -d $git_repo ]; then
cd $git_repo
git pull
else
git clone git://github.com/ElektraInitiative/$git_repo $git_repo
cd $git_repo
git checkout master
mkdir build
fi
update_xcm=0
if [ $verbose -gt 0 ]; then sleep 2; fi
git_version="`cat .git/refs/heads/master`"
if [[ ! -d build ]]; then
mkdir build
update_xcm=1
fi
old_git_version="`cat old_gitrev.txt`"
update_oyranos=0
pkg-config --atleast-version=0.8 elektra
if [ $? -ne 0 ] || [ $update_xcm = 1 ] ||
[ "$git_version" != "$old_git_version" ]; then
cd build
echo "elektra `pkg-config --modversion elektra`"
update_oyranos=1
if [ $UNAME_ = "MINGW32_NT-6.1" ]; then
cmake "$cmake_target" -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DCMAKE_LD_FLAGS="$LDFLAGS" -DCMAKE_INSTALL_PREFIX="$prefix" -DXDG_CONFIG_DIR="$HOME/.config/xdg" -DLIB_SUFFIX=$BARCH -DCMAKE_BUILD_TYPE=Debug ..
make
else
cmake "$cmake_target" -DCMAKE_INSTALL_PREFIX="$prefix" -DLIB_SUFFIX=$BARCH -DCMAKE_BUILD_TYPE=Debug -DINSTALL_SYSTEM_FILES=false -DBUILD_TESTING=false -DENABLE_TESTING=OFF -DTOOLS=DEFAULT -DPLUGINS="ALL;dump;resolver;yajl;rename;struct;-passwd" ..
cmake "$cmake_target" -DCMAKE_C_FLAGS="$CFLAGS $OSX_ARCH_LIBRARY" -DCMAKE_CXX_FLAGS="$CXXFLAGS $OSX_ARCH_LIBRARY" -DCMAKE_LD_FLAGS="$LDFLAGS $OSX_ARCH_LIBRARY" ..
make $MAKE_CPUS
fi
make install
make check
cd "$top/$git_repo"
echo "$git_version" > old_gitrev.txt
else
echo no changes in git $git_version
fi
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
# Xcolor
git_repo=libxcm
echo checkout $git_repo
if [ -d $git_repo ]; then
cd $git_repo
git pull
else
git clone git://github.com/oyranos-cms/$git_repo $git_repo
cd $git_repo
git checkout master
fi
if [ $verbose -gt 0 ]; then sleep 2; fi
update_xcm=0
git_version="`cat .git/refs/heads/master`"
old_git_version="`cat old_gitrev.txt`"
pkg-config --atleast-version=0.5 xcm
if [ $? -ne 0 ] || [ "$git_version" != "$old_git_version" ]; then
echo "xcm `pkg-config --modversion xcm`"
update_xcm=1
if [ $UNAME_ = "MINGW32_NT-6.1" ]; then
xcolor_skip="--disable-libX11"
fi
CFLAGS="$CFLAGS $OSX_ARCH_LIBRARY" CXXFLAGS="$CXXFLAGS $OSX_ARCH_LIBRARY" LDFLAGS="$LDFLAGS $OSX_ARCH_LIBRARY" ./configure $v $conf_opts $xcolor_skip $@
make $MAKE_CPUS
make install
cd "$top/$git_repo"
echo "$git_version" > old_gitrev.txt
else
echo no changes in git $git_version
fi
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
# Xcalib
packet=xcalib
git_repo=$packet
xcalib -version
echo checkout $git_repo
if [ -d $git_repo ]; then
cd $git_repo
git pull
else
git clone git://github.com/openicc/$git_repo $git_repo
cd $git_repo
git checkout master
mkdir build
fi
if [ $verbose -gt 0 ]; then sleep 2; fi
git_version="`cat .git/refs/heads/master`"
old_git_version="`cat old_gitrev.txt`"
if [ "$git_version" != "$old_git_version" ]; then
echo "$packet `xcalib -version`"
cd build
cmake "$cmake_target" -DCMAKE_INSTALL_PREFIX="$prefix" -DCMAKE_BUILD_TYPE=Debug ..
cmake "$cmake_target" -DCMAKE_C_FLAGS="$CFLAGS $OSX_ARCH_LIBRARY" -DCMAKE_CXX_FLAGS="$CXXFLAGS $OSX_ARCH_LIBRARY" -DCMAKE_LD_FLAGS="$LDFLAGS $OSX_ARCH_LIBRARY" -DCMAKE_BUILD_TYPE=Debug ..
make $MAKE_CPUS
make install
cd "$top/$git_repo"
echo "$git_version" > old_gitrev.txt
else
echo no changes in git $git_version
fi
if [ $verbose -gt 0 ]; then sleep 1; fi
cd "$top"
# SANE
UNAME_=`uname`
if [ $UNAME_ = "Darwin" ] || [ `echo "$skip" | grep sane | wc -l` -ne 0 ]; then
echo sane skipped
else
git_repo=sane-backends
if [ -d $git_repo ]; then
cd $git_repo
echo revert old patches ...
patch -p1 -R < patch_old.patch
cd "$top"
fi
echo checkout $git_repo
if [ -d $git_repo ]; then
cd $git_repo
git pull
else
echo git://git.debian.org/git/sane/sane-backends.git
git clone git://git.debian.org/git/sane/$git_repo.git
cd $git_repo
git checkout master
fi
if [ $verbose -gt 0 ]; then sleep 2; fi
git_version="`cat .git/refs/heads/master`"
url=http://alioth.debian.org/tracker/download.php/30186/410366/312641/3945
packet_file=sane_cap_colour.patch
checksum=4665a1e4b7b9b920a10b830b354ee32667eaefd6
echo download and apply $packet_file
if [ -f $packet_file ]; then
a=1
else
which curl && curl -L $url/$packet_file -o $packet_file || wget $url/$packet_file
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo sha1sum for $packet_file passed
else
echo sha1sum for $packet_file failed
exit 1
fi
patch -p1 < $packet_file
url=http://alioth.debian.org/tracker/download.php/30186/410366/312641/3946
packet_file=sane_cap_colour_plustek.patch
checksum=4198052440777e8697a9adf1c86844b4a143c6ba
echo download and apply $packet_file
echo download and apply $packet_file
if [ -f $packet_file ]; then
a=1
else
which curl && curl -L $url/$packet_file -o $packet_file || wget $url/$packet_file
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then
echo sha1sum for $packet_file passed
else
echo sha1sum for $packet_file failed
exit 1
fi
patch -p1 < $packet_file
url=http://alioth.debian.org/tracker/download.php/30186/410366/312641/3947
packet_file=sane_cap_colour_backends.patch
checksum=3dc60111bb371fc191387f144dc977a33b232b59
echo download and apply $packet_file
if [ -f $packet_file ]; then
a=1
else
which curl && curl -L $url/$packet_file,gz -o $packet_file.gz || wget $url/$packet_file.gz
gzip -d $packet_file.gz
fi
if [ `$SHA1SUM $packet_file | grep $checksum | wc -l` -eq 1 ]; then