sc: filter: rtf: use a separate document stream
[LibreOffice.git] / bin / oss-fuzz-setup.sh
blobb2b0be8a0aaea27932e47cf5db8660b3ae4caf03
1 #!/usr/bin/env bash
3 set -e
5 echo start downloading dependencies at `date -u`
7 # convert FOO := BAR$(MICRO) to FOO=BAR$MICRO
8 source <(sed -e's# := #=#g' download.lst | sed -e 's#[)(]##g')
10 cd $SRC
12 #cache build dependencies
13 curl --no-progress-meter -S \
14 -C - -O https://dev-www.libreoffice.org/src/$FONT_LIBERATION_TARBALL \
15 -C - -O https://dev-www.libreoffice.org/extern/$OPENSYMBOL_TTF \
16 -C - -O https://dev-www.libreoffice.org/src/$RASQAL_TARBALL \
17 -C - -O https://dev-www.libreoffice.org/src/$CLUCENE_TARBALL \
18 -C - -O https://dev-www.libreoffice.org/src/$HYPHEN_TARBALL \
19 -C - -O https://dev-www.libreoffice.org/src/$RAPTOR_TARBALL \
20 -C - -O https://dev-www.libreoffice.org/src/$MYTHES_TARBALL \
21 -C - -O https://dev-www.libreoffice.org/src/$REDLAND_TARBALL \
22 -C - -O https://dev-www.libreoffice.org/src/$BOOST_TARBALL \
23 -C - -O https://dev-www.libreoffice.org/src/$BOX2D_TARBALL \
24 -C - -O https://dev-www.libreoffice.org/src/$DTOA_TARBALL \
25 -C - -O https://dev-www.libreoffice.org/src/$EXPAT_TARBALL \
26 -C - -O https://dev-www.libreoffice.org/src/$LIBJPEG_TURBO_TARBALL \
27 -C - -O https://dev-www.libreoffice.org/src/$LCMS2_TARBALL \
28 -C - -O https://dev-www.libreoffice.org/src/$LIBEXTTEXTCAT_TARBALL \
29 -C - -O https://dev-www.libreoffice.org/src/$CPPUNIT_TARBALL \
30 -C - -O https://dev-www.libreoffice.org/src/$CAIRO_TARBALL \
31 -C - -O https://dev-www.libreoffice.org/src/$CURL_TARBALL \
32 -C - -O https://dev-www.libreoffice.org/src/$XMLSEC_TARBALL \
33 -C - -O https://dev-www.libreoffice.org/src/$LIBLANGTAG_TARBALL \
34 -C - -O https://dev-www.libreoffice.org/src/$ABW_TARBALL \
35 -C - -O https://dev-www.libreoffice.org/src/$CDR_TARBALL \
36 -C - -O https://dev-www.libreoffice.org/src/$LIBCMIS_TARBALL \
37 -C - -O https://dev-www.libreoffice.org/src/$EBOOK_TARBALL \
38 -C - -O https://dev-www.libreoffice.org/src/$ETONYEK_TARBALL \
39 -C - -O https://dev-www.libreoffice.org/src/$FREEHAND_TARBALL \
40 -C - -O https://dev-www.libreoffice.org/src/$MSPUB_TARBALL \
41 -C - -O https://dev-www.libreoffice.org/src/$MWAW_TARBALL \
42 -C - -O https://dev-www.libreoffice.org/src/$ODFGEN_TARBALL \
43 -C - -O https://dev-www.libreoffice.org/src/$ORCUS_TARBALL \
44 -C - -O https://dev-www.libreoffice.org/src/$PAGEMAKER_TARBALL \
45 -C - -O https://dev-www.libreoffice.org/src/$LIBPNG_TARBALL \
46 -C - -O https://dev-www.libreoffice.org/src/$REVENGE_TARBALL \
47 -C - -O https://dev-www.libreoffice.org/src/$STAROFFICE_TARBALL \
48 -C - -O https://dev-www.libreoffice.org/src/$VISIO_TARBALL \
49 -C - -O https://dev-www.libreoffice.org/src/$WPD_TARBALL \
50 -C - -O https://dev-www.libreoffice.org/src/$WPG_TARBALL \
51 -C - -O https://dev-www.libreoffice.org/src/$WPS_TARBALL \
52 -C - -O https://dev-www.libreoffice.org/src/$ZMF_TARBALL \
53 -C - -O https://dev-www.libreoffice.org/src/$PIXMAN_TARBALL \
54 -C - -O https://dev-www.libreoffice.org/src/$ZLIB_TARBALL \
55 -C - -O https://dev-www.libreoffice.org/src/$MDDS_TARBALL \
56 -C - -O https://dev-www.libreoffice.org/src/$OPENSSL_TARBALL \
57 -C - -O https://dev-www.libreoffice.org/src/$LANGTAGREG_TARBALL \
58 -C - -O https://dev-www.libreoffice.org/src/$GRAPHITE_TARBALL \
59 -C - -O https://dev-www.libreoffice.org/src/$HARFBUZZ_TARBALL \
60 -C - -O https://dev-www.libreoffice.org/src/$GLM_TARBALL \
61 -C - -O https://dev-www.libreoffice.org/src/$ICU_TARBALL \
62 -C - -O https://dev-www.libreoffice.org/src/$ICU_DATA_TARBALL \
63 -C - -O https://dev-www.libreoffice.org/src/$LIBXML_TARBALL \
64 -C - -O https://dev-www.libreoffice.org/src/$LIBXSLT_TARBALL \
65 -C - -O https://dev-www.libreoffice.org/src/$HUNSPELL_TARBALL \
66 -C - -O https://dev-www.libreoffice.org/src/$FREETYPE_TARBALL \
67 -C - -O https://dev-www.libreoffice.org/src/$FONTCONFIG_TARBALL \
68 -C - -O https://dev-www.libreoffice.org/src/$EPOXY_TARBALL \
69 -C - -O https://dev-www.libreoffice.org/src/$EPUBGEN_TARBALL \
70 -C - -O https://dev-www.libreoffice.org/src/$LIBNUMBERTEXT_TARBALL \
71 -C - -O https://dev-www.libreoffice.org/src/$QXP_TARBALL
72 #fuzzing dictionaries
73 curl --no-progress-meter -S \
74 -C - -O https://raw.githubusercontent.com/rc0r/afl-fuzz/master/dictionaries/gif.dict \
75 -C - -O https://raw.githubusercontent.com/rc0r/afl-fuzz/master/dictionaries/jpeg.dict \
76 -C - -O https://raw.githubusercontent.com/rc0r/afl-fuzz/master/dictionaries/png.dict \
77 -C - -O https://raw.githubusercontent.com/rc0r/afl-fuzz/master/dictionaries/tiff.dict \
78 -C - -O https://raw.githubusercontent.com/rc0r/afl-fuzz/master/dictionaries/xml.dict \
79 -C - -O https://raw.githubusercontent.com/rc0r/afl-fuzz/master/dictionaries/html_tags.dict
80 #fuzzing corpuses
81 curl --no-progress-meter -S -C - -O https://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz
82 mkdir -p afl-testcases && cd afl-testcases/ && tar xf $SRC/afl_testcases.tgz && cd .. && \
83 zip -q $SRC/jpgfuzzer_seed_corpus.zip afl-testcases/jpeg*/full/images/* && \
84 zip -q $SRC/giffuzzer_seed_corpus.zip afl-testcases/gif*/full/images/* && \
85 zip -q $SRC/bmpfuzzer_seed_corpus.zip afl-testcases/bmp*/full/images/* && \
86 zip -q $SRC/pngfuzzer_seed_corpus.zip afl-testcases/png*/full/images/*
87 # using github's svn view to use svn export as a hack to just export part of the git repo
88 svn export --force -q https://github.com/khaledhosny/ots/trunk/tests/fonts $SRC/sample-sft-fonts/ots
89 svn export --force -q https://github.com/unicode-org/text-rendering-tests/trunk/fonts/ $SRC/sample-sft-fonts/unicode-org
90 svn export --force -q https://github.com/harfbuzz/harfbuzz/trunk/test/shape/data/in-house/fonts $SRC/sample-sft-fonts/harfbuzz
91 mkdir -p $SRC/sample-sft-fonts/adobe
92 curl --no-progress-meter -S \
93 -C - -o $SRC/sample-sft-fonts/adobe/AdobeVFPrototype.otf https://github.com/adobe-fonts/adobe-variable-font-prototype/releases/download/1.001/AdobeVFPrototype.otf
94 zip -qr $SRC/sftfuzzer_seed_corpus.zip $SRC/sample-sft-fonts
95 curl --no-progress-meter -S \
96 -C - -O https://dev-www.libreoffice.org/corpus/wmffuzzer_seed_corpus.zip \
97 -C - -O https://dev-www.libreoffice.org/corpus/xbmfuzzer_seed_corpus.zip \
98 -C - -O https://dev-www.libreoffice.org/corpus/xpmfuzzer_seed_corpus.zip \
99 -C - -O https://dev-www.libreoffice.org/corpus/svmfuzzer_seed_corpus.zip \
100 -C - -O https://dev-www.libreoffice.org/corpus/pcdfuzzer_seed_corpus.zip \
101 -C - -O https://dev-www.libreoffice.org/corpus/dxffuzzer_seed_corpus.zip \
102 -C - -O https://dev-www.libreoffice.org/corpus/metfuzzer_seed_corpus.zip \
103 -C - -O https://dev-www.libreoffice.org/corpus/ppmfuzzer_seed_corpus.zip \
104 -C - -O https://dev-www.libreoffice.org/corpus/psdfuzzer_seed_corpus.zip \
105 -C - -O https://dev-www.libreoffice.org/corpus/epsfuzzer_seed_corpus.zip \
106 -C - -O https://dev-www.libreoffice.org/corpus/pctfuzzer_seed_corpus.zip \
107 -C - -O https://dev-www.libreoffice.org/corpus/pcxfuzzer_seed_corpus.zip \
108 -C - -O https://dev-www.libreoffice.org/corpus/rasfuzzer_seed_corpus.zip \
109 -C - -O https://dev-www.libreoffice.org/corpus/tgafuzzer_seed_corpus.zip \
110 -C - -O https://dev-www.libreoffice.org/corpus/tiffuzzer_seed_corpus.zip \
111 -C - -O https://dev-www.libreoffice.org/corpus/hwpfuzzer_seed_corpus.zip \
112 -C - -O https://dev-www.libreoffice.org/corpus/602fuzzer_seed_corpus.zip \
113 -C - -O https://dev-www.libreoffice.org/corpus/lwpfuzzer_seed_corpus.zip \
114 -C - -O https://dev-www.libreoffice.org/corpus/pptfuzzer_seed_corpus.zip \
115 -C - -O https://dev-www.libreoffice.org/corpus/rtffuzzer_seed_corpus.zip \
116 -C - -O https://dev-www.libreoffice.org/corpus/olefuzzer_seed_corpus.zip \
117 -C - -O https://dev-www.libreoffice.org/corpus/cgmfuzzer_seed_corpus.zip \
118 -C - -O https://dev-www.libreoffice.org/corpus/ww2fuzzer_seed_corpus.zip \
119 -C - -O https://dev-www.libreoffice.org/corpus/ww6fuzzer_seed_corpus.zip \
120 -C - -O https://dev-www.libreoffice.org/corpus/ww8fuzzer_seed_corpus.zip \
121 -C - -O https://dev-www.libreoffice.org/corpus/qpwfuzzer_seed_corpus.zip \
122 -C - -O https://dev-www.libreoffice.org/corpus/slkfuzzer_seed_corpus.zip \
123 -C - -O https://dev-www.libreoffice.org/corpus/fodtfuzzer_seed_corpus.zip \
124 -C - -O https://dev-www.libreoffice.org/corpus/fodsfuzzer_seed_corpus.zip \
125 -C - -O https://dev-www.libreoffice.org/corpus/fodgfuzzer_seed_corpus.zip \
126 -C - -O https://dev-www.libreoffice.org/corpus/fodpfuzzer_seed_corpus.zip \
127 -C - -O https://dev-www.libreoffice.org/corpus/xlsfuzzer_seed_corpus.zip \
128 -C - -O https://dev-www.libreoffice.org/corpus/scrtffuzzer_seed_corpus.zip \
129 -C - -O https://dev-www.libreoffice.org/corpus/wksfuzzer_seed_corpus.zip \
130 -C - -O https://dev-www.libreoffice.org/corpus/dbffuzzer_seed_corpus.zip \
131 -C - -O https://dev-www.libreoffice.org/corpus/diffuzzer_seed_corpus.zip \
132 -C - -O https://dev-www.libreoffice.org/corpus/docxfuzzer_seed_corpus.zip \
133 -C - -O https://dev-www.libreoffice.org/corpus/xlsxfuzzer_seed_corpus.zip \
134 -C - -O https://dev-www.libreoffice.org/corpus/pptxfuzzer_seed_corpus.zip \
135 -C - -O https://dev-www.libreoffice.org/corpus/mmlfuzzer_seed_corpus.zip \
136 -C - -O https://dev-www.libreoffice.org/corpus/mtpfuzzer_seed_corpus.zip \
137 -C - -O https://dev-www.libreoffice.org/corpus/htmlfuzzer_seed_corpus.zip
139 echo end downloading dependencies at `date -u`