diff --git a/.travis.yml b/.travis.yml index a6826bf9a..10eaabb5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ sudo: required -dist: trusty +dist: xenial language: cpp git: @@ -8,59 +8,40 @@ git: addons: apt: sources: - - ubuntu-toolchain-r-test + - sourceline: 'ppa:ubuntu-toolchain-r/test' + - sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial main' + key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc' packages: - libasound2-dev - libfftw3-dev - libhunspell-dev - - yasm - libfribidi-dev - libass-dev - libicu-dev - luarocks - - g++-5 - -matrix: - include: - - compiler: gcc - env: BOOST_VERSION=55 - - compiler: gcc - env: BOOST_VERSION=60 - before_install: - - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 --slave /usr/bin/gcov gcov /usr/bin/gcov-5 + - cmake + - build-essential + - libboost-all-dev + - libffms2-dev + - libfontconfig1-dev + - libopenal-dev + - libuchardet-dev + - libwxgtk3.0-dev install: - # Can't install these via the apt addon due to the whitelist - - sudo apt-get install -y -qq libffms2-dev libwxgtk3.0-dev libuchardet-dev - - - sudo pip install -U cpp-coveralls - sudo luarocks install busted > /dev/null - sudo luarocks install moonscript > /dev/null - sudo luarocks install uuid > /dev/null - - git submodule --quiet init - - git submodule --quiet update vendor/googletest - - - cd vendor - - rm -rf boost - - wget http://sourceforge.net/projects/boost/files/boost/1.${BOOST_VERSION}.0/boost_1_${BOOST_VERSION}_0.tar.bz2/download - - tar xjf download - - mv boost_1_${BOOST_VERSION}_0 boost - - cd boost - - ./bootstrap.sh - - ./b2 -j3 -layout=system threading=multi cxxflags=-std=c++11 link=shared variant=release --without-python --without-iostreams --without-serialization --without-graph --without-log --without-math --without-signals --without-test --without-wave --without-mpi --without-program_options --without-graph_parallel --without-context --without-coroutine --without-random --without-timer --without-date_time - - sudo ./b2 -layout=system threading=multi cxxflags=-std=c++11 link=shared variant=release --without-python --without-iostreams --without-serialization --without-graph --without-log --without-math --without-signals --without-test --without-wave --without-mpi --without-program_options --without-graph_parallel --without-context --without-coroutine --without-random --without-timer --without-date_time install - - cd ../.. - script: - - export CPATH=$(pwd)/vendor/boost - - export LD_LIBRARY_PATH=$(pwd)/vendor/boost/stage/lib:$LD_LIBRARY_PATH - - export CPPFLAGS="-fprofile-arcs -ftest-coverage" - - export LIBS="-lgcov" - - autoreconf -if - - ./configure BOOST_LDFLAGS="-L$(pwd)/vendor/boost/stage/lib" --enable-debug || cat config.log - - make -j3 all test - - coveralls --exclude vendor --exclude src --exclude build --exclude tools --exclude libaegisub/windows > /dev/null + # Remove the CMake provided by travis + - sudo rm -rf /usr/local/cmake* + + - ./build/version.sh . + - mkdir build-dir + - cd build-dir + - cmake -DCMAKE_CXX_FLAGS='-std=gnu++11' .. + - make -j2 notifications: email: diff --git a/CMakeLists.txt b/CMakeLists.txt index cad289abb..84c9b37a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.11) +cmake_minimum_required(VERSION 3.14) cmake_policy(SET CMP0074 NEW) project(Aegisub) @@ -212,6 +212,7 @@ if(MSVC) else(MSVC) target_sources(luajit PRIVATE vendor/luajit/src/lj_vm.s) set_property(SOURCE vendor/luajit/src/lj_vm.s PROPERTY LANGUAGE C) + target_link_libraries(luajit dl) endif(MSVC) target_include_directories(luajit PRIVATE vendor/luajit/src/gen) add_dependencies(luajit luajit-buildvm) diff --git a/README.md b/README.md index e28366617..c62c29c5e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/wangqr/Aegisub.svg?branch=dev)](https://travis-ci.org/wangqr/Aegisub) + # Aegisub For binaries and general information [see the homepage](http://www.aegisub.org). @@ -8,78 +10,23 @@ Support is available on [the forums](http://forum.aegisub.org) or [on IRC](irc:/ ## Building Aegisub -### Windows - Prerequisites: -1. Visual Studio 2015 (the free Community edition is good enough) -2. The June 2010 DirectX SDK (the final release before DirectSound was dropped) -3. [Yasm](http://yasm.tortall.net/) installed to somewhere on your path. - -There are a few optional dependencies: - -1. msgfmt, to build the translations -2. WinRAR, to build the portable installer -3. InnoSetup, to build the regular installer - -All other dependencies are either stored in the repository or are included as submodules. +1. CMake 3.14 or later (or you can use an older version by editing the first line in CMakeLists.txt, and download the missing `cmake/FindFontconfig.cmake` from [here](https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/FindFontconfig.cmake)), +2. Any compiling toolchain supported by CMake, +3. All required dependencies, namely `libass`, `Boost`(with ICU support), `OpenGL`, `Hunspell`, `libicu`, `wxWidgets`, `zlib`. On non-POSIX systems, `libiconv`. On non-Windows systems, `fontconfig`. +4. Any optional dependencies, namely `ALSA`, `FFMS2`, `FFTW`, `OpenAL`, `uchardet`. Building: -1. Clone Aegisub's repository recursively to fetch it and all submodules: `git clone --recursive git@github.com:Aegisub/Aegisub.git` This will take quite a while and requires about 2.5 GB of disk space. -2. Open Aegisub.sln -3. Build the BuildTasks project. -4. Build the entire solution. - -You should now have a `bin` directory in your Aegisub directory which contains `aegisub32d.exe`, along with a pile of other files. - -The Aegisub installer includes some files not built as part of Aegisub (such as Avisynth and VSFilter), so for a fully functional copy of Aegisub you now need to copy all of the files from an installed copy of Aegisub into your `bin` directory (and don't overwrite any of the files already there). -You'll also either need to copy the `automation` directory into the `bin` directory, or edit your automation search paths to include the `automation` directory in the source tree. - -After building the solution once, you'll want to switch to the Debug-MinDep configuration, which skips checking if the dependencies are out of date, as that takes a while. - -### OS X - -A vaguely recent version of Xcode and the corresponding command-line tools are required. -Nothing older than Xcode 5 has been tested recently, but it is likely that some later versions of Xcode 4 are good enough. - -For personal usage, you can use homebrew to install almost all of Aegisub's dependencies: - - brew install autoconf ffmpeg freetype gettext ffms2 fftw fribidi libass m4 - brew install --devel --with-gc64 luajit - brew install --HEAD icu4c - brew link --force icu4c - brew link --force gettext - brew install --HEAD --c++11 --with-icu4c boost - -wxWidgets is located in vendor/wxWidgets, and can be built like so: - - CPPFLAGS="$CPPFLAGS -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=1" \ - ./configure --disable-aboutdlg --disable-animatectrl --disable-aui --disable-any \ - --disable-bannerwindow --disable-base64 --disable-calendar --disable-caret \ - --disable-cmdline --disable-colourpicker --disable-compat28 --disable-config \ - --disable-constraints --disable-datepick --disable-dctransform --disable-debugreport \ - --disable-dialupman --disable-docview --disable-filehistory --disable-finddlg \ - --disable-fs_archive --disable-fs_inet --disable-fs_zip --disable-fsvolume \ - --disable-fswatcher --disable-gif --disable-help --disable-html --disable-ipc \ - --disable-joystick --disable-jpeg --disable-largefile --disable-markup --disable-mdi \ - --disable-mediactrl --disable-metafiles --disable-miniframe --disable-notifmsg \ - --disable-numberdlg --disable-pcx --disable-pnm --disable-postscript \ - --disable-prefseditor --disable-printarch --disable-progressdlg --disable-propgrid \ - --disable-protocol --disable-protocols --disable-rearrangectrl --disable-ribbon \ - --disable-richtext --disable-richtooltip --disable-snglinst --disable-sockets \ - --disable-sockets --disable-sound --disable-splash --disable-splines \ - --disable-std_iostreams --disable-svg --disable-tarstream --disable-tiff \ - --disable-tipdlg --disable-tipwindow --disable-url --disable-webkit --disable-webview \ - --disable-wizarddlg --disable-xrc \ - --enable-geometry --enable-imaglist --enable-listctrl --enable-stc --with-cocoa \ - --with-libpng=yes --with-macosx-version-min=10.9 \ - --with-opengl \ - --without-libjpeg --without-libtiff --without-regex \ - && make - -Once the dependencies are installed, build Aegisub with `autoreconf && ./configure --with-wxdir=/path/to/Aegisub/vendor/wxWidgets && make && make osx-bundle`. -`autoreconf` should be skipped if you are building from a source tarball rather than `git`. +1. If you decided to build from source: +```shell +git clone https://github.com/wangqr/Aegisub.git # No --recursive is needed +cd Aegisub +./build/version.sh . # This will generate build/git_version.h +``` +2. Make an empty directory to hold build outputs, +3. Build the project using CMake. ## Updating Moonscript diff --git a/src/colour_button.cpp b/src/colour_button.cpp index 48a87856c..83671ebf3 100644 --- a/src/colour_button.cpp +++ b/src/colour_button.cpp @@ -18,7 +18,11 @@ #include "dialogs.h" +#if BOOST_VERSION >= 106900 #include +#else +#include +#endif AGI_DEFINE_EVENT(EVT_COLOR, agi::Color); diff --git a/src/dialog_fonts_collector.cpp b/src/dialog_fonts_collector.cpp index 78ac20ef5..9b71afd75 100644 --- a/src/dialog_fonts_collector.cpp +++ b/src/dialog_fonts_collector.cpp @@ -400,7 +400,11 @@ void DialogFontsCollector::OnAddText(ValueEvent &event) { auto const& utf8 = str.second.utf8_str(); collection_log->AppendTextRaw(utf8.data(), utf8.length()); if (str.first) { +#if wxCHECK_VERSION (3, 1, 0) + collection_log->StartStyling(pos); +#else collection_log->StartStyling(pos, 31); +#endif collection_log->SetStyling(utf8.length(), str.first); } collection_log->GotoPos(pos + utf8.length()); diff --git a/src/dialog_translation.cpp b/src/dialog_translation.cpp index c5fb4ffb8..86f12291c 100644 --- a/src/dialog_translation.cpp +++ b/src/dialog_translation.cpp @@ -95,7 +95,11 @@ DialogTranslation::DialogTranslation(agi::Context *c) translated_text->SetMarginWidth(1, 0); translated_text->SetFocus(); translated_text->Bind(wxEVT_CHAR_HOOK, &DialogTranslation::OnKeyDown, this); +#if wxCHECK_VERSION (3, 1, 0) + translated_text->CmdKeyAssign(wxSTC_KEY_RETURN, wxSTC_KEYMOD_SHIFT, wxSTC_CMD_NEWLINE); +#else translated_text->CmdKeyAssign(wxSTC_KEY_RETURN, wxSTC_SCMOD_SHIFT, wxSTC_CMD_NEWLINE); +#endif wxSizer *translated_box = new wxStaticBoxSizer(wxVERTICAL, this, _("Translation")); translated_box->Add(translated_text, 1, wxEXPAND, 0); @@ -244,7 +248,11 @@ void DialogTranslation::UpdateDisplay() { int initial_pos = original_text->GetLength(); original_text->AppendTextRaw(block->GetText().c_str()); if (i == cur_block) { +#if wxCHECK_VERSION (3, 1, 0) + original_text->StartStyling(initial_pos); +#else original_text->StartStyling(initial_pos, 31); +#endif original_text->SetStyling(block->GetText().size(), 1); } } diff --git a/src/subs_edit_ctrl.cpp b/src/subs_edit_ctrl.cpp index 4618ea409..a44c099e0 100644 --- a/src/subs_edit_ctrl.cpp +++ b/src/subs_edit_ctrl.cpp @@ -88,10 +88,27 @@ SubsTextEditCtrl::SubsTextEditCtrl(wxWindow* parent, wxSize wsize, long style, a // Set properties SetWrapMode(wxSTC_WRAP_WORD); SetMarginWidth(1,0); +#if wxCHECK_VERSION (3, 1, 0) + UsePopUp(wxSTC_POPUP_NEVER); +#else UsePopUp(false); +#endif SetStyles(); // Set hotkeys +#if wxCHECK_VERSION (3, 1, 0) + CmdKeyClear(wxSTC_KEY_RETURN, wxSTC_KEYMOD_CTRL); + CmdKeyClear(wxSTC_KEY_RETURN, wxSTC_KEYMOD_SHIFT); + CmdKeyClear(wxSTC_KEY_RETURN, wxSTC_KEYMOD_NORM); + CmdKeyClear(wxSTC_KEY_TAB, wxSTC_KEYMOD_NORM); + CmdKeyClear(wxSTC_KEY_TAB, wxSTC_KEYMOD_SHIFT); + CmdKeyClear('D', wxSTC_KEYMOD_CTRL); + CmdKeyClear('L', wxSTC_KEYMOD_CTRL); + CmdKeyClear('L', wxSTC_KEYMOD_CTRL | wxSTC_KEYMOD_SHIFT); + CmdKeyClear('T', wxSTC_KEYMOD_CTRL); + CmdKeyClear('T', wxSTC_KEYMOD_CTRL | wxSTC_KEYMOD_SHIFT); + CmdKeyClear('U', wxSTC_KEYMOD_CTRL); +#else CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_SCMOD_CTRL); CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_SCMOD_SHIFT); CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_SCMOD_NORM); @@ -103,6 +120,7 @@ SubsTextEditCtrl::SubsTextEditCtrl(wxWindow* parent, wxSize wsize, long style, a CmdKeyClear('T',wxSTC_SCMOD_CTRL); CmdKeyClear('T',wxSTC_SCMOD_CTRL | wxSTC_SCMOD_SHIFT); CmdKeyClear('U',wxSTC_SCMOD_CTRL); +#endif using std::bind; @@ -261,7 +279,11 @@ void SubsTextEditCtrl::UpdateStyle() { cursor_pos = -1; UpdateCallTip(); +#if wxCHECK_VERSION (3, 1, 0) + StartStyling(0); +#else StartStyling(0,255); +#endif if (!OPT_GET("Subtitle/Highlight/Syntax")->GetBool()) { SetStyling(line_text.size(), 0); diff --git a/src/subtitles_provider_libass.cpp b/src/subtitles_provider_libass.cpp index fb62e3334..815c820da 100644 --- a/src/subtitles_provider_libass.cpp +++ b/src/subtitles_provider_libass.cpp @@ -46,7 +46,11 @@ #include #include +#if BOOST_VERSION >= 106900 #include +#else +#include +#endif #include #include diff --git a/src/video_frame.cpp b/src/video_frame.cpp index c51f929ac..c7957d964 100644 --- a/src/video_frame.cpp +++ b/src/video_frame.cpp @@ -16,7 +16,11 @@ #include "video_frame.h" +#if BOOST_VERSION >= 106900 #include +#else +#include +#endif #include namespace { diff --git a/src/video_provider_dummy.cpp b/src/video_provider_dummy.cpp index eca5ac261..17a1508b5 100644 --- a/src/video_provider_dummy.cpp +++ b/src/video_provider_dummy.cpp @@ -45,7 +45,11 @@ #include #include #include +#if BOOST_VERSION >= 106900 #include +#else +#include +#endif DummyVideoProvider::DummyVideoProvider(double fps, int frames, int width, int height, agi::Color colour, bool pattern) : framecount(frames)