Commit Graph

72 Commits

Author SHA1 Message Date
Rafael Kitover 3d83590774
Remove 32 bit mac binary, builder updates.
We are not going to release 32 bit mac builds anymore, because any mac
sold after 2007 will run a 64 bit binary. And since we are building for
10.7, which requires a 64 bit mac, and will run 64 bit binaries even on
a 32 bit kernel, the 32 bit binary was always pointless.

More on this here:

https://apple.stackexchange.com/questions/99640/how-old-are-macs-that-cannot-run-64-bit-applications/99644#99644

https://apple.stackexchange.com/a/261793/206363

Remove references to 32 bit mac binary from the dev manual.

Builder updates:

- Bump cmake 3.13.0-rc1 -> 3.17.3. This is needed for the new
  FetchContent feature in cmake, which we use for Sparkle (online
  updates for mac.)

- Bump sfml to newer master commit.

- Add pre-build hook for libvpx on mac to set
  -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET in CFLAGS.

- Force C locale in all builder scripts, homebrew bash was erroring due
  to some kind of locale bug with a non-English locale.

- Remove .app in build_project() before building, rebuilds were failing
  due to reinstallation of frameworks (Sparkle.)

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-06-07 12:38:48 +00:00
Rafael Kitover d6cc14ef10
builder: URL updates.
Update openssl version, getopt URL and roll nasm back to stable, because
the snapshot hangs on Catalina.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-04-04 15:17:05 -07:00
Rafael Kitover bb23357d47
builder: disable libwebp in libtiff.
Fixes mac build.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-02 08:13:13 -08:00
Rafael Kitover 213f47ec96
builder: minor fixes for mingw.
Search the lib-prefixed names of intl/iconv/charset libraries first to
avoid dlls being linked.

Update toolchain files to include the common source by full path, fixes
using them as toolchains for other projects broken in 3edd9ba7.

Update URL for nasm, use newer jpeg-turbo, tiff and wx.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-02 03:35:26 +00:00
Rafael Kitover 3ca67b9d5d
builder: disable openal for 32 bit mingw.
XP users may not have openal, and it's not an important feature.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2020-02-02 03:32:24 +00:00
Rafael Kitover e98d89310e
cmake: Add some release automation steps.
Use ENV{MSYSTEM_PREFIX} instead of ENV{MSYSTEM} to check for msys2 as
that is more reliable.

Generate the translations.zip when building for Windows from the
generated .gmo files.

Add the UPSTREAM_RELEASE option to perform some additional release
automation steps:

- Codesign for Windows with either the Visual Studio signtool or
  osslsigncode when using MinGW.

- On Windows zip up the .exe into the appropriate zip file for release.

- Generate the gpg signature .asc files for the translations zip and the
  .exe zip on Windows.

- On Mac codesign the app, zip it and sign the zip.

- On all platforms try to strip the binary.

Remove the release automation steps from the builder script as they are
now in cmake.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-24 06:32:01 +00:00
Rafael Kitover 17d2fbc5cc
builder: mingw 32 bit updates.
Fix cross building glib with meson for 32 bit Windows, set cpu_family
correctly in the cross file.

Do not build ffmpeg for 32 bit Windows because it is not compatible with
Windows XP and it's better to have a smaller 32 bit binary.

Turn off LTO for 32 bit Windows because it is now broken too, in a
different way than for 64 bit Windows.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-19 02:57:03 +00:00
Rafael Kitover d183245bdd
builder: Link setupapi always, update libpng.
On Windows always link setupapi with SDL2, the find_library() call with
SetupAPI was failing on mingw because of case.

Update libpng 1.6.32 -> 1.6.37.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-08 15:28:03 +00:00
Rafael Kitover d395e05d97
builder: Limit ninja jobs on Windows.
On Windows (msys2) ninja may fail to work with -j 64 because it runs out
of open handles.

Limit jobs for ninja to 32 on Windows.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-05 14:09:45 +00:00
Rafael Kitover b917933013
builder: Fix mingw cross build.
Add meson to core deps because glib requires it to build, and python is
much further in the dependency chain to build meson early enough.

Override the meson command to write and use a cross file for mingw cross
builds.

Add -DFFI_STATIC_BUILD to CPPFLAGS for glib.

Fix --env for the linux mingw cross script.

Add dist make args to the make install invocation.

Add --extra-libs=-liconv to ffmpeg ./configure invocation.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-12-01 22:07:41 +00:00
Rafael Kitover d458e75ca6
builder: mingw/msys2 updates.
- Update to new version of icu and patches.

- Update to newer meson based glib.

