Skip to content

Support for MacOS machines#1

Open
RamizGindullin wants to merge 7 commits intostgatilov:masterfrom
RamizGindullin:remove_dependency_fallback_logic
Open

Support for MacOS machines#1
RamizGindullin wants to merge 7 commits intostgatilov:masterfrom
RamizGindullin:remove_dependency_fallback_logic

Conversation

@RamizGindullin
Copy link
Copy Markdown

@RamizGindullin RamizGindullin commented Mar 26, 2026

#MacOS installation guide:

On MacOS Use Terminal:

  1. Go to the installation directory:
cd tdm_installer/zipsync
mkdir build && cd build
  1. brew install minizip b2sum libb2 doctest libmicrohttpd libzip
  2. Install Taywee/args:
     -o /opt/homebrew/include/args.hxx
  1. compile the installator via Terminal:
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
  1. Run the installer (version 2.14; for updated manifests check the link below):
BASE=http://tdm.frydrych.org/mirror/zipsync
./zipsync update --clean \
  -r <path to your installation> \
  -t $BASE/release/release214_from_release213/manifest.iniz \
  -p $BASE/release/release213_from_release212/manifest.iniz \
  -p $BASE/release/release212_from_release211/manifest.iniz \
  -p $BASE/release/release211_from_release210/manifest.iniz \
  -p $BASE/release/release210_from_release209/manifest.iniz \
  -p $BASE/release/release209_from_release208/manifest.iniz \
  -p $BASE/release/release208_from_release207/manifest.iniz \
  -p $BASE/release/release207_from_release206/manifest.iniz \
  -p $BASE/release/release206_from_release205/manifest.iniz \
  -p $BASE/release/release205_from_release204/manifest.iniz \
  -p $BASE/release/release204_from_release203/manifest.iniz \
  -p $BASE/release/release203_from_release202/manifest.iniz \
  -p $BASE/release/release202_from_release201/manifest.iniz \
  -p $BASE/release/release201_from_release200/manifest.iniz \
  -p $BASE/release/release200/manifest.iniz

