Unverified Commit 0e8202c6 authored by Arne Keller's avatar Arne Keller Committed by GitHub
Browse files

python3Packages.openusd: 25.02a -> 25.05; opensubdiv: fix static target path (#408041)

parents 7f149484 cb681b58
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
diff --git a/opensubdiv-config.cmake.in b/opensubdiv-config.cmake.in
index 08a005aa..48fd2cdc 100644
--- a/opensubdiv-config.cmake.in
+++ b/opensubdiv-config.cmake.in
@@ -1,6 +1,6 @@
 @PACKAGE_INIT@
 
-set_and_check(OpenSubdiv_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@")
-set_and_check(OpenSubdiv_LIB_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@")
+set(OpenSubdiv_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
+set(OpenSubdiv_LIB_DIR "@CMAKE_INSTALL_FULL_LIBDIR@")
 
 include("${CMAKE_CURRENT_LIST_DIR}/OpenSubdivTargets.cmake")
+16 −3
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ stdenv.mkDerivation (finalAttrs: {
    ++ lib.optionals cudaSupport [
      cudaPackages.cuda_nvcc
    ];

  buildInputs =
    lib.optionals stdenv.hostPlatform.isUnix [
      libGLU
@@ -55,12 +56,18 @@ stdenv.mkDerivation (finalAttrs: {
      xorg.libXinerama
      xorg.libXi
    ]
    ++ lib.optionals (openclSupport && stdenv.hostPlatform.isLinux) [ ocl-icd ]

    ++ lib.optionals (openclSupport && stdenv.hostPlatform.isLinux) [
      ocl-icd
    ]
    ++ lib.optionals cudaSupport [
      cudaPackages.cuda_cudart
    ];

  patches = [
    # Prevent CMake from generating a redundant nested path like /nix/store/.../nix/store/...
    ./cmake-config.patch
  ];

  # It's important to set OSD_CUDA_NVCC_FLAGS,
  # because otherwise OSD might piggyback unwanted architectures:
  # https://github.com/PixarAnimationStudios/OpenSubdiv/blob/7d0ab5530feef693ac0a920585b5c663b80773b3/CMakeLists.txt#L602
@@ -105,7 +112,13 @@ stdenv.mkDerivation (finalAttrs: {
      ''
    else
      ''
        moveToOutput "lib/*.a" $static
        moveToOutput "lib/libosd*.a" $static
      '';

  postFixup = ''
    # Adjust static library path to reflect relocation to $static
    sed -i -E "s|\\\$\{_IMPORT_PREFIX\}/lib/(libosd.*\.a)|$static/lib/\1|" \
      $dev/lib/cmake/OpenSubdiv/OpenSubdivTargets-release.cmake
  '';

  meta = {
+21 −15
Original line number Diff line number Diff line
@@ -8,13 +8,14 @@
  libxml2,
  zlib,
  openexr,
  openimageio_2,
  openimageio,
  llvm,
  boost,
  flex,
  bison,
  partio,
  pugixml,
  robin-map,
  util-linux,
  python3,
}:
@@ -22,15 +23,15 @@
let
  boost_static = boost.override { enableStatic = true; };
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "openshadinglanguage";
  version = "1.13.11.0";
  version = "1.14.5.1";

  src = fetchFromGitHub {
    owner = "AcademySoftwareFoundation";
    repo = "OpenShadingLanguage";
    rev = "v${version}";
    hash = "sha256-E/LUTtT0ZU0SBuwtJPA0FznvOuc2a3aJn2/n3ru5l0s=";
    rev = "v${finalAttrs.version}";
    hash = "sha256-dmGVCx4m2bkeKhAJbU1mrzEDAmnL++7GA5okb9wwk/Y=";
  };

  cmakeFlags = [
@@ -43,12 +44,16 @@ stdenv.mkDerivation rec {
    "-DLLVM_DIRECTORY=${llvm}"
    "-DLLVM_CONFIG=${llvm.dev}/bin/llvm-config"
    "-DLLVM_BC_GENERATOR=${clang}/bin/clang++"

    # Set C++11 to C++14 required for LLVM10+
    "-DCMAKE_CXX_STANDARD=14"
  ];

  preConfigure = "patchShebangs src/liboslexec/serialize-bc.bash ";
  prePatch = ''
    substituteInPlace src/cmake/modules/FindLLVM.cmake \
      --replace-fail "NO_DEFAULT_PATH" ""
  '';

  preConfigure = ''
    patchShebangs src/liboslexec/serialize-bc.bash
  '';

  nativeBuildInputs = [
    bison
@@ -63,10 +68,11 @@ stdenv.mkDerivation rec {
      libclang
      llvm
      openexr
      openimageio_2
      openimageio
      partio
      pugixml
      python3.pkgs.pybind11
      robin-map
      util-linux # needed just for hexdump
      zlib
    ]
@@ -79,11 +85,11 @@ stdenv.mkDerivation rec {
      --replace '=''${exec_prefix}//' '=/'
  '';

  meta = with lib; {
  meta = {
    description = "Advanced shading language for production GI renderers";
    homepage = "https://opensource.imageworks.com/osl.html";
    maintainers = with maintainers; [ hodapp ];
    license = licenses.bsd3;
    platforms = platforms.unix;
    maintainers = with lib.maintainers; [ hodapp ];
    license = lib.licenses.bsd3;
    platforms = lib.platforms.unix;
  };
}
})
+8 −6
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
  ninja,
  numpy,
  opencolorio,
  openimageio_2,
  openimageio,
  opensubdiv,
  osl,
  ptex,
@@ -51,14 +51,14 @@ in

buildPythonPackage rec {
  pname = "openusd";
  version = "25.02a";
  version = "25.05.01";
  pyproject = false;

  src = fetchFromGitHub {
    owner = "PixarAnimationStudios";
    repo = "OpenUSD";
    tag = "v${version}";
    hash = "sha256-QFwG6kOLM+R+QIAozk/Dbldj8LRt9kCJv0W/EGHkq6Q=";
    hash = "sha256-gxikEC4MqTkhgYaRsCVYtS/VmXClSaCMdzpQ0LmiR7Q=";
  };

  stdenv = python.stdenv;
@@ -69,8 +69,8 @@ buildPythonPackage rec {
    (fetchpatch {
      name = "port-to-embree-4.patch";
      # https://github.com/PixarAnimationStudios/OpenUSD/pull/2266
      url = "https://github.com/PixarAnimationStudios/OpenUSD/commit/a07a6b4d1da19bfc499db49641d74fb7c1a71e9b.patch?full_index=1";
      hash = "sha256-Gww6Ll2nKwpcxMY9lnf5BZ3eqUWz1rik9P3mPKDOf+Y=";
      url = "https://github.com/PixarAnimationStudios/OpenUSD/commit/9ea3bc1ab550ec46c426dab04292d9667ccd2518.patch?full_index=1";
      hash = "sha256-QjA3kjUDsSleUr+S/bQLb+QK723SNFvnmRPT+ojjgq8=";
    })
  ];

@@ -100,6 +100,8 @@ buildPythonPackage rec {
      cmake
      ninja
      setuptools
      opensubdiv.dev
      opensubdiv.static
    ]
    ++ lib.optionals withDocs [
      git
@@ -118,7 +120,7 @@ buildPythonPackage rec {
      imath
      materialx
      opencolorio
      openimageio_2
      openimageio
      opensubdiv
      ptex
      tbb
+3 −3
Original line number Diff line number Diff line
@@ -4070,9 +4070,9 @@ with pkgs;
  };
  osl = libsForQt5.callPackage ../development/compilers/osl {
    libclang = llvmPackages_15.libclang;
    clang = clang_15;
    llvm = llvm_15;
    libclang = llvmPackages_19.libclang;
    clang = clang_19;
    llvm = llvm_19;
  };
  ossec-agent = callPackage ../tools/security/ossec/agent.nix { };