Commit Graph

36 Commits

Author SHA1 Message Date
Rafael Kitover fde9d731a8 installdeps: add ccache to list of deps
Add ccache to list of deps for all platforms.
2018-06-27 02:06:28 +00:00
Rafael Kitover 77a3673d04 installdeps: install wx-common for mxe for wxrc
When cross building for win32, native wxrc is needed to generate xrc
files, add wx-common to mxe dependencies which provides it.
2018-06-27 01:58:33 +00:00
Rafael Kitover 90188e8875 installdeps: fix build instructions for mxe
Change cmake executable prefix from `x86-64` to the correct `x86_64` for
the 64 bit architecture.
2018-06-27 01:49:26 +00:00
Rafael Kitover 816aab9939 fix installdeps for ubuntu:trusty
Add some dependencies for the linux build that apt errors out on,
hopefully this won't affect newer ubuntu or debian.

Do an apt-get update before trying to install mxe dependencies for win32
cross builds, or the packages cannot be found.
2018-06-27 01:38:43 +00:00
Rafael Kitover 2efcb620bd support and default to wxgtk3 not gtk2 on arch
Change installdeps to install wxgtk3 on arch instead of the wxgtk
package which uses gtk2.

Update the cmake code to check for the renamed wx-config executable
wx-config-gtk3 on arch, first checking for wx-config-gtk4 for the
future.
2018-06-18 02:44:19 -07:00
Rafael Kitover 0dc3e06c99 update installdeps for opensuse
ID_LIKE in /etc/os-release changed from "suse" to "opensuse suse",
change to match *suse* in the string.
2018-06-06 06:47:56 -04:00
Rafael Kitover 60f2bd3fd9 remove ffmpeg from suse installdeps
ffmpeg requires the packman repo, and there's no simple way to enable
the repo for any version of opensuse.
2018-04-26 17:08:16 -04:00
Eleuin 9843af2b5a
Fix cmake directory in installdeps 2018-04-02 09:29:32 -04:00
Rafael Kitover 5ae853a905 fix installdeps for OpenSUSE
Fix syntax error (calling functions from the wrong script) and add
openal-soft-devel to deps.
2018-03-19 02:52:53 -04: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 9c06c31814 deps: don't check result of apt-get update #154
On Debian-based distributions, people sometimes have bad sources in apt,
e.g. PPAs that no longer exist, or mirrors that no longer work, etc.. In
these cases, `apt-get update` will still likely fetch the main
distribution package lists, which is what we need, but return a non-zero
exit code.

Change `./installdeps` to not abort on non-zero exit status from
`apt-get -qq update`.
2017-10-05 18:28:42 -07:00
Rafael Kitover 268c638456 improve win32 dependencies git submodule handling
Use `git submodule update --remote --recursive` instead of `git
submodule update --init --recursive` so that the latest version of the
repo is always installed.

Run the command from cmake instead of throwing an error if the submodule
is not checked out. Only throw an error if the checkout failed or the
source tree is not a git checkout.

Don't add the `mingw-xaudio` include directory if using MSVC.

Remove the submodule check from src/wx/CMakeLists.txt, having it in the
main CMakeLists.txt is enough.
2017-09-19 06:11:41 -07:00
Rafael Kitover 5691ac0c0e installdeps: fedora fixes, including m32
Fix some syntax errors and extraneous output in fedora_installdeps().

"Fix" the 32 bit deps installer to try to ignore file conflicts between
i686 and host rpms, by first using rpm --force to install the 32 bit
rpms and then overwriting them with the host ones using --force as well.
This is hackish and fragile, but there aren't any good alternatives
right now.
2017-09-12 13:47:56 -07:00
Rafael Kitover 4b1c9b4e86 installdeps: minor refactoring/cleanup
Break command line argument processing and OS detection off into
functions called from `main()`.

Remove all references to cairo.

