Update README to use CMake

This commit is contained in:
wangqr 2019-05-08 15:11:23 -04:00
parent 1ae2f60b9a
commit c4cce28766
10 changed files with 86 additions and 107 deletions

View File

@ -1,5 +1,5 @@
sudo: required sudo: required
dist: trusty dist: xenial
language: cpp language: cpp
git: git:
@ -8,59 +8,40 @@ git:
addons: addons:
apt: apt:
sources: 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: packages:
- libasound2-dev - libasound2-dev
- libfftw3-dev - libfftw3-dev
- libhunspell-dev - libhunspell-dev
- yasm
- libfribidi-dev - libfribidi-dev
- libass-dev - libass-dev
- libicu-dev - libicu-dev
- luarocks - luarocks
- g++-5 - cmake
- build-essential
matrix: - libboost-all-dev
include: - libffms2-dev
- compiler: gcc - libfontconfig1-dev
env: BOOST_VERSION=55 - libopenal-dev
- compiler: gcc - libuchardet-dev
env: BOOST_VERSION=60 - libwxgtk3.0-dev
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
install: 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 busted > /dev/null
- sudo luarocks install moonscript > /dev/null - sudo luarocks install moonscript > /dev/null
- sudo luarocks install uuid > /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: script:
- export CPATH=$(pwd)/vendor/boost # Remove the CMake provided by travis
- export LD_LIBRARY_PATH=$(pwd)/vendor/boost/stage/lib:$LD_LIBRARY_PATH - sudo rm -rf /usr/local/cmake*
- export CPPFLAGS="-fprofile-arcs -ftest-coverage"
- export LIBS="-lgcov" - ./build/version.sh .
- autoreconf -if - mkdir build-dir
- ./configure BOOST_LDFLAGS="-L$(pwd)/vendor/boost/stage/lib" --enable-debug || cat config.log - cd build-dir
- make -j3 all test - cmake -DCMAKE_CXX_FLAGS='-std=gnu++11' ..
- coveralls --exclude vendor --exclude src --exclude build --exclude tools --exclude libaegisub/windows > /dev/null - make -j2
notifications: notifications:
email: email:

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11) cmake_minimum_required(VERSION 3.14)
cmake_policy(SET CMP0074 NEW) cmake_policy(SET CMP0074 NEW)
project(Aegisub) project(Aegisub)
@ -212,6 +212,7 @@ if(MSVC)
else(MSVC) else(MSVC)
target_sources(luajit PRIVATE vendor/luajit/src/lj_vm.s) target_sources(luajit PRIVATE vendor/luajit/src/lj_vm.s)
set_property(SOURCE vendor/luajit/src/lj_vm.s PROPERTY LANGUAGE C) set_property(SOURCE vendor/luajit/src/lj_vm.s PROPERTY LANGUAGE C)
target_link_libraries(luajit dl)
endif(MSVC) endif(MSVC)
target_include_directories(luajit PRIVATE vendor/luajit/src/gen) target_include_directories(luajit PRIVATE vendor/luajit/src/gen)
add_dependencies(luajit luajit-buildvm) add_dependencies(luajit luajit-buildvm)

View File