Paths to manifests:
[https://update.thedarkmod.com/zipsync/tdm_installer.ini](https://update.thedarkmod.com/zipsync/tdm_installer.ini%60)

Compiled and tested on Apple Silicon machine (the dark mod pk4 files downloaded without errors). It should work with Intel machines as well. All the changes are made with the compatibility with Windows and Linux in mind, meaning that the backwards compatibility is not broken (hopefully).

I've attached compiled files as well.

I used the files from https://github.com/stgatilov/darkmod_src/blob/trunk/tdm_installer/zipsync/ as it was the latest version.

#MacOS installation guide:

Use Terminal:

1. Go to the instalation directory:
```
cd tdm_installer/zipsync
mkdir build && cd build
```
2. `brew install minizip b2sum libb2 doctest libmicrohttpd libzip`
3. Install `Taywee/args`:
```curl -L https://raw.githubusercontent.com/Taywee/args/master/args.hxx \
     -o /opt/homebrew/include/args.hxx```
4. compile the installator via Terminal:
```
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
```

5. Run the installer (version 2.14; for updated manifests check the link below):
```
BASE=http://tdm.frydrych.org/mirror/zipsync
./zipsync update --clean \
  -r <path to your installation> \
  -t $BASE/release/release214_from_release213/manifest.iniz \
  -p $BASE/release/release213_from_release212/manifest.iniz \
  -p $BASE/release/release212_from_release211/manifest.iniz \
  -p $BASE/release/release211_from_release210/manifest.iniz \
  -p $BASE/release/release210_from_release209/manifest.iniz \
  -p $BASE/release/release209_from_release208/manifest.iniz \
  -p $BASE/release/release208_from_release207/manifest.iniz \
  -p $BASE/release/release207_from_release206/manifest.iniz \
  -p $BASE/release/release206_from_release205/manifest.iniz \
  -p $BASE/release/release205_from_release204/manifest.iniz \
  -p $BASE/release/release204_from_release203/manifest.iniz \
  -p $BASE/release/release203_from_release202/manifest.iniz \
  -p $BASE/release/release202_from_release201/manifest.iniz \
  -p $BASE/release/release201_from_release200/manifest.iniz \
  -p $BASE/release/release200/manifest.iniz
```

Paths to manifests:
`https://update.thedarkmod.com/zipsync/tdm_installer.ini`

Compiled and tested on Apple Silicon machine but should work with Intel machines as well. All the changes are made with the compatibility with Windows and Linux in mind, meaning that the backwards compatibility is not broken (hopefully).

I've attached compiled files as well.
It was accidentally removed during the previous update
Seems it wasn't a mistake at all ( a difference in versions between stgatilov/darkmod_src/tree/trunk/tdm_installer/zipsync and stgatilov/zipsync )
Copy link
Copy Markdown
Owner

@stgatilov stgatilov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TheDarkMod does not support MacOS, and there is no way to build Mac binaries right now, I believe.
So players have to use some kind of emulation (Wine or something to run Linux binaries).
And if they do so, can't they just run tdm_installer in the same emulation?
What is the point in supporting native MacOS build here?

CMakeLists.txt Outdated

# Check if C++17 filesystem is available
set(CMAKE_CXX_STANDARD 17)
check_cxx_source_compiles(
Copy link
Copy Markdown
Owner

@stgatilov stgatilov Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will soon upgrade GCC version and enable C++17 globally in TheDarkMod.
There is no need for all this weirdness with checking availability.
Until then it's C++11/C++14 for everyone and filesystem is used from experimental/tr1/etc.

Copy link
Copy Markdown
Author

@RamizGindullin RamizGindullin Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TheDarkMod does not support MacOS, and there is no way to build Mac binaries right now, I believe.
So players have to use some kind of emulation (Wine or something to run Linux binaries).
And if they do so, can't they just run tdm_installer in the same emulation?
What is the point in supporting native MacOS build here?

Well, it was my way of starting to see how to support TDM natively of MacOS -- first by learning how to download pk4 files, then (I guess) to see if I can compile tdm-installer and then go to the project itself.

I'll be honest, I don't have experience with c/c++ (my competences lie in different area), but I want to see if I can make the game run natively

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yesterday, I have updated baseline TheDarkMod to C++17 completely. I'll update this repo soon.
There will be no reason for this "check if compiles" thing too.

As for the core TDM game, I did clean the compilation some time ago by trying to cross-compile it for ARM64 on Linux x86-64. But that would be a much harder task because 1) there is windows/linux-specific parts of code, but mac-specific part has been stale for years, and 2) there are many more third-party dependencies, a lot of them have custom-tuned conan recipes and might not build immediately.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the repo.

// system clock's "now", bridging between the two clocks' epochs.
// The two now() calls introduce a negligible (~nanosecond) imprecision,
// which is acceptable for file timestamp purposes.
auto sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>(
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this is indeed and interesting problem.
It turns out that while there exists a way to read file modification time, there is no standard way to understand what this value actually means =)
I guess the only way to do it is using various OS-specific or messy ways...

This function is used for writing timestamps into .zipsync/lastscan.ini so that tdm_installer does not have to scan the whole installation if core pk4 files were not modified. It is very important that we get the same value on the same machine no matter how many times we ask, and I think the solution with now does not guarantee that.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally I "fixed" the problem simply by using experimental/filesystem on all platforms.
I tends to builds fine on latest MSVC/GCC/Clang on godbolt.
Some years later when TDM switches to C++20, we can probably use the standard filesystem finally.

But I see reports on the internet that it has been deleted in the latest Clang standard library, which is sad.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling that the best way to solve it now is to just read POSIX mtime timestamp with stat function. And use this mess only when __has_include reports that experimental/filesystem does not exist.

@RamizGindullin
Copy link
Copy Markdown
Author

I looked at Conan (what it is and how does it work) and now see why it is possible to make CMakeLists.txt as simple as it was. I've updated my repo (updated files conanfile.py and CMakeLists.txt, uploaded the bash script file conan_build.sh). Basically, I've reverted my dependency checks and switched two of the existing dependencies for a couple of libraries to their equivalents in ConanCenter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants