aboutsummaryrefslogtreecommitdiffhomepage
path: root/.fmsbw/10-freebsd14-msys-sciteco
blob: f27dfa95407570ac221015e1d5e918c5b8274164 (plain)
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
#!/usr/local/bin/bash
set -ex
export ASSUME_ALWAYS_YES=yes

# Already in freebsd14-sciteco
# TODO: Build this with buildah.
# Start with --network=host
#pkg update
#pkg install FreeBSD-clang FreeBSD-clibs-dev \
#            gmake pkgconf autoconf automake libtool \
#            glib gtk3 groff lowdown valgrind
#
#pkg install llvm20 gnugrep gmake coreutils gsed git wget gnupg bash groff zip autoconf automake libtool
#git clone https://github.com/HolyBlackCat/quasi-msys2.git /opt/quasi-msys2
#cd /opt/quasi-msys2
#ln -s /usr/local/bin/gpgv2 /usr/local/bin/gpgv
#ln -s /usr/local/bin/bash /bin/bash
# ln -s /usr/local/bin/clang20 gnu-overrides/clang
# ln -s /usr/local/bin/clang++20 gnu-overrides/clang++
# ln -s /usr/local/bin/llvm-windres20 gnu-overrides/llvm-windres
# ln -s /usr/local/bin/ggrep gnu-overrides/grep
# ln -s /usr/local/bin/gmake gnu-overrides/make
# ln -s /usr/local/bin/gsed gnu-overrides/sed
# ln -s /usr/local/bin/greadlink gnu-overrides/readlink
# ln -s /usr/local/bin/wine64 gnu-overrides/wine
#echo MINGW64 >msystem.txt
# cat >activate << EOF
#cd /opt/quasi-msys2
#export PATH=`pwd`/gnu-overrides:$PATH
#set +ex
#. env/all.src
#set -ex
#EOF
#gmake install _autotools _gcc _glib2 _pdcurses _gtk3 _librsvg
#ln -nfs "/opt/quasi-msys2/root/mingw64" /mingw64
#pkg clean -a

autoreconf -i
mkdir build-freebsd
cd build-freebsd
../configure --with-interface=ncurses --enable-debug --enable-html-docs
gmake

# NOTE: The test suite must be run in verbose mode because if it fails
# we won't be able to analyze testsuite.log.
gmake check TESTSUITEFLAGS="--verbose --color=never --valgrind"
# Includes a second test suite run, but without Valgrind.
# This is good since we had to exclude several test cases when running
# under CI with --valgrind.
gmake distcheck

gmake install

# Build and deploy website
cd ../www
sciteco -m build.tes ../build-freebsd
cp *.html /opt/htdocs/
cd ..
cp ico/sciteco.ico /opt/htdocs/graphics
cp ico/sciteco-48.png /opt/htdocs/graphics

# TODO: Should we also distribute FreeBSD binaries?

# FIXME: This should be a separate job but currently we need the
# boostrapping with the FreeBSD version of SciTECO.
# We can run with bootstrapping using --with-wine=wine64,
# but it doesn't even generate all files correctly.
# The test suite also doesn't fully work under Wine yet.
# Activate MSYS environment
. /opt/quasi-msys2/activate
cd /opt/build

export CURSES_CFLAGS=-I/mingw64/include/pdcurses/
# FIXME: glib on MinGW supports static linking but the gspawn
# helper binaries are still linked dynamically, forcing us to ship
# all DLLs anyway. Therefore it makes little sense to link SciTECO
# itself statically - it only wastes a few MB.
# You will also have to add --enable-static-executables.
# The additional Windows libraries are for PDCursesMod/WinGUI:
# LIBGLIB_LIBS: -lglib-2.0 -lintl -liconv -lpcre -lole32 -lws2_32 -luuid
# FIXME: Once there is an --enable-lto, we should use that.
#CFLAGS: -O3 -flto -DGLIB_STATIC_COMPILATION
#export CFLAGS="-O3 -flto"
#export CXXFLAGS="-O3 -flto"
#export LDFLAGS="-flto"
export CFLAGS="-O3"
export CXXFLAGS="-O3"

# We cannot run Windows binaries automatically through Wine,
# so we must still force cross-compilation with --host.
# Still make sure we don't pick up the MinGW pkg-config
export PKG_CONFIG=pkg-config

#autoreconf -i
mkdir build-wingui build-wincon
cd build-wingui
../configure --host=x86_64-w64-mingw32 \
             --with-interface=pdcurses-gui --enable-html-docs --program-prefix=g \
             --with-scitecodatadir=. \
             --disable-bootstrap \
             CURSES_LIBS="-lpdcurses_wingui -lgdi32 -lcomdlg32 -lwinmm"
make
make install-strip
#make check TESTSUITEFLAGS="--verbose --color=never"

cd ../build-wincon
../configure --host=x86_64-w64-mingw32 \
             --with-interface=pdcurses --enable-html-docs \
             --with-scitecodatadir=. \
             --disable-bootstrap \
             CURSES_LIBS="-lpdcurses_wincon -lgdi32 -lwinmm"
make
make install-strip
#make check TESTSUITEFLAGS="--verbose --color=never"

cd ..
mkdir temp-bin/
cd temp-bin/
cp -r /mingw64/bin/{gsciteco.exe,sciteco.exe,grosciteco.tes,tedoc.tes} ./
# datadir is relative to bindir
cp -r /mingw64/bin/{lib,*.tmac} ./
cp /mingw64/bin/fallback.teco_ini .teco_ini
cp -r /mingw64/share/doc/sciteco/* ./
cp ../COPYING ../ChangeLog ./
cp /mingw64/bin/gspawn-win64-helper*.exe ./
# Collect DLLs for all included binaries
for f in *.exe; do python3.11 ../contrib/mingw-bundledlls --copy $f; done
zip -9 -r ../sciteco-pdcurses_nightly_win64.zip .
cd ..

mkdir -p /opt/htdocs/downloads/ci/
cp sciteco-pdcurses_nightly_win64.zip /opt/htdocs/downloads/ci/

# TODO: Windows Gtk builds