@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/wangqr/Aegisub.svg?branch=dev)](https://travis-ci.org/wangqr/Aegisub)
# Aegisub # Aegisub
For binaries and general information [see the homepage](http://www.aegisub.org). 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 ## Building Aegisub
### Windows
Prerequisites: Prerequisites:
1. Visual Studio 2015 (the free Community edition is good enough) 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. The June 2010 DirectX SDK (the final release before DirectSound was dropped) 2. Any compiling toolchain supported by CMake,
3. [Yasm](http://yasm.tortall.net/) installed to somewhere on your path. 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`.
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.
Building: 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. 1. If you decided to build from source:
2. Open Aegisub.sln ```shell
3. Build the BuildTasks project. git clone https://github.com/wangqr/Aegisub.git # No --recursive is needed
4. Build the entire solution. cd Aegisub
./build/version.sh . # This will generate build/git_version.h
You should now have a `bin` directory in your Aegisub directory which contains `aegisub32d.exe`, along with a pile of other files. ```
2. Make an empty directory to hold build outputs,
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). 3. Build the project using CMake.
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`.
## Updating Moonscript ## Updating Moonscript

View File

@ -18,7 +18,11 @@
#include "dialogs.h" #include "dialogs.h"
#if BOOST_VERSION >= 106900
#include <boost/gil.hpp> #include <boost/gil.hpp>
#else
#include <boost/gil/gil_all.hpp>
#endif
AGI_DEFINE_EVENT(EVT_COLOR, agi::Color); AGI_DEFINE_EVENT(EVT_COLOR, agi::Color);

View File

@ -400,7 +400,11 @@ void DialogFontsCollector::OnAddText(ValueEvent<color_str_pair> &event) {
auto const& utf8 = str.second.utf8_str(); auto const& utf8 = str.second.utf8_str();
collection_log->AppendTextRaw(utf8.data(), utf8.length()); collection_log->AppendTextRaw(utf8.data(), utf8.length());
if (str.first) { if (str.first) {
#if wxCHECK_VERSION (3, 1, 0)
collection_log->StartStyling(pos);
#else
collection_log->StartStyling(pos, 31); collection_log->StartStyling(pos, 31);
#endif
collection_log->SetStyling(utf8.length(), str.first); collection_log->SetStyling(utf8.length(), str.first);
} }
collection_log->GotoPos(pos + utf8.length()); collection_log->GotoPos(pos + utf8.length());

View File

@ -95,7 +95,11 @@ DialogTranslation::DialogTranslation(agi::Context *c)
translated_text->SetMarginWidth(1, 0); translated_text->SetMarginWidth(1, 0);
translated_text->SetFocus(); translated_text->SetFocus();
translated_text->Bind(wxEVT_CHAR_HOOK, &DialogTranslation::OnKeyDown, this); 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); translated_text->CmdKeyAssign(wxSTC_KEY_RETURN, wxSTC_SCMOD_SHIFT, wxSTC_CMD_NEWLINE);
#endif
wxSizer *translated_box = new wxStaticBoxSizer(wxVERTICAL, this, _("Translation")); wxSizer *translated_box = new wxStaticBoxSizer(wxVERTICAL, this, _("Translation"));
translated_box->Add(translated_text, 1, wxEXPAND, 0); translated_box->Add(translated_text, 1, wxEXPAND, 0);
@ -244,7 +248,11 @@ void DialogTranslation::UpdateDisplay() {
int initial_pos = original_text->GetLength(); int initial_pos = original_text->GetLength();
original_text->AppendTextRaw(block->GetText().c_str()); original_text->AppendTextRaw(block->GetText().c_str());
if (i == cur_block) { if (i == cur_block) {
#if wxCHECK_VERSION (3, 1, 0)
original_text->StartStyling(initial_pos);
#else
original_text->StartStyling(initial_pos, 31); original_text->StartStyling(initial_pos, 31);
#endif
original_text->SetStyling(block->GetText().size(), 1); original_text->SetStyling(block->GetText().size(), 1);
} }
} }

View File

@ -88,10 +88,27 @@ SubsTextEditCtrl::SubsTextEditCtrl(wxWindow* parent, wxSize wsize, long style, a
// Set properties // Set properties
SetWrapMode(wxSTC_WRAP_WORD); SetWrapMode(wxSTC_WRAP_WORD);
SetMarginWidth(1,0); SetMarginWidth(1,0);
#if wxCHECK_VERSION (3, 1, 0)
UsePopUp(wxSTC_POPUP_NEVER);
#else
UsePopUp(false); UsePopUp(false);
#endif
SetStyles(); SetStyles();
// Set hotkeys // 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_CTRL);
CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_SCMOD_SHIFT); CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_SCMOD_SHIFT);
CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_SCMOD_NORM); 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);
CmdKeyClear('T',wxSTC_SCMOD_CTRL | wxSTC_SCMOD_SHIFT); CmdKeyClear('T',wxSTC_SCMOD_CTRL | wxSTC_SCMOD_SHIFT);
CmdKeyClear('U',wxSTC_SCMOD_CTRL); CmdKeyClear('U',wxSTC_SCMOD_CTRL);
#endif
using std::bind; using std::bind;
@ -261,7 +279,11 @@ void SubsTextEditCtrl::UpdateStyle() {
cursor_pos = -1; cursor_pos = -1;
UpdateCallTip(); UpdateCallTip();
#if wxCHECK_VERSION (3, 1, 0)
StartStyling(0);
#else
StartStyling(0,255); StartStyling(0,255);
#endif
if (!OPT_GET("Subtitle/Highlight/Syntax")->GetBool()) { if (!OPT_GET("Subtitle/Highlight/Syntax")->GetBool()) {
SetStyling(line_text.size(), 0); SetStyling(line_text.size(), 0);

View File

@ -46,7 +46,11 @@
#include <libaegisub/util.h> #include <libaegisub/util.h>
#include <atomic> #include <atomic>
#if BOOST_VERSION >= 106900
#include <boost/gil.hpp> #include <boost/gil.hpp>
#else
#include <boost/gil/gil_all.hpp>
#endif
#include <memory> #include <memory>
#include <mutex> #include <mutex>

View File

@ -16,7 +16,11 @@
#include "video_frame.h" #include "video_frame.h"
#if BOOST_VERSION >= 106900
#include <boost/gil.hpp> #include <boost/gil.hpp>
#else
#include <boost/gil/gil_all.hpp>
#endif
#include <wx/image.h> #include <wx/image.h>
namespace { namespace {

View File

@ -45,7 +45,11 @@
#include <boost/algorithm/string/predicate.hpp> #include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
#include <libaegisub/format.h> #include <libaegisub/format.h>
#if BOOST_VERSION >= 106900
#include <boost/gil.hpp> #include <boost/gil.hpp>
#else
#include <boost/gil/gil_all.hpp>
#endif
DummyVideoProvider::DummyVideoProvider(double fps, int frames, int width, int height, agi::Color colour, bool pattern) DummyVideoProvider::DummyVideoProvider(double fps, int frames, int width, int height, agi::Color colour, bool pattern)
: framecount(frames) : framecount(frames)