diff --git a/.travis.yml b/.travis.yml index abe9bda341..1ccf3e2e34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -sudo: required +os: linux dist: bionic language: cpp @@ -33,6 +33,23 @@ addons: - libgtest-dev - gcc-9 - g++-9 + homebrew: + packages: + - autoconf + - boost + - ffmpeg + - ffms2 + - fftw + - freetype + - fribidi + - gettext + - icu4c + - libass + - lua + - luarocks + - m4 + - wxmac + update: true env: - '' @@ -69,16 +86,9 @@ script: make test || travis_terminate 1; coveralls --exclude vendor --exclude src --exclude build --exclude tools --exclude libaegisub/windows > /dev/null; else - ./build/version.sh .; mkdir build-dir; cd build-dir; cmake -DCMAKE_CXX_FLAGS='-Wall -Wextra -Wno-unused-parameter -pedantic' -DCMAKE_C_FLAGS='-Wall' -DWITH_STARTUPLOG=ON -DWITH_TEST=ON ..; make -j2 || travis_terminate 1; make test || travis_terminate 1; fi - -notifications: - email: - - on_success: change - - on_failure: change - diff --git a/.travis/install.sh b/.travis/install.sh index 405a139ca9..8334a4d27c 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -2,12 +2,10 @@ set -e -if [ $TRAVIS_OS_NAME = 'osx' ]; then - brew install autoconf ffmpeg freetype gettext ffms2 fftw fribidi libass m4 icu4c boost wxmac lua luarocks -else +if [ "$TRAVIS_OS_NAME" = 'linux' ]; then # Remove the CMake provided by travis sudo rm -rf /usr/local/cmake* - if [ "$BUILD_SUIT" = "autotools" ]; then + if [ "$BUILD_SUIT" = 'autotools' ]; then sudo pip install -U cpp-coveralls; git submodule --quiet init; git submodule --quiet update vendor/googletest; diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ba6b13dfc..1cdad91895 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -470,6 +470,23 @@ add_executable(Aegisub WIN32 target_link_libraries(Aegisub ${CMAKE_DL_LIBS} libaegisub luabins luajit resrc csri) target_compile_definitions(Aegisub PRIVATE CMAKE_BUILD) +if(WIN32) + if(NOT EXISTS "${PROJECT_SOURCE_DIR}/build/git_version.h") + message(SEND_ERROR + "build/git_version.h not found.\n" + "Automatic generation of build/git_version.h is not supported on Windows. Please run\n" + " build/version.sh .\n" + "at the source directory from an environment with bash and git. You may use WSL, msys (git bash), or Cygwin." + ) + endif() +else() + add_custom_target(git_version build/version.sh . + BYPRODUCTS "${PROJECT_SOURCE_DIR}/build/git_version.h" "${PROJECT_SOURCE_DIR}/build/git_version.xml" + WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" + ) + add_dependencies(Aegisub git_version) +endif() + set(WITH_BUILD_CREDIT OFF CACHE BOOL "Whether show build credit in about dialog") if(WITH_BUILD_CREDIT) set(BUILD_CREDIT "" CACHE STRING "Build credit shown in about dialog") diff --git a/Makefile.target b/Makefile.target index 003f21935b..8db12b106e 100644 --- a/Makefile.target +++ b/Makefile.target @@ -5,9 +5,9 @@ COMMANDS := all install clean distclean test depclean osx-bundle osx-dmg test-au # Would be nice to move this somewhere else (Makefile.inc?) ifeq (yes, $(BUILD_DARWIN)) -CFLAGS += -mmacosx-version-min=10.8 -gfull -DLUAJIT_ENABLE_GC64 -CXXFLAGS += -mmacosx-version-min=10.8 -gfull -DLUAJIT_ENABLE_GC64 -LDFLAGS += -mmacosx-version-min=10.8 -Wl,-dead_strip +CFLAGS += -mmacosx-version-min=10.10 -gfull -DLUAJIT_ENABLE_GC64 +CXXFLAGS += -mmacosx-version-min=10.10 -gfull -DLUAJIT_ENABLE_GC64 +LDFLAGS += -mmacosx-version-min=10.10 -Wl,-dead_strip LIB_SHARED_LINK = $(LIB_SHARED_LINK_OSX) endif diff --git a/README.md b/README.md index 29e4fd8ded..9daa3121eb 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ and optional dependencies: You can use the package manager provided by your distro to install these dependencies. Package name varies by distro. Some useful references are: * For ArchLinux, refer to [AUR](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=aegisub-git). -* For Ubuntu, refer to [Travis](https://github.com/wangqr/Aegisub/blob/dev/.travis.yml#L14-L35). +* For Ubuntu, refer to [Travis](.travis.yml#L14-L35). * For macOS, see [Special notice for macOS](https://github.com/wangqr/Aegisub/wiki/Special-notice-for-macOS) on project Wiki. After installing the dependencies, you can clone and build Aegisub with: diff --git a/vendor/luajit/src/Makefile b/vendor/luajit/src/Makefile index 9965ef2f67..c29c0b5a16 100644 --- a/vendor/luajit/src/Makefile +++ b/vendor/luajit/src/Makefile @@ -215,8 +215,7 @@ TARGET_STRIP= $(CROSS)strip #TARGET_LIBPATH= $(or $(PREFIX),/usr/local)/$(or $(MULTILIB),lib) TARGET_LIBPATH= $(CURDIR) TARGET_SONAME= libluajit-$(ABIVER).so.$(MAJVER) -#TARGET_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).dylib -TARGET_DYLIBNAME= libluajit-aegisub.so +TARGET_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).dylib TARGET_DYLIBPATH= $(TARGET_LIBPATH)/$(TARGET_DYLIBNAME) TARGET_DLLNAME= lua$(NODOTABIVER).dll TARGET_XSHLDFLAGS= -shared -fPIC -Wl,-soname,$(TARGET_SONAME) @@ -503,7 +502,7 @@ LIB_VMDEFP= $(LIB_VMDEF) LUAJIT_O= luajit.o LUAJIT_A= libluajit.a -LUAJIT_SO= libluajit-aegisub.so +LUAJIT_SO= libluajit.so LUAJIT_T= luajit ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(HOST_T)