- Support meson-installed dists.

- On msys2 use the distro ninja to build ninja, because there is some
  kind of issue with building on windows now.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-11-26 14:31:20 +00:00
Rafael Kitover c93e017d3a
builder: minor changes to support mac 32 bit
Pass `CC="$CC $CFLAGS"` to `make` for `libgsm`, so that the `-m32` is
passed for 32 bit builds.

For `mac_install_core_deps()` make sure brew is installed and install
brew perl, otherwise perl extensions cannot be built on Mojave for 32
bit.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-28 14:29:40 -07:00
Rafael Kitover c1636d1bcf
builder: fixes for ffmpeg + misc.
Use git master for `graphite2` and a better cmake patch, with these
`DIST_ARGS`:

```
-DGRAPHITE2_NFILEFACE=ON -DGRAPHITE2_TESTS=OFF -DGRAPHITE2_DOCS=OFF
```

Use `DIST_CONFIGURE_OVERRIDES` instead of `DIST_ARGS` for `libvpx` and
`ffmpeg` because their configure scripts error on the `--sysconfdir`
arg.

Change all other references to `libvpx` and `ffmpeg` `DIST_ARGS` to use
`DIST_CONFIGURE_OVERRIDES` instead.

Add `-j1` to `xvidcore` `MAKE_ARGS` because it sometimes fails parallel
builds.

Change the `mkdir` commands to `mkdir -p` in `mingw.sh` because
`core.sh` now also makes those directories.

In `mingw.sh` for `libvpx` extra `CFLAGS`, add `-mstackrealign` for 32
bit builds and `-fno-asynchronous-unwind-tables` for 64 bit builds. The
latter is necessary to build, taken from the msys2 `libvpx` mingw
package.

Also add the `stdint.h` `-include` option to `CFLAGS` for libtheora and
ffmpeg because they use the `libogg` headers.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-28 19:07:44 +00:00
ZachBacon aec23e3586 builder: re-enable ffmpeg, update dists
Update the following dists:

bzip2, xz, libiconv, gettext, ninja, meson, libgcrypt, libsecret, sdl2,
flac, libogg, libvorbis, wxwidgets

and the following ffmpeg deps:

graphite2, xvidcore, libgsm, opus, libsoxr, libass, libbluray, libvpx,
libx264, libx265

Enable ffmpeg for vbam again as we now have working recording code
thanks to @denisfa.

Disable graphviz and libzvbi for the time being since we don't really
need them.

For mp3lame use the msys2 patch to remove posix code instead of linking
to catgets.

For libogg and libvorbis on mac, add `-include /path/to/stdint.h` to
`CFLAGS` when building.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-28 01:10:04 -07:00
Rafael Kitover 1e9d167597
builder: pause before codesigning for win targets
Pause before `pass` asks for the `gpg` passphrase to retrieve the
password to unlock the windows codesigning certificate.

This is so that the user does not have `gpg` time out waiting for the
passphrase.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-14 21:46:01 +00:00
Rafael Kitover 0af5965ee1
builder: work on linux static binary
Merging some work I was doing on trying to make a working mostly static
linux binary a year ago, with some additional minor refactoring.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-12 16:42:43 +00:00
Rafael Kitover 2a2be95397
builder: msys2 fixes
For cmake, the dependency on `bin2c` when using `HostCompile.cmake` does
not work if it's set to `bin2c.exe`, for whatever reason, so remove the
suffix.

Add `-DCURL_STATICLIB` to `CPPFLAGS` etc. to link to `libcurl`
correctly, needed for `osslsigncode`.

Add `--without-brotli` to curl configure args, because it can try to
link to some existing version and fail.

Add a `gmake` symlink to the system `make` into the `PATH` because some
things like Strawberry Perl install their own copy of `gmake` into the
`PATH`.

Add `pass` to list of msys2 deps, needed to store the windows
codesigning cert password.

Use `$CMAKE_ARGS` instead of `$CMAKE_BASE_ARGS` for building vbam,
adding `-DCMAKE_INSTALL_PREFIX=/usr`, this is necessary for extracting
the locales correctly.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-09-03 00:14:37 +00:00
Rafael Kitover f5eabb3514
builder: disable LTO on 64 bit mingw
LTO on 64 bit mingw still produces segfaulting binaries.

Turn off LTO for just that platform and leave it enabled for all other
platforms.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-19 17:23:45 -04:00
Rafael Kitover 2958af01ca
builder: mingw improvements + misc.
- default ENABLE_NLS to ON except for vcpkg, broken in e2f06210

- update zlib URL

