Skip to content

ois: fix cmake 4 compatibility#449741

Merged
yayayayaka merged 1 commit intoNixOS:masterfrom
SchweGELBin:ois-fix
Oct 10, 2025
Merged

ois: fix cmake 4 compatibility#449741
yayayayaka merged 1 commit intoNixOS:masterfrom
SchweGELBin:ois-fix

Conversation

@SchweGELBin
Copy link
Member

@SchweGELBin SchweGELBin commented Oct 8, 2025

See #445447

It fixes the cmake version issue.

The package doesn't build because of another reason.
I couldn't find a good solution for it.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Oct 8, 2025
@nix-owners nix-owners bot requested a review from 7c6f434c October 8, 2025 00:53
@SigmaSquadron
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 449741 --package ois
Commit: fcca79ae4e10cd9d30b80221b3da8491110777d2


x86_64-linux

❌ 1 package failed to build:
  • ois

Error logs: `x86_64-linux`
ois
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Configuring done (3.1s)
CMake Error at CMakeLists.txt:191 (add_dependencies):
  The dependency target "X11" of target "OIS" does not exist.

-- Generating done (0.0s)
CMake Warning:
Manually-specified variables were not used by the project:

BUILD_TESTING
CMAKE_EXPORT_NO_PACKAGE_REGISTRY
CMAKE_POLICY_DEFAULT_CMP0025

CMake Generate step failed. Build files cannot be regenerated correctly.

@SuperSandroBot
Copy link

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 449741
Commit: fcca79ae4e10cd9d30b80221b3da8491110777d2 (subsequent changes)
Merge: 6d76778892106cf8fbfcea5c357b10edb7e7f001

Logs: https://github.com/SuperSandro2000/nixpkgs-review-gha/actions/runs/18376410789


x86_64-linux

❌ 10 packages failed to build:
  • cegui
  • mygui
  • ogre (ogre_14)
  • ogre_13
  • ois
  • opendungeons
  • openmw
  • portmod
  • portmod.dist
  • stuntrally

Error logs: `x86_64-linux`
ois
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Configuring done (6.4s)
CMake Error at CMakeLists.txt:191 (add_dependencies):
  The dependency target "X11" of target "OIS" does not exist.

-- Generating done (0.2s)
CMake Warning:
Manually-specified variables were not used by the project:

BUILD_TESTING
CMAKE_EXPORT_NO_PACKAGE_REGISTRY
CMAKE_POLICY_DEFAULT_CMP0025

CMake Generate step failed. Build files cannot be regenerated correctly.


aarch64-linux

❌ 10 packages failed to build:
  • cegui
  • mygui
  • ogre (ogre_14)
  • ogre_13
  • ois
  • opendungeons
  • openmw
  • portmod
  • portmod.dist
  • stuntrally

Error logs: `aarch64-linux`
ois
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Configuring done (2.7s)
CMake Error at CMakeLists.txt:191 (add_dependencies):
  The dependency target "X11" of target "OIS" does not exist.

-- Generating done (0.1s)
CMake Warning:
Manually-specified variables were not used by the project:

BUILD_TESTING
CMAKE_EXPORT_NO_PACKAGE_REGISTRY
CMAKE_POLICY_DEFAULT_CMP0025

CMake Generate step failed. Build files cannot be regenerated correctly.


x86_64-darwin (sandbox = true)

❌ 1 package failed to build:
  • cegui
✅ 3 packages built:
  • ogre (ogre_14)
  • ogre_13
  • ois

Error logs: `x86_64-darwin`
cegui
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/cmj85v2dpz57c2g8xr08yivx2wnw5kf1-source
source root is source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/is78525jp059m5c3zx7gqjblzpfksgds-cegui-0-unstable-2025-04-06/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/is78525jp059m5c3zx7gqjblzpfksgds-cegui-0-unstable-2025-04-06/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/is78525jp059m5c3zx7gqjblzpfksgds-cegui-0-unstable-2025-04-06/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/is78525jp059m5c3zx7gqjblzpfksgds-cegui-0-unstable-2025-04-06/share/doc/cegui -DCMAKE_INSTALL_INFODIR=/nix/store/is78525jp059m5c3zx7gqjblzpfksgds-cegui-0-unstable-2025-04-06/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/is78525jp059m5c3zx7gqjblzpfksgds-cegui-0-unstable-2025-04-06/share/man -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/is78525jp059m5c3zx7gqjblzpfksgds-cegui-0-unstable-2025-04-06/include -DCMAKE_INSTALL_SBINDIR=/nix/store/is78525jp059m5c3zx7gqjblzpfksgds-cegui-0-unstable-2025-04-06/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/is78525jp059m5c3zx7gqjblzpfksgds-cegui-0-unstable-2025-04-06/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/is78525jp059m5c3zx7gqjblzpfksgds-cegui-0-unstable-2025-04-06/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/lm587kamzj0dkk3118i5gncn2jwl4rab-clang-wrapper-21.1.1/bin/strip -DCMAKE_RANLIB=/nix/store/lm587kamzj0dkk3118i5gncn2jwl4rab-clang-wrapper-21.1.1/bin/ranlib -DCMAKE_AR=/nix/store/lm587kamzj0dkk3118i5gncn2jwl4rab-clang-wrapper-21.1.1/bin/ar -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_PREFIX=/nix/store/is78525jp059m5c3zx7gqjblzpfksgds-cegui-0-unstable-2025-04-06 -DCEGUI_OPTION_DEFAULT_IMAGECODEC=OgreRenderer-0 -DCMAKE_OSX_ARCHITECTURES=x86_64
CMake Error at CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.

Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

