Skip to content

Commit

Permalink
Merge pull request #5 from zoltanvb/wip-merge-from-upstream
Browse files Browse the repository at this point in the history
Merge from upstream.
  • Loading branch information
zoltanvb authored Nov 20, 2024
2 parents 1cabb88 + 1856ec5 commit 62a6aec
Show file tree
Hide file tree
Showing 73 changed files with 1,484 additions and 967 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
/.dir-locals.el
/0Rel*/
/games/
beeb_dis.txt
imgui.ini
/build/
/cmake-build-*/
/.dir-locals-build.sh
/etc/b2_tests/[Zz]/
/dependencies/ProcessorTests/
*.etl
Expand Down
63 changes: 18 additions & 45 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,52 +269,25 @@ if(LINUX OR OSX)
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(FFMPEG libavcodec libavformat libavutil libswresample libswscale)
if(NOT ${FFMPEG_FOUND})
message(STATUS "FFmpeg not found - video writing not available")
if(FFMPEG_FOUND EQUAL 1)
message(STATUS "FFmpeg found:")

message(STATUS " FFMPEG_LIBRARIES: ${FFMPEG_LIBRARIES}")
message(STATUS " FFMPEG_LINK_LIBRARIES: ${FFMPEG_LINK_LIBRARIES}")
message(STATUS " FFMPEG_LIBRARY_DIRS: ${FFMPEG_LIBRARY_DIRS}")
message(STATUS " FFMPEG_LDFLAGS: ${FFMPEG_LDFLAGS}")
message(STATUS " FFMPEG_LDFLAGS_OTHER: ${FFMPEG_LDFLAGS_OTHER}")
message(STATUS " FFMPEG_INCLUDE_DIRS: ${FFMPEG_INCLUDE_DIRS}")
message(STATUS " FFMPEG_CFLAGS: ${FFMPEG_CFLAGS}")
message(STATUS " FFMPEG_CFLAGS_OTHER: ${FFMPEG_CFLAGS_OTHER}")
message(STATUS "FFmpeg library versions:")
message(STATUS " libavcodec version: ${FFMPEG_libavcodec_VERSION}")
message(STATUS " libavformat version: ${FFMPEG_libavformat_VERSION}")
message(STATUS " libavutil version: ${FFMPEG_libavutil_VERSION}")
message(STATUS " libswresample version: ${FFMPEG_libswresample_VERSION}")
message(STATUS " libswscale version: ${FFMPEG_libswscale_VERSION}")
else()
set(FFMPEG__GOOD ON)

set(FFMPEG__AVCODEC_VERSION 58)
set(FFMPEG__AVFORMAT_VERSION 58)
set(FFMPEG__AVUTIL_VERSION 56)
set(FFMPEG__SWRESAMPLE_VERSION 3)
set(FFMPEG__SWSCALE_VERSION 5)

# https://gitlab.kitware.com/cmake/cmake/-/issues/18067 - ridiculous
if(NOT FFMPEG_libavcodec_VERSION MATCHES "^58\.")
message(WARNING "Unsupported libavcodec major version - need 58")
set(FFMPEG__GOOD OFF)
endif()

if(NOT FFMPEG_libavformat_VERSION MATCHES "^58\.")
message(WARNING "Unsupported libavformat major version - need 58")
set(FFMPEG__GOOD OFF)
endif()

if(NOT FFMPEG_libavutil_VERSION MATCHES "^56\.")
message(WARNING "Unsupported libavutil major version - need 56")
set(FFMPEG__GOOD OFF)
endif()

if(NOT FFMPEG_libswresample_VERSION MATCHES "^3\.")
message(WARNING "Unsupported libswreasmple major version - need 3")
set(FFMPEG__GOOD OFF)
endif()

if(NOT FFMPEG_libswscale_VERSION MATCHES "^5\.")
message(WARNING "Unsupported libswscale major version - need 5")
set(FFMPEG__GOOD OFF)
endif()

if(FFMPEG__GOOD)
message(STATUS "FFmpeg 4 found")
message(STATUS " Libraries: ${FFMPEG_LIBRARIES}")
message(STATUS " Include dirs: ${FFMPEG_INCLUDE_DIRS}")
message(STATUS " Definitions: ${FFMPEG_DEFINITIONS}")
else()
message(WARNING "FFmpeg 4 required specifically - video writing not available")
set(FFMPEG_FOUND OFF)
endif()
message(WARNING "FFmpeg not found. Video writing will not be available")
endif()
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion Makefile.osx.mak
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ github_ci_macos_homebrew:

.PHONY:github_ci_macos_homebrew_ffmpeg
github_ci_macos_homebrew_ffmpeg:
brew install ffmpeg@4
brew install ffmpeg

