Written offer of source code
============================

Black & White for Mac 0.4.0 contains FFmpeg 8.1.2, which is free software
under the GNU Lesser General Public License (LGPL), version 2.1 or later.
Its licence text is in the FFmpeg folder of this Licenses folder. The
libraries were built without any GPL or non-free part.

The libraries
-------------
  libavcodec, libavformat, libavutil, libswresample, libswscale
  (FFmpeg 8.1.2, LGPL version 2.1 or later)

Where the source code is
------------------------
The authors publish the source code of exactly this version:

  https://ffmpeg.org/releases/ffmpeg-8.1.2.tar.xz
  SHA-256 464beb5e7bf0c311e68b45ae2f04e9cc2af88851abb4082231742a74d97b524c

How the files in the app were made
----------------------------------
They were built from that source, unchanged, on a Mac with Apple silicon:

  ./configure --prefix=/opt/ffmpeg-lgpl --cc=clang --enable-shared
      --disable-static --enable-pthreads --enable-neon --disable-gpl
      --disable-nonfree --disable-autodetect --enable-zlib --enable-bzlib
      --disable-iconv --disable-network --disable-doc --disable-debug
      --disable-ffplay --disable-avdevice
  make
  make install DESTDIR=<an empty folder>

When the app was put together, the paths inside each file that tell it where
to find the other libraries were rewritten to point inside the app, and each
file was signed again (ad hoc).

Using a build of your own
-------------------------
The five libraries are separate files in Contents/Frameworks inside
"Black & White.app". To run the game with an FFmpeg you built yourself
(version 8.1.x, so that the library version numbers 62, 62, 60, 6 and 9 are
the same), put your build's files of the same names over them, then, in a
Terminal, from inside "Black & White.app/Contents/Frameworks":

  for f in libavcodec.62 libavformat.62 libavutil.60 libswresample.6 libswscale.9; do
    install_name_tool -id "@rpath/$f.dylib" "$f.dylib"
    for old in $(otool -L "$f.dylib" | awk '/lib(avcodec|avformat|avutil|swresample|swscale)\.[0-9]+\.dylib/ {print $1}' | grep -v "^@rpath/"); do
      install_name_tool -change "$old" "@rpath/$(basename "$old")" "$f.dylib"
    done
    codesign --force --sign - "$f.dylib"
  done
  codesign --force --deep --sign - ../..

The first command makes each library name itself and the other four by
their place inside the app; the others sign the changed files and the app
again, which macOS needs on Apple silicon.

The offer
---------
Anyone who has this download may ask for the complete corresponding source
code of the libraries above, as they are in the download. It will be
provided free of charge, as a download or a file, within a reasonable time.
This offer is valid for at least three years from the day this release was
published, and for as long as the download is offered.

To ask, open an issue at https://github.com/AOJ222/BlackAndWhite-macOS/issues

Nothing in this offer limits your rights under the licences of these
libraries.
