diff options
author | Danny Rawlins <contact@romster.me> | 2021-12-05 21:45:24 +1100 |
---|---|---|
committer | Danny Rawlins <contact@romster.me> | 2021-12-05 21:45:24 +1100 |
commit | e823e7cfef3b7b1c252ae2b21e5e72193d0b1b1c (patch) | |
tree | 1f0d55e1492dd7c00765bcfcc6561e34c29dbaef /jasper | |
parent | 9c3643576e7d499b98ab6ce978a30146d628e8b2 (diff) | |
download | opt-e823e7cfef3b7b1c252ae2b21e5e72193d0b1b1c.tar.gz opt-e823e7cfef3b7b1c252ae2b21e5e72193d0b1b1c.tar.xz |
jasper: fix compile with freeglut
Diffstat (limited to 'jasper')
-rw-r--r-- | jasper/.signature | 5 | ||||
-rw-r--r-- | jasper/Pkgfile | 6 | ||||
-rw-r--r-- | jasper/jasper-freeglut.patch | 66 |
3 files changed, 73 insertions, 4 deletions
diff --git a/jasper/.signature b/jasper/.signature index dbf663618..28616b016 100644 --- a/jasper/.signature +++ b/jasper/.signature @@ -1,6 +1,7 @@ untrusted comment: verify with /etc/ports/opt.pub -RWSE3ohX2g5d/XN69cWVPb6/GtZrKez1SdYXdvrnT1h5jGVc8TcxZz/04AGqvgoTybFcw3i4NBwyvgtobCUOG2KI1gtm8MJY7wk= -SHA256 (Pkgfile) = 4c210e3c5634dc4d4d05388a13e48c3b710cd7845168036e921f39e54e33ed14 +RWSE3ohX2g5d/b3/u8mr38NUbo3iA57fNR7z2izgkMN74e3l/rAdx1+CELUoIixyMCNvpZN4rTC9ljeDAs7PCibbLozxf9uLVQc= +SHA256 (Pkgfile) = a584698d0f834649f37d50476e67f7c782cd3bad44baa12983c4b915f8e90337 SHA256 (.footprint) = 2663af88aeb3fd06c40efc05558af405f50dbda6d410a36f3b02f005e0f0abf0 SHA256 (jasper-2.0.33.tar.gz) = 38b8f74565ee9e7fec44657e69adb5c9b2a966ca5947ced5717cde18a7d2eca6 SHA256 (jasper-1.900.1-fix-filename-buffer-overflow.patch) = f51377e9b3e4faaa6b17b2d5fcf6f6d94fe2916a65dc9c78b5a99b891f5726dc +SHA256 (jasper-freeglut.patch) = 1b2d784f48858e03ad64ee632f2a5e64d49c368b8dc3553b01315b52d14d3131 diff --git a/jasper/Pkgfile b/jasper/Pkgfile index d473445a0..06c9f6f93 100644 --- a/jasper/Pkgfile +++ b/jasper/Pkgfile @@ -5,15 +5,17 @@ name=jasper version=2.0.33 -release=1 +release=2 source=(https://github.com/jasper-software/jasper/archive/version-$version/$name-$version.tar.gz - jasper-1.900.1-fix-filename-buffer-overflow.patch) + jasper-1.900.1-fix-filename-buffer-overflow.patch + jasper-freeglut.patch) build() { cd $name-version-$version patch -p1 -i $SRC/jasper-1.900.1-fix-filename-buffer-overflow.patch sed -r 's|(CMAKE_SKIP_BUILD_RPATH) FALSE|\1 TRUE|g' -i CMakeLists.txt + patch -p1 -i $SRC/jasper-freeglut.patch mkdir -p build-{shared,static} diff --git a/jasper/jasper-freeglut.patch b/jasper/jasper-freeglut.patch new file mode 100644 index 000000000..1bb921a24 --- /dev/null +++ b/jasper/jasper-freeglut.patch @@ -0,0 +1,66 @@ +diff -urNp a/build/cmake/modules/JasOpenGL.cmake b/build/cmake/modules/JasOpenGL.cmake +--- a/build/cmake/modules/JasOpenGL.cmake 2020-10-07 10:00:16.316291325 +0200 ++++ b/build/cmake/modules/JasOpenGL.cmake 2020-10-07 10:03:39.536143003 +0200 +@@ -13,19 +13,19 @@ if (JAS_ENABLE_OPENGL AND OPENGL_FOUND) + set(JAS_HAVE_OPENGL 0) + message("OpenGL include directory: ${OPENGL_INCLUDE_DIR}") + message("OpenGL libraries: ${OPENGL_LIBRARIES}") +- find_package(GLUT ${JAS_REQUIRED}) +- message("GLUT library found: ${GLUT_FOUND}") +- if (GLUT_FOUND) +- message("GLUT include directory: ${GLUT_INCLUDE_DIR}") +- message("GLUT libraries: ${GLUT_LIBRARIES}") +- set(CMAKE_REQUIRED_INCLUDES ${GLUT_INCLUDE_DIR}) +- check_include_files(GL/glut.h JAS_HAVE_GL_GLUT_H) ++ find_package(FreeGLUT ${JAS_REQUIRED}) ++ message("GLUT library found: ${FreeGLUT_FOUND}") ++ if (FreeGLUT_FOUND) ++ message("GLUT include directory: ${FreeGLUT_INCLUDE_DIR}") ++ message("GLUT libraries: ${FreeGLUT_LIBRARIES}") ++ set(CMAKE_REQUIRED_INCLUDES ${FreeGLUT_INCLUDE_DIR}) ++ check_include_files(GL/freeglut.h JAS_HAVE_GL_GLUT_H) + check_include_files(glut.h JAS_HAVE_GLUT_H) + if (JAS_HAVE_GL_GLUT_H OR JAS_HAVE_GLUT_H) + set(JAS_HAVE_OPENGL 1) +- include_directories(${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) ++ include_directories(${FreeGLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) + else() +- message(WARNING "The header files GL/glut.h and glut.h both appear to be missing.") ++ message(WARNING "The header files GL/freeglut.h and glut.h both appear to be missing.") + message(WARNING "Disabling OpenGL.") + endif() + endif() +@@ -49,6 +49,6 @@ else() + set(JAS_HAVE_OPENGL 0) + set(OPENGL_INCLUDE_DIR "") + set(OPENGL_LIBRARIES "") +- set(GLUT_INCLUDE_DIR "") ++ set(FreeGLUT_INCLUDE_DIR "") + set(GLUT_LIBRARIES "") + endif() +diff -urNp a/src/appl/CMakeLists.txt b/src/appl/CMakeLists.txt +--- a/src/appl/CMakeLists.txt 2020-10-07 10:00:16.338291526 +0200 ++++ b/src/appl/CMakeLists.txt 2020-10-07 10:04:58.864872143 +0200 +@@ -23,8 +23,8 @@ set(man_pages "${man_pages}" imgcmp.1) + if(JAS_HAVE_OPENGL) + add_executable(jiv jiv.c) + target_include_directories(jiv PUBLIC +- ${GLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) +- target_link_libraries(jiv libjasper ${JPEG_LIBRARIES} ${GLUT_LIBRARIES} ++ ${FreeGLUT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) ++ target_link_libraries(jiv libjasper ${JPEG_LIBRARIES} -lglut + ${OPENGL_LIBRARIES} ${MATH_LIBRARY}) + set(programs "${programs}" jiv) + set(man_pages "${man_pages}" jiv.1) +diff -urNp a/src/appl/jiv.c b/src/appl/jiv.c +--- a/src/appl/jiv.c 2020-10-07 10:00:16.340291544 +0200 ++++ b/src/appl/jiv.c 2020-10-07 10:05:35.319207658 +0200 +@@ -68,7 +68,7 @@ + #include <math.h> + #include <inttypes.h> + #if defined(JAS_HAVE_GL_GLUT_H) +-#include <GL/glut.h> ++#include <GL/freeglut.h> + #else + #include <glut.h> + #endif |