Commit Graph

14 Commits

Author SHA1 Message Date
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 286d7ee93a builder: fix 32bit mac build
Compile libicu not in cross mode for 32 bit.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2019-02-25 03:07:08 -08:00
Rafael Kitover d94d6d5363 osx builder: add -stdlib=libc++ to CFLAGS/LDFLAGS
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.
2019-01-22 18:50:33 -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 dcd7d5e092 support 32/64 bit mac builds, build improvements
Support building both 32 bit and 64 bit mac binaries, by passing the -32
or -64 flag just like for mingw.

Install libuuid on mac into a private path, because its uuid.h conflicts
with mac APIs when e.g. building python2.

Other improvements:

- add ccache to dists early on to not rely on the dist ccache

- update python2 version

- set python3 version to 3.6.5 until patches are updated

- TODO: rebase python3 patches

- configure cmake with --enable-ccache always

- TODO: remove all ccache optional stuff, make it required

- run cpanm through perl, because of possible issues with the script and
  various paths

- support an install prefix other than /usr via DIST_PREFIX
2018-09-04 08:29:24 -07:00
Rafael Kitover f937aa72f5 builder: disable ccache for openssl
ccache can apparently cause issues when building openssl, as I've
noticed on Mac OS 10.13, save the original values of $CC and $CXX and
pass them to make when building openssl.
2018-06-30 15:48:58 -07:00
Rafael Kitover 498019a39b support older 32 bit macs running 10.7, fix build
Make mac builder use -m32 in CFLAGS etc. to produce a 32 bit binary
targetting 10.7 (Lion.) This provides the greatest backward
compatibility for older macs, and also allows for asm filters.

Fix an issue with m4 on 10.13 using a patch from macports.

Support `-pX` patch level args in DIST_PATCHES in builder.

Fix an issue with bison on 10.13 by bumping the version to 3.0.5.

Build libxslt `--without-crypto` so that it doesn't try to link the brew
libgcrypt.

Invoke cmake for dists with -DCMAKE_C_COMPILER_LAUNCHER=ccache and
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache to use ccache, and set
CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to the actual compilers not
prefixed by ccache.

When checking for ccache in vbam cmake code, check that
CMAKE_CXX_COMPILER_LAUNCHER and CMAKE_C_COMPILER_LAUNCHER were not
already defined (generally on the command line.)

Remove align attributes from sections in 2xSaImmx.asm, macho format on
mac does not support this and the filter works fine without them.

In the Quartz2D renderer, pass the NSRect view.bounds through
NSRectToCGRect when calling CGContextDrawImage(), this is necessary for
the 32 bit API.

Bump openssl to 1.0.2o.

Bump libxml2 to 2.9.8.

Update URL for urw fonts, and improve the dist downloading/unpacking
code to handle URLs that do not contain the filename (for .tar.gz and
.zip as identified by `file`.)

Change post-build for harfbuzz from `rebuild_dist freetype;` to
`rebuild_dist freetype --with-harfbuzz=yes;` as it was supposed to have
been.

Build cmake itself with --parallel and --enable-ccache.

Silence errors from killed jobs due to tmp directory being gone.

Write a couple of string functions, rtrim() and gsub().

Make path_exists() handle globs with spaces in them, by escaping the
space.

Use --host and --build args to autoconf configure to "cross-compile" for
32 bits, this is necessary for some dists, and does not work for others,
remove it for dists where it does not work.

Add COMMAND_MODE=unix2003 to the build environment, this is necessary to
fix some build errors, why I have no clue, found it on stackoverflow.

Pass -Wl,-no_compact_unwind in LDFLAGS to openssl, this is necessary for
32 bits.

Force sfml to compile as 32 bit, it normally does not allow this.