For fink, install the SFML package I made instead of turning off link.
2017-09-02 03:59:31 -07:00
Rafael Kitover 1a27f81342 installdeps: use -j$(nproc) not -j8 in info #146
Replace the hardcoded `make -j8` command in the build instructions with
a `-j` parameter that is the number of the host's CPUs minus one.

Subtracting 1 is done to reduce chances of overloading the host.

If the value is `1`, then don't print the `-j` flag at all.
2017-08-31 16:56:06 -07:00
Rafael Kitover 7b0078d2c1 ./installdeps tweaks for fedora/rawhide
When installing rpmfusion repos, try going back up to 3 releases in case
the latest rawhide release does not have an rpmfusion repo, and install
the repo packages with --nodeps so that they don't conflict with
system-release(XX).

If installing rpmfusion repos fails, continue without ffmpeg (and adjust
build instructions accordingly.)

If ffmpeg fails to install for any reason, show a warning and adjust
build instructions.
2017-03-25 04:02:52 -07:00
Rafael Kitover f56794e8a3 fix ./installdeps m32 for Solus
When calculating 32 bit dependencies, look only for -devel packages, and
match only -devel packages when checking for corresponding -32bit-devel
packages.
2017-03-24 01:38:34 -07:00
Rafael Kitover 41ead88dcb 32 bit cross compiling support on Linux
Add the `m32` parameter to ./installdeps to fetch 32 bit multilib
dependencies on Fedora, Arch and Solus linuxes and add a cmake toolchain
file to build with them.

For MSYS2 support both an `m32` and an `m64` to choose deps for 32 bit
or 64 bit mingw targets.

Adjust build instructions from ./installdeps to support both usages.

Other changes:

- use --nogpgcheck --best --allowerasing for dnf invocations for Fedora,
  the --nogpgcheck is necessary when Rawhide is confused about which
  keys it has, and the latter two are needed for upgrades that remove
  unneeded deps etc

- when finding GTK2, first try using pkg-config, and only fall back to
  the cmake script when that fails, pkg-config works better for cross
  builds

- add cairo to dep lists in ./installdeps for the time being

- for arch, list individual packages from base-devel instead of
  base-devel that do not require gcc-libs because of potential conflicts
  between gcc and gcc-multilib
2017-03-23 14:09:17 -07:00
Joshua Strobl 8013d226a0 Simplified Solus installdeps
Multiple previously specified packages are either already in system.devel or are dependencies of items such as libgtk-2-devel or libgtk-3-devel, dependencies of those dependencies, etc.
2017-03-23 02:49:08 +02:00
Rafael Kitover 0dc175cdb4 basic ./installdeps support for Solus Linux
Add basic support for installing deps for a Solus host build and update
README.md .

Support for mingw and 32 bit cross-builds may be added later.
2017-03-19 19:09:33 -07:00
Rafael Kitover 9dc740156b minor doc tweaks
- Add Ubuntu daily PPA link.

- Add link to releases tab for win/mac builds.

- Advise `make -j8` instead of `make -j10`.

- Clarify which dependencies are optional and which are required.

- Add ENABLE_ASM cmake option to the table.

- Replace wxLogDebug with wxString example to use .utf8_str() instead of
  concatenation, this is more correct.
2017-03-06 02:03:15 -08:00
Rafael Kitover ea4056e025 remove intermediate dependencies jpeg and tiff
jpeg and tiff are not direct dependencies and should be pulled in by
direct dependencies such as wx, remove them from README.md and
./installdeps.
2017-02-20 13:43:39 -08:00
Rafael Kitover 6a7d49419c initial Wayland support #72 #76
Disable OpenGL support under Wayland because wxGLCanvas segfaults, and
fix an issue with drawn frames not appearing.

If the user has opengl as the render method in their config, it will not
be changed, but at runtime will be set to simple under Wayland.

To fix the issue with frames not being drawn, Call Refresh() to queue a
PaintEv from DrawArea(data) instead of calling DrawArea(device_context)
directly.

Also remove the DrawOSD() call from PaintEv, this was causing the OSD to
sometimes show up twice in one frame, because DrawArea(data) draws the
OSD directly on the frame data.