- use openssl 1.1.1c instead of 1.0.2p, parallel build works now!

- add osslsigncode for mingw to codesign windows binaries, and
  automatically sign in `build_project()`

- add curl (for osslsigncode, which needs libcurl)

- use current master for wxwidgets instead of 3.1.2

- make the `translations.zip` in `build_project()` for windows

- on mac, unlock the login keychain before codesigning (this is
necessary if using e.g. ssh.)

- do not fail if the user does not have codesigning or gpg keys

- fix wxwidgets configure options on mac (need to append to
  `DIST_CONFIGURE_OVERRIDES` instead of `DIST_ARGS`.)

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-08-19 13:15:01 -07:00
Rafael Kitover f09a9aa99a
builder: add python3 to msys2 deps
For ninja.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-20 18:35:23 +00:00
Rafael Kitover ce11403b4e
builder: updates for mingw
Bump libgpg-error 1.27 -> 1.36 and add a patch to support gawk 5.0 from
gentoo.

Add meson to list of msys2 OS deps, this is not needed right now.

Remove glib `CreateFile` patch which has been removed from msys2
MINGW-packages master and add a couple of other patches.

Unfortunately using a newer glib release is not yet possible because of
weird linking errors with meson on mingw.

Add ninja to `host_dists` for `mingw.sh`, this is not needed currently.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-17 15:28:36 +00:00
Rafael Kitover fa45ccdfcd
builder: fix command(), update c2man url
Rewrite the `/bin/sh -c command` construct in `command()` correctly.

Update c2man url to the github mirror because it's dead.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-16 11:29:04 +00:00
Rafael Kitover e64b990415
builder: fix msys2
msys2 does not `/bin/command` or `/usr/bin/command`, check for these and
fall back to `/bin/sh -c "command $*"`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-16 00:48:18 +00:00
Rafael Kitover 5802207829
builder: make zip + sig on win + minor changes
Pass command-line arguments to `build_project()` for use in the cmake
command.

Make `$PROJECT_ARGS` override `$CMAKE_BASE_ARGS` for the project.

Override `command()` to call `/bin/command` to avoid the bash builtin
which has undesirable behavior when overriding commands.

Override `gpg` to invoke either the `gpg` or the `gpg2` binary,
whichever is available, or print a warning that gpg is not available.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-07-11 20:18:21 -04:00
Rafael Kitover 57ed465ebb
builder: better mac automation
Make the right zip release filename and gpg signature when done
building for mac.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-27 15:45:03 -07:00
Rafael Kitover ffc9309253
builder: freetype 2.9.1 -> 2.10.0, verbose make
make project with `VERBOSE=1`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-16 13:05:43 +00:00
Rafael Kitover d08dd6cd18
builder: opensuse update 2
Install python3 in cross deps and call glib configure with the path to
it.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-16 00:08:45 +00:00
Rafael Kitover 9b38a38428
builder: updates for opensuse, refactor cross deps
Move linux distribution detection into `detect_os()` in the core.

The appropriate routine is then called with eval.

Move linux deps installation (for fedora previously) from
`linux-cross-builder` to `mingw-cross.sh` using the `linux_distribution`
variable set by `detect_os()`.

Add a routine to install suse cross dependencies as well.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-04-15 23:38:26 +00:00
ZachBacon 3eb591cac5 Update wxwidgets to 3.1.2 2019-01-21 15:27:03 -05:00
ZachBacon 8628db1359 Revert faudio inclusion, causing builder to fail because I didn't properly hook up the build instructions, will try and fix later 2019-01-10 16:34:58 -05:00
ZachBacon a7773bc96f Bump FAudio to 19.01 2019-01-02 18:00:51 -05:00
ZachBacon 969046ea83 Add faudio to the build script 2018-12-26 06:21:25 -05:00
Rafael Kitover 3cb38420bd builder: add patch for glibc 2.28 compat to m4
glibc 2.28 breaks the gnulib shipped with m4, this patch from gentoo
makes it compile.
2018-12-06 14:28:46 -08:00
Rafael Kitover 61b3084e4a builder: set host cc for libgpg-error to gcc
Set the var CC_FOR_BUILD=gcc in the core build environment. This is used
by libgpg-error to make host build tools when cross compiling, may be
used by other things as well.
2018-12-06 14:27:17 -08:00
Rafael Kitover 3b185e235e builder: libvorbis fix
libvorbis autogen.sh calls the version-suffixed autoconf/automake
scripts, which ends up calling the wrong scripts, so remove the
autogen.sh and reconfigure manually.
2018-12-05 01:59:51 -08:00
Rafael Kitover c68f372e5a fix wrong copy-pasta in 36e412df
Set the CPPFLAGS/CFLAGS/CXXFLAGS/OBJCXXFLAGS variables correctly in
build_dist(), were set incorrectly in 36e412df.
2018-12-03 16:24:42 -08:00
Rafael Kitover 36e412df53 builder: mingw: fix libffi for i686 + improvemnts
Add the tables DIST_EXTRA_{CPPFLAGS,CFLAGS,CXXFLAGS,OBJCXXFLAGS} for
adjustments during builds.

