summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/jasper/files/jasper-2.0.0-fix-build-system.patch')
-rw-r--r--media-libs/jasper/files/jasper-2.0.0-fix-build-system.patch92
1 files changed, 92 insertions, 0 deletions
diff --git a/media-libs/jasper/files/jasper-2.0.0-fix-build-system.patch b/media-libs/jasper/files/jasper-2.0.0-fix-build-system.patch
new file mode 100644
index 000000000000..bae54760f470
--- /dev/null
+++ b/media-libs/jasper/files/jasper-2.0.0-fix-build-system.patch
@@ -0,0 +1,92 @@
+* Fix build system to honour Gentoo's multilib-strict (lib32/lib64)
+* jiv also requires OpenGL libs, not just GLUT
+* Only look for OpenGL+GLUT if JAS_ENABLE_OPENGL is actually on
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -65,6 +65,7 @@
+ option(JAS_ENABLE_OPENGL "Enable use of OpenGL Library" true)
+ option(JAS_ENABLE_STRICT "Enable pedantic error checking" false)
+ option(JAS_ENABLE_SHARED "Enable building of shared library" true)
++option(CMAKE_INSTALL_LIBDIR "Path to install libraries into" lib)
+
+ if (APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ set(MACOSX true)
+@@ -173,21 +174,18 @@
+ # set(JPEG_INCLUDE_DIR "")
+ #endif()
+
+-find_package(GLUT)
+-if(GLUT_FOUND)
+- include_directories("${GLUT_INCLUDE_DIR}")
+-endif()
+-check_include_files(GL/glut.h JAS_HAVE_GL_GLUT_H)
+-message("GLUT library found: ${GLUT_FOUND}")
+-message("GLUT libraries: ${GLUT_LIBRARIES}")
+-message("GLUT include directory: ${GLUT_INCLUDE_DIR}")
+-message("JAS_ENABLE_OPENGL: ${JAS_ENABLE_OPENGL}")
+-message("JAS_HAVE_GL_GLUT_H: ${JAS_HAVE_GL_GLUT_H}")
+-if(GLUT_FOUND AND (NOT JAS_HAVE_GL_GLUT_H OR NOT JAS_ENABLE_OPENGL))
+- message("disabling GLUT")
+- set(GLUT_FOUND false)
+- set(GLUT_LIBRARIES "")
+- set(GLUT_INCLUDE_DIR "")
++if(JAS_ENABLE_OPENGL)
++ find_package(OpenGL REQUIRED)
++ find_package(GLUT REQUIRED)
++
++ check_include_files(GL/glut.h JAS_HAVE_GL_GLUT_H)
++ message("GLUT library found: ${GLUT_FOUND}")
++ message("GLUT libraries: ${GLUT_LIBRARIES}")
++ message("GLUT include directory: ${GLUT_INCLUDE_DIR}")
++ message("JAS_HAVE_GL_GLUT_H: ${JAS_HAVE_GL_GLUT_H}")
++ if(NOT JAS_HAVE_GL_GLUT_H)
++ message(FATAL_ERROR "GL/glut.h cannot be found or is not working.")
++ endif()
+ endif()
+
+ if(UNIX)
+@@ -219,7 +217,7 @@
+ # the RPATH to be used when installing, but only if it's not a system directory
+ LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
+ IF("${isSystemDir}" STREQUAL "-1")
+- SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
++ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+ ENDIF("${isSystemDir}" STREQUAL "-1")
+
+ ################################################################################
+@@ -275,7 +273,7 @@
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/build/jasper.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/build/jasper.pc @ONLY)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/build/jasper.pc
+- DESTINATION lib/pkgconfig)
++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/build/jasper.spec.in
+ ${CMAKE_CURRENT_BINARY_DIR}/build/jasper.spec @ONLY)
+--- a/src/appl/CMakeLists.txt
++++ b/src/appl/CMakeLists.txt
+@@ -22,7 +22,7 @@
+ # The jiv program (which requires GLUT)
+ if(GLUT_FOUND)
+ add_executable(jiv jiv.c)
+- target_link_libraries(jiv libjasper ${JPEG_LIBRARIES} ${GLUT_LIBRARIES} ${MATH_LIBRARY})
++ target_link_libraries(jiv libjasper ${JPEG_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${MATH_LIBRARY})
+ set(programs "${programs}" jiv)
+ set(man_pages "${man_pages}" jiv.1)
+ else()
+@@ -33,4 +33,4 @@
+ install(TARGETS ${programs} DESTINATION bin)
+
+ # Install the manual pages for the programs that were built.
+-install(FILES ${man_pages} DESTINATION man)
++install(FILES ${man_pages} DESTINATION share/man/man1)
+--- a/src/libjasper/CMakeLists.txt
++++ b/src/libjasper/CMakeLists.txt
+@@ -151,5 +151,5 @@
+ # MacOSX does cannot build a shared library without this line.
+ target_link_libraries(libjasper ${JPEG_LIBRARIES})
+
+-install(TARGETS libjasper DESTINATION lib)
++install(TARGETS libjasper DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES ${libjasper_headers} DESTINATION include/jasper)