Add new files wayland.cpp and wayland.h with a bool IsItWayland() global
function. This uses a GDK (part of GTK) call to detect Wayland.  This
unfortunately requires linking GTK libs separately.

Add cmake code to detect the version of GTK used by the wx being linked
and link it as well. Add gtk2 and gtk3 dev packages to the code for the
supported linux dists in ./installdeps.
2017-02-20 13:20:09 -08:00
Rafael Kitover b0b0ad08ca add --exclude='glibc32*' for Fedora ./installdeps
This should fix possible problems with the glibc32 package being
sometimes erroneously pulled in in rawhide when installing 32 bit devel
libs.
2017-02-16 05:21:40 -08:00
Rafael Kitover 92e3a826a4 update ./installdeps for Fedora rawhide
Try to install both pkgconfig.i686 and pkgconfig.x86_64 silently because
fc26+ does not have a separate 32 bit package.

If installing 32 bit packages fails on amd64, fall back to installing 64
bit packages only.
2017-02-16 03:39:51 -08:00
Rafael Kitover 34e408ccb7 fix Debian 8 Jessie and Ubuntu 14 Trusty compat
Fix some porting issues to make everything work on Debian 8 "Jessie"
and Ubuntu 14 "Trusty":

- set cmake minimum version to 2.8.12, this is the Ubuntu 14 version

- combine C and C++ flags and add all of them using
  ADD_COMPILE_OPTIONS() without using generator expressions, which is a
  cmake 3.2 or so feature

- add -fpermissive to force some non-const type casts to compile on
  older versions of gcc

- add -std=c++11 for gcc to enable support on older versions of gcc

- check that the compiler supports -fstack-protector-strong before
  adding it, older versions of gcc do not

- fix the debian section of ./installdeps to include libpng-dev instead
  of libpng16-dev and add gettext for msginit etc.

- fix compat checks in src/common/ffmpeg.cpp and src/wx/cmdevents.cpp to
  check for libavcodec >= 56 instead of > 56, the Debian Jessie version
  is exactly version 56 . With the one exception of
  AV_CODEC_FLAG_GLOBAL_HEADER which is defined in later versions.
2017-01-29 10:14:34 -08:00
Rafael Kitover fdc389c280 fix wx 2.8 compat, debug logging works everywhere
Fix backcompat with wx 2.8. This involved writing
wxPositiveDoubleValidator and rewiring the DrawingPanel inheritance tree
and event handling mechanisms (because 2.8 does not have ->Bind, only
->Connect which is less flexible.) As a result all the event handling
has been gathered into GameArea and the affected code is somewhat
cleaner. 2.8 support is untested on Mac because it requires 32 bit libs
and Carbon.

Add support for cross-compiling for windows using the Fedora MinGW
packages in ./installdeps.

Check for OpenGL support in the wx library being linked, this was
necessary because the Fedora MinGW wx library does not have OpenGL
support.

Remove vbamDebug() in favor of wxLogDebug(), and add an override for it
so that it works in non-debug builds of wx as well as on Windows. Turn
off buffering on stdout and stderr on startup so that debug logging
works in msys2/cygwin mintty as well.

On Windows, build a console binary for debug builds.

Update README.md to reflect Fedora MinGW support and debug logging
support.

Add -Wextra to cflags for debug builds.
2017-01-25 10:53:05 -08:00
Rafael Kitover b258c004af ./installdeps: support Fedora Linux
Detect and install deps for Fedora Linux in ./installdeps . On 64 bit
intel hosts install both 32 and 64 bit dev libs. Also update README.md
to note that Fedora is supported.