-- Configuring incomplete, errors occurred!


aarch64-darwin (sandbox = true)

❌ 1 package failed to build:
  • cegui
✅ 3 packages built:
  • ogre (ogre_14)
  • ogre_13
  • ois

Error logs: `aarch64-darwin`
cegui
unpacking source archive /nix/store/cmj85v2dpz57c2g8xr08yivx2wnw5kf1-source
source root is source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/yx183mvh82lq7vdflq15m1ipma72p4sh-cegui-0-unstable-2025-04-06/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/yx183mvh82lq7vdflq15m1ipma72p4sh-cegui-0-unstable-2025-04-06/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/yx183mvh82lq7vdflq15m1ipma72p4sh-cegui-0-unstable-2025-04-06/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/yx183mvh82lq7vdflq15m1ipma72p4sh-cegui-0-unstable-2025-04-06/share/doc/cegui -DCMAKE_INSTALL_INFODIR=/nix/store/yx183mvh82lq7vdflq15m1ipma72p4sh-cegui-0-unstable-2025-04-06/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/yx183mvh82lq7vdflq15m1ipma72p4sh-cegui-0-unstable-2025-04-06/share/man -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/yx183mvh82lq7vdflq15m1ipma72p4sh-cegui-0-unstable-2025-04-06/include -DCMAKE_INSTALL_SBINDIR=/nix/store/yx183mvh82lq7vdflq15m1ipma72p4sh-cegui-0-unstable-2025-04-06/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/yx183mvh82lq7vdflq15m1ipma72p4sh-cegui-0-unstable-2025-04-06/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/yx183mvh82lq7vdflq15m1ipma72p4sh-cegui-0-unstable-2025-04-06/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/l58v977vq4qy58m1bw60bzrpkywizz2b-clang-wrapper-21.1.1/bin/strip -DCMAKE_RANLIB=/nix/store/l58v977vq4qy58m1bw60bzrpkywizz2b-clang-wrapper-21.1.1/bin/ranlib -DCMAKE_AR=/nix/store/l58v977vq4qy58m1bw60bzrpkywizz2b-clang-wrapper-21.1.1/bin/ar -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_PREFIX=/nix/store/yx183mvh82lq7vdflq15m1ipma72p4sh-cegui-0-unstable-2025-04-06 -DCEGUI_OPTION_DEFAULT_IMAGECODEC=OgreRenderer-0 -DCMAKE_OSX_ARCHITECTURES=arm64
CMake Error at CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.

Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

-- Configuring incomplete, errors occurred!

@SchweGELBin SchweGELBin marked this pull request as draft October 9, 2025 13:45
@Sirius902
Copy link
Contributor

It looks like at least for Linux targets removing this line from the CMakeLists.txt fixes the build failure? I guess this is not allowed anymore. Not sure if anything else should be done but it looks like there's a related issue upstream to update the CMakeLists.txt here.

If we're going to patch the CMakeLists.txt though I guess we should probably just patch the minimum version in the file directly so this patch should work.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 951b2b1..006b36b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.10)
 project(OIS)
 
 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CmakeModules)
@@ -218,7 +218,6 @@ endif()
 if(UNIX)
 
     if (NOT APPLE)
-        add_dependencies(OIS X11)
         target_link_libraries(OIS X11)
     endif()
 

@SchweGELBin
Copy link
Member Author

SchweGELBin commented Oct 9, 2025

@Sirius902 thank you for your message!

I'm kinda confused, why this works. OIS didn't get any updates since years. Why do we need to patch this line out now?
I understand that this line creates the problem, but why would it be there in the first place?

