jasper: adopted port

This commit is contained in:
Tim Biermann 2023-08-27 17:40:08 +02:00
parent 7315aa7ebd
commit f783004930
Signed by: tb
GPG Key ID: 42F8B4E30B673606
4 changed files with 18 additions and 121 deletions

View File

@ -1,5 +1,5 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/ZSNqB5RJNVpUzT+JR4oQN+X9hC3I/Sfl0OdWdHySO3ufb68CkznX5GXUiMgkAJR/KJe+oSekChywBJ8beg9gQo=
SHA256 (Pkgfile) = 22097903f9b0ba0214d2c1cdbd9b2f7e35be8e4a5af008e23fe9e3133aeb2734
RWSE3ohX2g5d/Zh4nIU0Vdhs7ajP7H9IZbaZVCmXdYxu2I/ZEGkvcbsDsdxycuehdOGbSbv8CRvIbl03QHTCYbukfggu+3gKDwM=
SHA256 (Pkgfile) = ae594fb6069d45b2eb52ccb2d839fa0178d2a7e58903031bf30d4f85c921b320
SHA256 (.footprint) = 878bc6e9640c0c9a333ce9d35d6a9311697f1b9f9203398b7c2c0f2c9e2b675e
SHA256 (jasper-4.0.0.tar.gz) = 39514e1b53a5333fcff817e19565371f016ea536c36fd2d13a9c4d8da8f0be0c

View File

@ -1,6 +1,6 @@
# Description: Codec JPEG-2000 Part-1 standard.
# Description: Codec JPEG-2000 Part-1 standard
# URL: https://www.ece.uvic.ca/~frodo/jasper/
# Maintainer: Danny Rawlins, crux at romster dot me
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: freeglut libjpeg-turbo xorg-libxmu
name=jasper
@ -9,7 +9,7 @@ release=1
source=(https://github.com/jasper-software/jasper/releases/download/version-$version/jasper-$version.tar.gz)
build() {
local config="
local config="
-D CMAKE_INSTALL_PREFIX=/usr
-D CMAKE_INSTALL_LIBDIR=lib
-D CMAKE_BUILD_TYPE=Release
@ -19,20 +19,20 @@ build() {
-D CMAKE_SKIP_RPATH=ON
-D OpenGL_GL_PREFERENCE=GLVND"
#build static lib
( cmake -S $name-$version -B build-static -G Ninja $config \
-D JAS_ENABLE_SHARED=OFF
cmake --build build-static
)
#build static lib
( cmake -S $name-$version -B build-static -G Ninja $config \
-D JAS_ENABLE_SHARED=OFF
cmake --build build-static
)
#build shared lib
( cmake -S $name-$version -B build-shared -G Ninja $config \
-D JAS_ENABLE_SHARED=ON
cmake --build build-shared
)
#build shared lib
( cmake -S $name-$version -B build-shared -G Ninja $config \
-D JAS_ENABLE_SHARED=ON
cmake --build build-shared
)
DESTDIR=$PKG cmake --install build-static
DESTDIR=$PKG cmake --install build-shared
DESTDIR=$PKG cmake --install build-static
DESTDIR=$PKG cmake --install build-shared
rm -r $PKG/usr/share/doc
rm -r $PKG/usr/share/doc
}

View File

@ -1,37 +0,0 @@
Description: Filename buffer overflow fix
This patch fixes a security hole by a bad buffer size handling.
Author: Roland Stigge <stigge@antcom.de>
Bug-Debian: http://bugs.debian.org/645118
--- a/src/libjasper/include/jasper/jas_stream.h
+++ b/src/libjasper/include/jasper/jas_stream.h
@@ -77,6 +77,7 @@
#include <jasper/jas_config.h>
#include <stdio.h>
+#include <limits.h>
#if defined(JAS_HAVE_FCNTL_H)
#include <fcntl.h>
#endif
@@ -99,6 +100,12 @@ extern "C" {
#define O_BINARY 0
#endif
+#ifdef PATH_MAX
+#define JAS_PATH_MAX PATH_MAX
+#else
+#define JAS_PATH_MAX 4096
+#endif
+
/*
* Stream open flags.
*/
@@ -251,7 +258,7 @@ typedef struct {
typedef struct {
int fd;
int flags;
- char pathname[L_tmpnam + 1];
+ char pathname[JAS_PATH_MAX + 1];
} jas_stream_fileobj_t;
#define JAS_STREAM_FILEOBJ_DELONCLOSE 0x01

View File

@ -1,66 +0,0 @@
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