Skip to content

Commit

Permalink
contrib/openshadinglanguage: fix install
Browse files Browse the repository at this point in the history
  • Loading branch information
z-erica committed Jul 28, 2024
1 parent 9af0461 commit 9f39695
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
36 changes: 36 additions & 0 deletions contrib/openshadinglanguage/patches/fix_install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
fixes https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues/1771
by hardcoding the right paths

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -294,13 +294,13 @@
install (FILES "${OSL_PROJECT_CONFIG}" "${OSL_VERSION_CONFIG}"
DESTINATION "${OSL_CONFIG_INSTALL_DIR}")

-install (FILES src/cmake/llvm_macros.cmake DESTINATION cmake)
+install (FILES src/cmake/llvm_macros.cmake DESTINATION lib/cmake)

set (PERMISSION_FLAGS OWNER_EXECUTE OWNER_READ OWNER_WRITE
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ)
install (FILES src/build-scripts/serialize-bc.py
- DESTINATION build-scripts
+ DESTINATION bin
PERMISSIONS ${PERMISSION_FLAGS})

# install targets files

--- b/src/cmake/llvm_macros.cmake
+++ b/src/cmake/llvm_macros.cmake
@@ -112,9 +112,9 @@
# Serialize the linked bitcode into a CPP file
set ( src_bc_cpp "${CMAKE_CURRENT_BINARY_DIR}/${output_name}.bc.cpp" )
add_custom_command ( OUTPUT ${src_bc_cpp}
- COMMAND ${Python_EXECUTABLE} "${_THIS_MODULE_BASE_DIR}/../build-scripts/serialize-bc.py"
+ COMMAND ${Python_EXECUTABLE} "${_THIS_MODULE_BASE_DIR}/../bin/serialize-bc.py"
${linked_src_bc} ${src_bc_cpp} ${output_name}
- DEPENDS "${_THIS_MODULE_BASE_DIR}/../build-scripts/serialize-bc.py" ${linked_src_bc}
+ DEPENDS "${_THIS_MODULE_BASE_DIR}/../bin/serialize-bc.py" ${linked_src_bc}
${exec_headers} ${PROJECT_PUBLIC_HEADERS}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )

11 changes: 9 additions & 2 deletions contrib/openshadinglanguage/template.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgname = "openshadinglanguage"
pkgver = "1.13.10.0"
pkgrel = 1
pkgrel = 2
build_style = "cmake"
configure_args = [
"-DCMAKE_CXX_STANDARD=17",
Expand Down Expand Up @@ -67,7 +67,14 @@ def post_install(self):

@subpackage("openshadinglanguage-devel")
def _devel(self):
return self.default_devel()
return self.default_devel(
extra=[
# referenced by llvm_macros.cmake
# original installed to usr/build-scripts
# see patch
"usr/bin/serialize-bc.py",
]
)


@subpackage("openshadinglanguage-progs")
Expand Down

0 comments on commit 9f39695

Please sign in to comment.