build-pspp: Fix documentation build.
[pspp] / mingw.sh
1 #! /bin/sh -e
2
3 set -x
4 export WINEPATH='/home/blp/pspp/mingw/inst/bin;/usr/x86_64-w64-mingw32/lib;/usr/lib/gcc/x86_64-w64-mingw32/10-win32;/home/blp/pspp/mingw/inst/bin'
5 wineserver -p || :
6
7 base=/home/blp/pspp/mingw-build
8 cache=/home/blp/pspp/cache
9
10 fetch () {
11     local url=$1 file=$cache/$(basename $1)
12     if test ! -f "$file"; then
13         mkdir -p ../cache
14         wget -O "$file" "$url" || exit 1
15     fi
16     echo "$file"
17 }
18
19 enter () {
20     local url=$1
21     cd "$base"
22     file=$(fetch "$url") || return 1
23     tar xf "$file" || return 1
24
25     dir=$(tar tf "$file" | head -1)
26     cd "$dir"
27 }
28
29 mingw_configure () {
30     test -x config.status || mingw-configure "$@"
31 }
32
33 (enter https://ftp.gnu.org/pub/gnu/gsl/gsl-1.16.tar.gz
34 mingw_configure
35 make -j128
36 make -j128 install)
37
38 (enter https://github.com/win-iconv/win-iconv/archive/v0.0.8.tar.gz
39 mingw-cmake -DBUILD_STATIC=1 .
40 make -j128 install)
41
42 (enter https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.tar.gz
43 cd gettext-runtime
44 mingw_configure
45 make -j128 install)
46
47 (enter ftp://xmlsoft.org/libxml2/libxml2-2.9.10.tar.gz
48 : fetch ftp://xmlsoft.org/libxml2/libxml2-2.9.10.tar.gz.asc
49 : gpg libxml2-2.9.10.tar.gz.asc
50 mingw_configure --without-python
51 make -j128 install)
52
53 (enter https://download.sourceforge.net/libpng/libpng-1.6.37.tar.xz
54 mingw_configure
55 make -j128 install)
56
57 (enter https://www.cairographics.org/releases/pixman-0.40.0.tar.gz
58 mingw_configure
59 make -j128 install)
60
61 (enter https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz
62 mingw_configure
63 make -j128 install)
64
65 (enter https://download.gnome.org/sources/glib/2.64/glib-2.64.5.tar.xz
66 mingw-mesonbuild)
67
68 (enter https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz
69  test -f autogen.sh || patch -p1 < $cache/bzip2-1.0.5-autoconfiscated.patch
70  grep -q fdopen bzlib.h || patch -p1 < $cache/bzip2-use-cdecl-calling-convention.patch
71  chmod +x autogen.sh
72  test -x configure || ./autogen.sh
73  mingw_configure
74  make -j128 install)
75
76 (enter https://download.savannah.gnu.org/releases/freetype/freetype-2.10.2.tar.xz
77  mingw_configure \
78            --enable-static \
79            --enable-shared \
80            --with-zlib=yes \
81            --with-bzip2=yes \
82            --with-png=yes \
83            --enable-freetype-config \
84            --with-harfbuzz=no
85  make -j128 install)
86
87 (enter https://www.cairographics.org/releases/cairo-1.16.0.tar.xz
88  if grep -q font-variations test/Makefile.sources; then
89      sed -i '/font-variations/d' test/Makefile.sources
90      NOCONFIGURE=: ./autogen.sh
91  fi
92 mingw_configure --enable-gobject
93 make -j128 install
94 sed -i.bak '/^Libs:/s/^\(.*\)$/\1 -lpixman-1 -lgdi32 -lssp/' ~/pspp/mingw/inst/lib/pkgconfig/cairo.pc)
95
96 (enter https://fontconfig.org/release/fontconfig-2.13.1.tar.bz2
97  grep -q ENABLE_TESTS configure.ac || patch -p1 < $cache/fontconfig_tests.patch
98  grep -q ENABLE_TESTS configure || autoreconf -ifv
99  mingw_configure --disable-docs --disable-tests --with-arch=x86_64 --enable-libxml2
100  make -j128 install)
101  
102 (enter https://github.com/harfbuzz/harfbuzz/releases/download/2.6.8/harfbuzz-2.6.8.tar.xz
103 mingw_configure --enable-shared --enable-static --enable-delay-load
104 make -j128 install LDFLAGS=-lpthread)
105
106 (enter https://ftp.gnome.org/pub/GNOME/sources/pango/1.46/pango-1.46.0.tar.xz
107 mingw-mesonbuild -Dintrospection=false -Dgtk_doc=false -Dc_link_args='-L/home/blp/pspp/mingw/inst/lib -fstack-protector -lssp -lpixman-1 -lpng -lz')
108
109 (enter https://github.com/GNOME/atk/archive/ATK_2_36_0.tar.gz
110 mingw-mesonbuild  --default-library=both -Dintrospection=false -Dgtk_doc=false)
111
112 (enter https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/archive/2.40.0/gdk-pixbuf-2.40.0.tar.gz
113 mingw-mesonbuild -Dgir=false -Drelocatable=true -Djasper=true -Dx11=false \
114                  -Dbuiltin_loaders=bmp,gif,ico,jpeg,tiff,png)
115
116 (enter https://github.com/anholt/libepoxy/releases/download/1.5.4/libepoxy-1.5.4.tar.xz
117 mingw-mesonbuild)
118
119 (enter https://download.gnome.org/sources/gtk+/3.24/gtk+-3.24.21.tar.xz
120 mingw_configure --disable-cups GLIB_COMPILE_RESOURCES=glib-compile-resources GLIB_COMPILE_SCHEMAS=glib-compile-schemas
121 make -j128 install)
122
123 (enter https://download.gnome.org/sources/gtksourceview/3.24/gtksourceview-3.24.11.tar.xz
124  mingw_configure --disable-static --disable-gtk-doc --disable-introspection
125  make -j128 install)
126 # Most recent step: add -L/usr/lib/gcc/x86_64-w64-mingw32/10-win32 to mingw-configure LDFLAGS
127
128 (enter https://download.gnome.org/sources/librsvg/2.50/librsvg-2.50.0.tar.xz
129  ln -s ~/pspp/mingw/inst/bin/gdk-pixbuf-query-loaders.exe gdk-pixbuf-query-loaders
130  PATH=$PWD:$PATH
131  RUST_TARGET=x86_64-pc-windows-gnu RUST_TARGET_SUBDIR=$RUST_TARGET/release mingw-configure --without-pic --enable-introspection=no
132  RUST_TARGET=x86_64-pc-windows-gnu RUST_TARGET_SUBDIR=$RUST_TARGET/release PKG_CONFIG_PATH=/home/blp/pspp/mingw/inst/lib/pkgconfig CARGO_TARGET_ARGS=--target=x86_64-pc-windows-gnu make -j128 -e V=1 LIBS='-luserenv'
133 )
134
135 (enter https://ftp.gnu.org/pub/gnu/termcap/termcap-1.3.1.tar.gz
136  autoconf
137  mingw_configure
138  make -j128
139  x86_64-w64-mingw32-gcc -shared -Wl,--out-implib,libtermcap.dll.a \
140                         -o libtermcap-0.dll termcap.o tparam.o version.o
141  make install prefix=/home/blp/pspp/mingw/inst exec_prefix=/home/blp/pspp/mingw/inst oldincludedir=
142  install -m755 libtermcap-0.dll /home/blp/pspp/mingw/inst/bin
143  install -m755 libtermcap.dll.a /home/blp/pspp/mingw/inst/lib/)
144
145 (enter https://ftp.gnu.org/pub/gnu/readline/readline-8.0.tar.gz
146  mingw_configure
147  make -j128 install)
148
149 (enter http://alpha.gnu.org/gnu/ssw/spread-sheet-widget-0.6.tar.gz
150  mingw_configure
151  make -j128 install)
152
153 (enter https://icon-theme.freedesktop.org/releases/hicolor-icon-theme-0.17.tar.xz
154  mingw_configure
155  make -j128 install)
156
157 (enter https://download.gnome.org/sources/adwaita-icon-theme/3.37/adwaita-icon-theme-3.37.92.tar.xz
158  mingw_configure
159  make -j128 install)
160