Remove shared-mime-info from this build, it's not necessary for anything
and there are issues XML::Parser linked to our expat and brew perl that
need to be resolved.
2018-06-30 03:40:47 -07:00
Rafael Kitover 430b5d638d fix Mac OS 10.13 build issues
Compile out the min/max functions in GBALink.cpp when compiling with
clang, clang does not like them because of some sort of changes in the
preprocessor.

Run the mac builder script with homebrew bash, system bash does not work
and dash no longer works.

TODO: fix dash compat
2018-06-17 16:01:40 -07:00
Rafael Kitover 66980934b2 add multi-platform build system
under `tools/` add some scripts to invoke the build system to build all
deps for vbam and vbam itself:

- `tools/linux/builder`

This builds a mostly static linux binary with a few dynamic deps for
xorg and wayland. Using gtk3. This will run on just about any dist.

- `tools/osx/builder`

Builds a static mac app targetting 10.7.

- `tools/win/linux-cross-builder`

Builds a static windows binary using the mingw-w64 toolchain.

- `tools/win/msys2-builder`

Builds a static windows binary in the MSYS2 environment, this may be
suffering from a few regressions.

Change some cmake code to support the build system, refactor a few
things in it.
2018-02-24 14:39:29 -05:00
Rafael Kitover 420450255c mac build/builder improvements
Improve, refactor and clean up `tools/osx/builder` to build a relatively
full-featured ffmpeg as well. This requires lots of other dists. It's
kind of like a mini port system now. Will generalize it shortly to a
sourced library for using with both the mac and the mingw builds. Will
hopefully become a separate repo on github at some point.

Add perl dist support to the builder.

Add an `--env` flag to the builder to print the build environment
variables so that they can be read in with `eval` for debugging
purposes.

Also add the `FFMPEG_STATIC` cmake option to link static ffmpeg
libraries correctly.

Move the codesigning and zipping of the `.app` bundle to the builder
script and out of cmake, as this is something most users don't need.
2017-10-22 15:35:56 -07:00
Rafael Kitover afb1cd3dfc automate codesign/zip for mac build, add xz dep
Add POST_BUILD commands on Mac to codesign the `.app` and make a zip
file from it.

Also add xz/liblzma dist to `tools/osx/builder` because something
apparently wants liblzma.
2017-10-12 14:56:21 -07:00
Rafael Kitover 5e633984b8 mac builder refactor/improvements
Refactor the code in `tools/osx/builder` somewhat and make it cleaner.

Move a few table processing loops into functions to make things less
ugly.

Delete dists not listed in the table (e.g. when they are updated) and
when a dist is re-downloaded, delete the tree and the target file to
force a rebuild.

Use number version for gettext instead of `-latest`.

Specify full dist target, e.g. `lib/libfoo.a` instead of just
`libfoo.a`.
2017-10-12 14:31:23 -07:00
Rafael Kitover d7ff2afb80 add mac release builder script
Add `tools/osx/builder`, a POSIX sh script to build all dependant
libraries as static, targetted to OS X 10.7, and build the project with
them (also targetted to OS X 10.7.)

ffmpeg currently does not link, as recording functionality is currently
non-functional anyway, this will be fixed later.

MISC:

- set WORKING_DIRECTORY and ERROR_QUIET for all git commands, for the
  cases when the build directory is not under the git checkout

- #include <cerrno> in ConfigManager.cpp as it uses errno

- change `build*` in `.gitignore` to `build/*` so that files starting
  with "build" are not affected
2017-10-12 01:32:18 -07:00
Rafael Kitover 4d12fcda10 fix Mac linker script for @rpath libs (like SFML)
Homebrew SFML links itself with @rpath/ instead of the dylib path,
update the mac linking and bundling script to handle that case, also
move it from src/wx/tools/osx to tools/osx now that wx is the primary
port.

This fix is temporary and I will write a better one that takes
DYLD_LIBRARY_PATH and such into account, but will suffice for linking
Homebrew libs for now. The script needs more work in general.
2017-02-24 12:24:20 -08:00