.PHONY:_github_ci_macos_release
_github_ci_macos_release:
Expand Down
20 changes: 17 additions & 3 deletions Makefile.unix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,22 @@ travis_ci_before_install_linux:
##########################################################################
##########################################################################

.PHONY:github_ci_ubuntu
github_ci_ubuntu:
.PHONY:github_ci_ubuntu_without_ffmpeg
github_ci_ubuntu_without_ffmpeg:
$(MAKE) _github_ci_ubuntu_start
$(MAKE) _github_ci_ubuntu_release SUFFIX1=noffmpeg-

.PHONY:github_ci_ubuntu_with_ffmpeg
github_ci_ubuntu_with_ffmpeg:
$(MAKE) _github_ci_ubuntu_start
sudo apt-get -y install ffmpeg libavcodec-dev libavutil-dev libswresample-dev libavformat-dev libswscale-dev
$(MAKE) _github_ci_ubuntu_release SUFFIX1=ffmpeg-

.PHONY:_github_ci_ubuntu_start
_github_ci_ubuntu_start:
sudo apt-get -y update
sudo apt-get -y install libcurl4-openssl-dev libgl1-mesa-dev libglvnd-dev libgtk2.0-dev libpulse-dev uuid-dev libsdl2-dev libuv1-dev ninja-build
$(PYTHON3) "./etc/release/release.py" --verbose $(shell $(PYTHON3) "./etc/release/release2.py" print-suffix)

.PHONY:_github_ci_ubuntu_release
_github_ci_ubuntu_release:
$(PYTHON3) "./etc/release/release.py" --verbose $(SUFFIX1)$(shell $(PYTHON3) "./etc/release/release2.py" print-suffix)
43 changes: 22 additions & 21 deletions doc/Building-on-Unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,28 @@ I do some of the development on macOS, so that version should work
well.

The Linux version doesn't get much testing by me, though I do try it
on Ubuntu 18.04 occasionally. But I've had few reports of problems.
on a Ubuntu VM occasionally. But I've had few reports of problems.
(Please [create an issue](https://github.com/tom-seddon/b2/issues) if
necessary.)

# Common prerequisites

- [cmake](https://cmake.org/) version 3.20+ on the PATH (I built it from [the CMake github repo](https://github.com/Kitware/CMake))
- [ninja](https://ninja-build.org/) (build from the [Ninja github repo](https://github.com/ninja-build/ninja), install from MacPorts, etc.)
- Python 3.x

# macOS prerequisites

- Xcode

There are additional dependencies for video writing, which are
optional. The project will build without these, but video writing
## Additional prerequisites for video writing

These are optional. b2 will build without them, but video writing
won't be available.

- FFmpeg libs (I used `ffmpeg @4.2.1_2+gpl2` from MacPorts)
- FFmpeg libs (should work with FFmpeg 4 or above)

Video writing on macOS is experimental.
Yuu can get these from MacPorts or Homebrew.

# Linux prerequisites

Expand All @@ -39,26 +46,17 @@ ticked.

## Additional prerequisites for video writing

There are additional dependencies for video writing, which are
optional. The project will build without these, but video writing
These are optional. b2 will build without them, but video writing
won't be available.

- `libx264-dev` apt package
- `FFmpeg` libs: libavcodec 58+, libavformat 58+, libavutil 56+,
libswresample 3+, libswscale 5+ - not sure about the version
numbering here, but this seems to correspond to FFmpeg 4.1.
libswresample 3+, libswscale 5+ (this corresponds to FFmpeg 4 or
later)

Watch out for older package manager versions of FFmpeg! It's easy to
build from [the FFmpeg github repo](https://github.com/FFmpeg/FFmpeg),
though. (I used configure options `--enable-libx264 --enable-gpl
--enable-shared`. I had to re-run `ldconfig` after doing `make
install` so the system could find the new libraries.)

# Common prerequisites

- [cmake](https://cmake.org/) version 3.20+ on the PATH (I built it from [the CMake github repo](https://github.com/Kitware/CMake))
- [ninja](https://ninja-build.org/) (build from the [Ninja github repo](https://github.com/ninja-build/ninja), install from MacPorts, etc.)
- Python 3.x
FFmpeg is easy enough to build from the [the FFmpeg github
repo](https://github.com/FFmpeg/FFmpeg) if the package manager version
doesn't suit.

# Building

Expand All @@ -83,7 +81,10 @@ Day-to-day build steps:

2. Run `ninja` to build. If building with gcc, note that it is normal
for this to take longer than you might like. Build times with clang
are a bit better
are a bit better. It may use a lot of RAM in either case

(`ninja -j 1` will run max 1 job at once, possibly worth trying on
Linux if the build awakens the OOM killer)

3. Run `ninja test` to run the automated tests (this might take a few
minutes - they should all pass)
Expand Down
Loading

0 comments on commit 62a6aec

Please sign in to comment.