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>
Followup on e98d8931.
Set the BITS variable in Architecture.cmake even if
CMAKE_SYSTEM_PROCESSOR is not set, and it often isn't. This allows for
generating the right release zip for 32 bit MinGW builds.
When invoking zip to make the translations.zip, use `.` instead of `*`
as the argument, with the correct WORKING_DIRECTORY, so as not to rely
on shell globbing of any sort. This broke for the 32 bit MinGW cross
build.
Fix the keychain unlock command on mac, the keychain must be unlocked to
use the codesigning certificate.
Fix the translations.zip.asc signature overwrite prompt on Windows.
For the mac builder, automatically use Xcode 9 for 32 bit builds if
installed, this is necessary on 10.14 (Mojave) and later.
Add interactive-pause.cmake script to wait for the user to press enter
before continuing, invoke it before gpg commands so that waiting for the
passphrase does not time out. It will not run if ENV{CI} is set or
ENV{VBAM_NO_PAUSE} is set, this is so that later we can set up automated
builds.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
Although this is a C++ option, some dists like ninja use CFLAGS instead
of CXXFLAGS for C++ code, and this becomes even more problematic with
XCode 10 which removes libstdc++ entirely.
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.
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.
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.
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.
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.
Do not defer evaluating $BUILD_ENV in the msys2 host/target environment
overrides, as that causes the subsequent eval to try to run the variable
as a command.
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
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.
- 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.