Add -DSYMBOL_UNDERSCORE to DIST_EXTRA_CPPFLAGS for libffi on mingw when
the target is i686, see:

https://bugzilla.mozilla.org/show_bug.cgi?id=1336569

Also set target_bits and target_cpu appropriately in the msys2 script.
2018-12-03 00:37:04 -08:00
Rafael Kitover 5b0f2e8aa6 builder: msys2: fix links to host binaries
Factor out non-environment code from host_env()/target_env() into
host_env_base()/target_env_base(). Such as that for creating symlinks to
root, link host binaries to the target root, as well as calling the
hook.

Call the _base() functions from the msys2 overrides so that symlinks are
created properly, remove redundant symlink code.
2018-12-02 20:35:29 -08:00
Rafael Kitover db8aaeca87 builder: mingw: build zlib-target after cmake
Since mingw zlib is built with cmake, move the dist to after cmake in
the build order.
2018-11-27 06:18:46 -08:00
Rafael Kitover beaf934082 builder: bump libxslt 1.1.33-rc1 -> 1.1.33-rc2 2018-11-27 04:51:53 -08:00
Rafael Kitover afbe647aed builder: catgets fix for msys2 + minor changes
Change `ln -s` to `cp` in the catgets makefile in the applied patch,
this is used for making symlinks to some header files, this will
hopefully fix building catgets for @ZachBacon on msys2. There seems to
be a problem with the mingw gcc reading headers that are symlinks, even
if they are real windows symlinks.

Also slightly refactor checking for target built files. Add the `-f`
flag for `install_artifact([-f] $dist)` for the full path to the target
file, and add the helper functions `check_install_artifact($dist)` and
`check_install_artifact_relative($dist $root_path)`.

These helper functions also display error messages if the target file
does not exist, as opposed to the previous behavior where it would just
silently exit nonzero.
2018-11-23 09:48:48 -08:00
Rafael Kitover a6034ddfa2 builder: disable building openssl tests
Remove the build_tests dependency from build_all in the openssl makefile
due to a possible build issue on msys2.
2018-11-18 09:03:24 -08:00
Rafael Kitover 9ebc3fc28c builder: build mingw dlfcn after cmake
dlfcn requires cmake to build.
2018-11-16 02:19:05 -08:00
Rafael Kitover b9911a5759 builder: fix regressions from 37869441..a3ec309b
Refactor the build environment evaluation, make build variables set
immediately so that they don't grow longer on re-evaluations and defer
all other variables. Export as many build related variables as possible.

Make one more crucial fix for cross builds: run the post_build after
LDFLAGS and LIBS are restored, so that this does not interfere with
setting and restoring the build environment for host builds.

Other changes:

- fontconfig 2.13.0 -> 2.13.1

- openal     1.19.0 -> 1.19.1

- set fontconfig configure type to autoreconf, disable tests

- disable the openssl parallel build patch, it fails unpredictably,
  always build openssl with -j1

- configure libicu with --disable-tests and a few other things disabled,
  the tests cause link issues on mingw i686

- also make a minor fix to libicu makefiles for mingw (replace echo -n
  with printf)

- move $BUILD_ENV evaluation to the builder() main function to defer
  some variable initializations

- add patch for openal to mingw-cross to use gcc instead of cmake to
  build some native tools it uses, cmake causes issues with cross builds

- in host_env()/target_env() defer variable expansion and include a copy
  of $BUILD_ENV in the appropriate sequence
2018-11-15 01:54:19 -08:00
Rafael Kitover a3ec309bd6 builder: more minor mingw cross fixes
Do not defer evaluating build env variables in mingw-cross.sh, this
interferes with switching them between host/target.