But if it works, I'm okay with it.

I'll wait for the upstream pr to get updated, so I can fetch the patch from there or even better: update the package, when the pr gets pulled.
Otherwise I can create a new pr upstream or add this patch here in nixpkgs only.

The package builds on darwin, so this shouldn't have any side effects, I think.

Please ping me, when there are any updates upsteam.

@SchweGELBin SchweGELBin changed the title ois: fix build against CMake >= 3.10 ois: fix cmake 4 compatibility Oct 9, 2025
@SchweGELBin
Copy link
Member Author

Hey! I think it's best to add the patch as a seperate file in this repo, until the upstream pr gets updated/pulled.

@SchweGELBin SchweGELBin marked this pull request as ready for review October 10, 2025 14:52
@yayayayaka
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 449741
Commit: 27a54cd0c8ea38f97e98777c81211ad61387163b


x86_64-linux

❌ 5 packages failed to build:
  • cegui
  • opendungeons
  • portmod
  • portmod.dist
  • stuntrally
✅ 5 packages built:
  • mygui
  • ogre (ogre_14)
  • ogre_13
  • ois
  • openmw

Error logs: `x86_64-linux`
cegui
unpacking source archive /nix/store/cmj85v2dpz57c2g8xr08yivx2wnw5kf1-source
source root is source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/7954hj3895awx2qmii1zj3yydfj2q031-cegui-0-unstable-2025-04-06/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/7954hj3895awx2qmii1zj3yydfj2q031-cegui-0-unstable-2025-04-06/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/7954hj3895awx2qmii1zj3yydfj2q031-cegui-0-unstable-2025-04-06/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/7954hj3895awx2qmii1zj3yydfj2q031-cegui-0-unstable-2025-04-06/share/doc/cegui -DCMAKE_INSTALL_INFODIR=/nix/store/7954hj3895awx2qmii1zj3yydfj2q031-cegui-0-unstable-2025-04-06/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/7954hj3895awx2qmii1zj3yydfj2q031-cegui-0-unstable-2025-04-06/share/man -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/7954hj3895awx2qmii1zj3yydfj2q031-cegui-0-unstable-2025-04-06/include -DCMAKE_INSTALL_SBINDIR=/nix/store/7954hj3895awx2qmii1zj3yydfj2q031-cegui-0-unstable-2025-04-06/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/7954hj3895awx2qmii1zj3yydfj2q031-cegui-0-unstable-2025-04-06/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/7954hj3895awx2qmii1zj3yydfj2q031-cegui-0-unstable-2025-04-06/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/dmypp1h4ldn0vfk3fi6yfyf5yxp9yz0k-gcc-wrapper-14.3.0/bin/strip -DCMAKE_RANLIB=/nix/store/dmypp1h4ldn0vfk3fi6yfyf5yxp9yz0k-gcc-wrapper-14.3.0/bin/ranlib -DCMAKE_AR=/nix/store/dmypp1h4ldn0vfk3fi6yfyf5yxp9yz0k-gcc-wrapper-14.3.0/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/7954hj3895awx2qmii1zj3yydfj2q031-cegui-0-unstable-2025-04-06 -DCEGUI_OPTION_DEFAULT_IMAGECODEC=OgreRenderer-0
CMake Error at CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

Update the VERSION argument value. Or, use the ... syntax
to tell CMake that the project requires at least but has been updated
to work with policies introduced by or earlier.

Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

-- Configuring incomplete, errors occurred!

stuntrally
Call Stack (most recent call first):
  cmake/DependenciesFunctions.cmake:294 (include)
  CMakeLists.txt:92 (resolve_conan_dependencies)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /nix/store/nbsja6vgwdy7k881iya4hz1rb2yvww3p-boost-1.83.0-dev/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0") found components: system thread filesystem wave
-- Adding Boost::Boost target
-- Adding OGRE::OGRE target
CMake Error at data/tracks/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.

Update the VERSION argument value. Or, use the ... syntax
to tell CMake that the project requires at least but has been updated
to work with policies introduced by or earlier.

Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

-- Configuring incomplete, errors occurred!

Copy link
Member

@yayayayaka yayayayaka left a comment

Choose a reason for hiding this comment

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

thanks ♥

@yayayayaka yayayayaka added this pull request to the merge queue Oct 10, 2025
Merged via the queue into NixOS:master with commit 8e3b10d Oct 10, 2025
28 of 32 checks passed
@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 10, 2025
@SchweGELBin SchweGELBin deleted the ois-fix branch October 10, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants