Unverified Commit 60bfd9f7 authored by Fernando Rodrigues's avatar Fernando Rodrigues Committed by GitHub
Browse files

openmw: 0.48.0 -> 0.49.0 (#422562)

parents f6b4459b f63a34fc
Loading
Loading
Loading
Loading
+54 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  boost,
  libxml2,
  minizip,
  readline,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "collada-dom";
  version = "2.5.1";

  __structuredAttrs = true;
  strictDeps = true;

  src = fetchFromGitHub {
    owner = "Gepetto";
    repo = "collada-dom";
    tag = "v${finalAttrs.version}";
    hash = "sha256-DYdqrwRIrVq0BQqZB0vtZzADteJGVaJtFC5kC/cD250=";
  };

  postInstall = ''
    ln -s $out/include/*/* $out/include
  '';

  nativeBuildInputs = [ cmake ];

  buildInputs = [
    boost
    libxml2
    minizip
    readline
  ];

  meta = {
    description = "API that provides a C++ object representation of a COLLADA XML instance document";
    longDescription = "This is a fork of [rdiankov/collada-dom](https://github.com/rdiankov/collada-dom) which has been unmaintained for six years.";
    homepage = "https://github.com/Gepetto/collada-dom";
    changelog = "https://github.com/Gepetto/collada-dom/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      sigmasquadron
      marius851000
    ];
    platforms = lib.platforms.all;

    # Fails to build.
    badPlatforms = lib.platforms.darwin;
  };
})
+0 −20
Original line number Diff line number Diff line
diff --git a/CMake/Utils/MyGUIConfigTargets.cmake b/CMake/Utils/MyGUIConfigTargets.cmake
index 7e279c986..b33f097c0 100644
--- a/CMake/Utils/MyGUIConfigTargets.cmake
+++ b/CMake/Utils/MyGUIConfigTargets.cmake
@@ -418,15 +418,6 @@ function(mygui_config_lib PROJECTNAME)
 		if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
 			# add GCC visibility flags to shared library build
 			set_target_properties(${PROJECTNAME} PROPERTIES COMPILE_FLAGS "${MYGUI_GCC_VISIBILITY_FLAGS}")
-			if (APPLE)
-				# deal with Mac OS X's framework system
-				set_target_properties(${PROJECTNAME} PROPERTIES FRAMEWORK TRUE)
-				set_target_properties(${PROJECTNAME} PROPERTIES PUBLIC_HEADER "${${PROJECTNAME}_HEADERS}")
-				set_target_properties(${PROJECTNAME} PROPERTIES OUTPUT_NAME ${PROJECTNAME})
-				set_target_properties(${PROJECTNAME} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
-				set_target_properties(${PROJECTNAME} PROPERTIES BUILD_WITH_INSTALL_NAME_DIR TRUE)
-				set_target_properties(${PROJECTNAME} PROPERTIES INSTALL_NAME_DIR "@executable_path/../lib")
-			endif (APPLE)
 		endif ()
 	endif (MYGUI_STATIC)
 	mygui_install_target(${PROJECTNAME} "")
+26 −12
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  stdenv,
  fetchFromGitHub,
  fetchpatch,
  cmake,
  pkg-config,
  boost,
@@ -18,19 +19,26 @@
let
  renderSystem = if withOgre then "3" else "4";
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "mygui";
  version = "3.4.2";
  version = "3.4.3";

  __structuredAttrs = true;
  strictDeps = true;

  src = fetchFromGitHub {
    owner = "MyGUI";
    repo = "mygui";
    rev = "MyGUI${version}";
    hash = "sha256-yBV0ImOFJlqBPqqOjXYe4SFO2liSGZCEwvehED5Ubj4=";
    tag = "MyGUI${finalAttrs.version}";
    hash = "sha256-qif9trHgtWpYiDVXY3cjRsXypjjjgStX8tSWCnXhXlk=";
  };

  patches = [
    ./disable-framework.patch
    (fetchpatch {
      name = "darwin-mygui-framework-fix.patch";
      url = "https://gitlab.com/OpenMW/openmw-dep/-/raw/ade30e6e98c051ac2a505f6984518f5f41fa87a5/macos/mygui.patch";
      sha256 = "sha256-Tk+O4TFgPZOqWAY4c0Q69bZfvIB34wN9e7h0tXhLULU=";
    })
  ];

  nativeBuildInputs = [
@@ -57,15 +65,21 @@ stdenv.mkDerivation rec {

  # Tools are disabled due to compilation failures.
  cmakeFlags = [
    "-DMYGUI_BUILD_TOOLS=OFF"
    "-DMYGUI_BUILD_DEMOS=OFF"
    "-DMYGUI_RENDERSYSTEM=${renderSystem}"
    (lib.cmakeBool "MYGUI_BUILD_DEMOS" false)
    (lib.cmakeBool "MYGUI_BUILD_TOOLS" false)
    (lib.cmakeBool "MYGUI_DONT_USE_OBSOLETE" true)
    (lib.cmakeFeature "MYGUI_RENDERSYSTEM" renderSystem)
  ];

  meta = with lib; {
  meta = {
    homepage = "http://mygui.info/";
    changelog = "https://github.com/MyGUI/mygui/releases/tag/MyGUI${finalAttrs.version}";
    description = "Library for creating GUIs for games and 3D applications";
    license = licenses.mit;
    platforms = platforms.unix;
    maintainers = with lib.maintainers; [ sigmasquadron ];
    license = lib.licenses.mit;
    platforms = lib.platforms.unix;

    # error: implicit instantiation of undefined template 'std::char_traits'
    badPlatforms = lib.platforms.darwin;
  };
}
})
+149 −0
Original line number Diff line number Diff line
@@ -3,46 +3,61 @@
  stdenv,
  fetchFromGitLab,
  fetchpatch,
  cmake,
  pkg-config,
  wrapQtAppsHook,

  SDL2,
  boost,
  bullet,
  # Please unpin this on the next OpenMW release.
  ffmpeg_6,
  cmake,
  collada-dom,
  ffmpeg,
  libXt,
  lua,
  luajit,
  lz4,
  mygui,
  openal,
  openscenegraph,
  pkg-config,
  qt6Packages,
  recastnavigation,
  unshield,
  yaml-cpp,
}:

  GLPreference ? "GLVND",
}:
let
  GL = "GLVND"; # or "LEGACY";
  inherit (stdenv.hostPlatform) isDarwin isLinux isAarch64;
  isAarch64Linux = isLinux && isAarch64;
in
assert lib.assertOneOf "GLPreference" GLPreference [
  "GLVND"
  "LEGACY"
];
stdenv.mkDerivation (finalAttrs: {
  pname = "openmw";
  version = "0.49.0";

  __structuredAttrs = true;
  strictDeps = true;

  osg' = (openscenegraph.override { colladaSupport = true; }).overrideDerivation (old: {
    patches = [
  osg' = (openscenegraph.override { colladaSupport = true; }).overrideAttrs (oldAttrs: {
    patches = (oldAttrs.patches or [ ]) ++ [
      (fetchpatch {
        # Darwin: Without this patch, OSG won't build osgdb_png.so, which is required by OpenMW.
        name = "darwin-osg-plugins-fix.patch";
        url = "https://gitlab.com/OpenMW/openmw-dep/-/raw/0abe3c9c3858211028d881d7706813d606335f72/macos/osg.patch";
        sha256 = "sha256-/CLRZofZHot8juH78VG1/qhTHPhy5DoPMN+oH8hC58U=";
        url = "https://gitlab.com/OpenMW/openmw-dep/-/raw/1305497c009dc0e7a6a70fe14f0a2f92b96cbcb4/macos/osg.patch";
        hash = "sha256-G8Y+fnR6FRGxECWrei/Ixch3A3PkRfH6b5q9iawsSCY=";
      })
    ];
    cmakeFlags =
      (old.cmakeFlags or [ ])
      (oldAttrs.cmakeFlags or [ ])
      ++ [
        "-Wno-dev"
        "-DOpenGL_GL_PREFERENCE=${GL}"
        "-DBUILD_OSG_PLUGINS_BY_DEFAULT=0"
        "-DBUILD_OSG_DEPRECATED_SERIALIZERS=0"
        (lib.cmakeFeature "OpenGL_GL_PREFERENCE" GLPreference)
        (lib.cmakeBool "BUILD_OSG_PLUGINS_BY_DEFAULT" false)
        (lib.cmakeBool "BUILD_OSG_DEPRECATED_SERIALIZERS" false)
      ]
      ++ (map (e: "-DBUILD_OSG_PLUGIN_${e}=1") [
      ++ (map (plugin: lib.cmakeBool "BUILD_OSG_PLUGIN_${plugin}" true) [
        "BMP"
        "DAE"
        "DDS"
@@ -54,77 +69,81 @@ let
      ]);
  });

  bullet' = bullet.overrideDerivation (old: {
    cmakeFlags = (old.cmakeFlags or [ ]) ++ [
  bullet' = bullet.overrideAttrs (oldAttrs: {
    cmakeFlags = (oldAttrs.cmakeFlags or [ ]) ++ [
      "-Wno-dev"
      "-DOpenGL_GL_PREFERENCE=${GL}"
      "-DUSE_DOUBLE_PRECISION=ON"
      "-DBULLET2_MULTITHREADING=ON"
      (lib.cmakeFeature "OpenGL_GL_PREFERENCE" GLPreference)
      (lib.cmakeBool "USE_DOUBLE_PRECISION" true)
      (lib.cmakeBool "BULLET2_MULTITHREADING" true)
    ];
  });

in
stdenv.mkDerivation rec {
  pname = "openmw";
  version = "0.48.0";

  src = fetchFromGitLab {
    owner = "OpenMW";
    repo = "openmw";
    rev = "${pname}-${version}";
    hash = "sha256-zkjVt3GfQZsFXl2Ht3lCuQtDMYQWxhdFO4aGSb3rsyo=";
    tag = "openmw-${finalAttrs.version}";
    hash = "sha256-Eyjn3jPpo0d7XENg0Ea/3MN60lZBSUAMkz1UtTiIP80=";
  };

  patches = [ ./0001-function-inclusion-fixes-for-gcc14.patch ];

  postPatch = ''
    sed '1i#include <memory>' -i components/myguiplatform/myguidatamanager.cpp # gcc12
  ''
  + lib.optionalString stdenv.hostPlatform.isDarwin ''
  # Don't fix Darwin app bundle
  + lib.optionalString isDarwin ''
    sed -i '/fixup_bundle/d' CMakeLists.txt
  '';

  nativeBuildInputs = [
    cmake
    pkg-config
  ]
  ++ (with qt6Packages; [
    wrapQtAppsHook
  ];
  ]);

  # If not set, OSG plugin .so files become shell scripts on Darwin.
  dontWrapQtApps = stdenv.hostPlatform.isDarwin;
  dontWrapQtApps = isDarwin;

  buildInputs = [
    SDL2
    boost
    bullet'
    ffmpeg_6
    collada-dom
    ffmpeg
    libXt
    luajit
    (if isAarch64Linux then lua else luajit)
    lz4
    mygui
    openal
    osg'
    recastnavigation
    unshield
    yaml-cpp
  ];
  ]
  ++ (with qt6Packages; [
    qttools
  ])
  ++ (with finalAttrs; [
    bullet'
    osg'
  ]);

  cmakeFlags = [
    "-DOpenGL_GL_PREFERENCE=${GL}"
    "-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=1"
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    "-DOPENMW_OSX_DEPLOYMENT=ON"
    (lib.cmakeFeature "OpenGL_GL_PREFERENCE" GLPreference)
    (lib.cmakeBool "USE_LUAJIT" (!isAarch64Linux))
    (lib.cmakeBool "OPENMW_USE_SYSTEM_RECASTNAVIGATION" true)
    (lib.cmakeBool "OPENMW_OSX_DEPLOYMENT" isDarwin)
  ];

  meta = with lib; {
  meta = {
    description = "Unofficial open source engine reimplementation of the game Morrowind";
    changelog = "https://gitlab.com/OpenMW/openmw/-/blob/${finalAttrs.src.tag}/CHANGELOG.md";
    homepage = "https://openmw.org";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [
      marius851000
      sigmasquadron
    ];
    platforms = platforms.linux ++ platforms.darwin;
    platforms = with lib.platforms; linux ++ darwin ++ windows;
    # Nixpkgs' NT infrastructure is currently incapable of building this.
    badPlatforms = lib.platforms.windows;
  };
}
})
+4 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
  curlSupport ? true,
  curl,
  colladaSupport ? false,
  opencollada,
  collada-dom,
  opencascadeSupport ? false,
  opencascade-occt,
  ffmpegSupport ? false,
@@ -98,7 +98,7 @@ stdenv.mkDerivation rec {
    ++ lib.optional gdalSupport gdal
    ++ lib.optional curlSupport curl
    ++ lib.optionals colladaSupport [
      opencollada
      collada-dom
      pcre
    ]
    ++ lib.optional opencascadeSupport opencascade-occt
@@ -115,6 +115,8 @@ stdenv.mkDerivation rec {
    ++ lib.optionals withExamples [ fltk ]
    ++ lib.optional (restSupport || colladaSupport) boost;

  env = lib.optionalAttrs colladaSupport { COLLADA_DIR = collada-dom; };

  patches = [
    (fetchpatch {
      name = "opencascade-api-patch";
Loading