MISC: add nasm to all dep lists for various dists
2016-12-28 08:48:30 -08:00
Rafael Kitover f641620a6c ./installdeps: pull deps submdl for cross targets
Run `git submodule update --init --recursive` for all win32 cross
targets, not just msys2, in check_cross() .
2016-12-25 05:12:23 -08:00
Rafael Kitover f124a28e19 use $MSYSTEM for msys2 target in ./installdeps
Only allow running ./installdeps if $MSYSTEM is MINGW32 or MINGW64, that
is, the user started a MINGW 32 bit or 64 bit shell and **NOT** an MSYS
shell.

Use the value of $MSYSTEM to determine if 32 bit or 64 bit target deps
should be installed.

Update usage() text to reflect this.

MISC: rename generic_build_instructions() to build_instructions() .
2016-12-22 07:04:27 -08:00
Rafael Kitover d06e7afceb full support for cross-compiling to win32 with mxe
Fix all cmake issues related to building for win32 with mxe.

Add support for ./installdeps win32 on Debian/Ubuntu using the mxe apt
repository.

Details:

* default to ENABLE_LTO=OFF on mxe

* set SFML_STATIC_LIBRARIES=TRUE on mxe

* fix the libintl/gettext checking logic

* fix the git dependencies submodule checking logic, and check that it
  triggers for mxe

* revert FindSFML.cmake to upstream version, works fine with mxe

* make 'win32' an alias for the 'MinGW-w64-i686' target for
  ./installdeps, add support for mxe apt repository for Debian/Ubuntu

* change bin2c related cmake code to compile the tool on the host always
  even when cross-compiling

* copy src/win32/res/VBA.ico to src/wx/icons since src/win32 has been
  removed

TODO: generic mxe installer for other unix-likes
2016-12-21 13:02:55 -08:00
Rafael Kitover 982d639ea2 add gettext-tools to fink deps
gettext-tools needs to be installed in fink for cmake to find msginit,
update ./installdeps to include it.
2016-12-19 02:18:30 -08:00
Rafael Kitover 94b62b13b3 minor update to ./installdeps
For arch cross builds, try to install both the mingw -headers-git and
-crt-git .
2016-12-13 10:38:15 -05:00
Rafael Kitover 68f2badae7 more ./installdeps improvements
Allow selecting target for MSYS2 deps.

For Arch cross builds, do not run yaourt if all deps are already
satisfied.

For Mac Homebrew, only install formulae that do not already have some
version installed, otherwise if the user has a non-default version (such
as --HEAD) the script will error out.
2016-12-12 19:55:44 -08:00
Rafael Kitover 53fb6b4371 ./installdeps + windows cross build improvements
Refactor ./installdeps and add support for mingw-w64 cross builds on
Arch Linux. The latter does not work currently because of a bug in
libuuid in the mingw-w64 crt, and the wxmsw AUR package does not build.
This will hopefully be resolved soon.

Put a copy of FindOpenAL.cmake into our own CMakeScripts/ because
searching for include files with PATH_SUFFIXES of include/ does not work
for cross builds, as it is done in the system version.
2016-12-12 19:46:14 -05:00
Rafael Kitover c216528793 generalize ./installdeps + mac pkg mgrs support
Add a more general purpose ./installdeps script to replace
./installdeps-msys2 that handles: Debian Linux, Arch Linux, MSYS2+MinGW,
Mac Homebrew, MacPorts and Fink for Mac. More OSes and distributions
will be added in the future, and the script may be generalized for use
in other projects.

Move Mac package manager setup code into MacPackageManagers.cmake and
greatly improve it. Handles Homebrew, MacPorts and Fink correctly.

Minor tweaks for FindSDL2.cmake: better include dir searching that works
on cygwin, fix flags for MinGW, and quiet pkg-config program errors.

Add MinGW cross-compilation toolchain files, they can be specified on
the cmake command line with:

-DCMAKE_TOOLCHAIN_FILE=../CMakeScripts/Toolchain-cross-MinGW-w64-i686.cmake

or

-DCMAKE_TOOLCHAIN_FILE=../CMakeScripts/Toolchain-cross-MinGW-w64-x86_64.cmake

these work for Cygwin and should work for MinGW on Linux as well.
2016-12-10 23:41:32 -08:00