In build_dist() adjust the LDFLAGS and LIBS after pre_build has run,
because host/target env setting happens in pre_build and adjustments get
lost.
2018-11-12 09:48:35 -08:00
Rafael Kitover d725978abf builder: fix openssl parallel make patch
Fix sed regex for the openssl POST_CONFIGURE to work with the mac/BSD
sed (anchor to beginning of line.)
2018-11-12 05:40:24 -08:00
Rafael Kitover cf3ed8f370 builder: fix quoting issues introduced in 37869441
In host_env/target_env/etc. functions, quote all variables values so
that they pass through eval correctly.
2018-11-12 04:47:59 -08:00
Rafael Kitover 37869441d2 builder: msys2 fixes + misc improvements
- Fix leading spaces in build env vars.

- Pass -Dcc="$CC" to the c2man metaconfig, it tries to use cc on msys2
  which fails.

- Pass LDFLAGS to openssl make to fix link errors.

- Change the host_env, target_env and related functions to output a list
  of commands for eval.

- Add a --host-env flag to output the host env for cross build
  environments.

- Ignore symlink failures when installing dists, symlinks fail on msys2
  sometimes for some reason.

- Put libicu in the list of both host and target dists only in
  mingw-cross, the host libicu does not build on msys2, and everything
  works fine without it.

- Add -j1 to openssl make args to disable parallel builds for the msys2
  and cygwin host builds, because they fail otherwise.

- Add "-ldl -lcatgets -lws2_32" to libicu LDFLAGS for the target build,
  ws2_32 may be necessary for 32 bit builds.
2018-11-12 04:07:48 -08:00
Rafael Kitover 1bf51ec1fa builder: 32 bit mingw fixes
Add -lm (the math library) to CFLAGS/CXXFLAGS/OBJCXXFLAGS/LDFLAGS and
LIBS for the cases where it is used but not explicitly linked.

Improve the sed script to override building the openal native tools as
it was failing for mingw 32 bit. Add -lm and remove flags from the
environment.
2018-10-14 21:34:00 -07:00
Rafael Kitover ed8c928adb builder: support gentoo crossdev + misc fixes
Support the gentoo crossdev mingw environment for the mingw cross
builder:

- For the cmake toolchains, add /usr/<arch>/usr to root paths, as this
  is the mingw root for crossdev.

- -Wno-error=all no longer works with gcc 8.2, instead remove all
  -Werror flags in dist_post_configure().

- Also remove all -I/usr/include flags in dist_post_configure().

- Don't prepend ROOT/host/bin to the PATH globally, only in
  set_host_env(). This way the target config scripts are correctly found
  in PATH.

- Bump openssl 1.0.2o -> 1.0.2p, cmake 3.10.3 -> 3.13.0-rc1, gd 2.2.4 ->
  2.2.5 and glib 2.57.2 -> 2.58.1.

- Add libicu unicode handling library, needed by some deps. Put into the
  list of dists that must be built for both the host and the target. Use
  a whole bunch of patches from MSys2 for it.

- Make openssl build in parallel by using a sed script to prepend a + to
  the appropriate make rules.

- Replace fontconfig EXTRA_LIBS with MAKE_ARGS: LIBS="-lintl -liconv"
  because these libs were being stripped out from LIBS and LDFLAGS.

- Add V=1 VERBOSE=1 to all make invocations for extra verbosity (to see
  compile/link invocations.)

- As a consequence, use dist_ninja_args() for ninja, it will still take
  options in DIST_MAKE_ARGS.

- Add CONFIGURE_TYPE "cmakeninja" which is like the "cmake" type except
  with -G Ninja to use the ninja generator and built with ninja. Nothing
  uses this yet.

- Fix dist_patch() output for already applied patches.

- Add -L/usr/<arch>/usr/lib64 to CFLAGS/CXXFLAGS/OBJCXXFLAGS/LDFLAGS,
  because crossdev libpthreads.a is in that directory and it's not in
  gcc search paths. It cannot go into CPPFLAGS because those are used
  for windres invocations, and windres errors out with non-cpp flags.

- Add -DMINGW_HAS_SECURE_API to all flags to fix a problem with the
  mingw headers in crossdev.

- Add -lpthread to a default LIBS env var so that it's often linked last
  against any libraries that may need it, at least for autoconf.

- Set the PKG_CONFIG env var to the path of the built pkg-config binary,
  not exactly sure why this was necessary.

- Overhaul environment variable saving/restoring for set_host_env() so
  that more variables are covered and have good host defaults.

- Add the dlfcn-win32 for mingw for dependencies that need -ldl.

- Add some MSys2 patches for fontconfig.

- Use a sed script to fix the native tools compilation when cross
  compiling openal.

- Replace the fedora glib patches for mingw with MSys2 ones for the
  newer glib.

- Add --with-threads=posix --disable-libelf to glib DIST_ARGS.
2018-10-11 06:55:53 -07:00