[packages/crossmingw32-jasper] - updated to 3.0.6

qboosh qboosh at pld-linux.org
Mon Mar 13 19:05:41 CET 2023


commit 8cf7fbcf9f8832841b9c9cee7d654a448b8e312a
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Mar 13 19:07:49 2023 +0100

    - updated to 3.0.6

 crossmingw32-jasper.spec | 12 +++++++-----
 jasper-mingw32.patch     | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 5 deletions(-)
---
diff --git a/crossmingw32-jasper.spec b/crossmingw32-jasper.spec
index 906674c..13c48a5 100644
--- a/crossmingw32-jasper.spec
+++ b/crossmingw32-jasper.spec
@@ -1,14 +1,14 @@
 Summary:	JasPer library for images manipulation - MinGW32 cross version
 Summary(pl.UTF-8):	Biblioteka JasPer do obróbki obrazów - wersja skrośna dla MinGW32
 Name:		crossmingw32-jasper
-Version:	2.0.33
+Version:	3.0.6
 Release:	1
-License:	BSD-like
+License:	JasPer v2.0 (BSD-like)
 Group:		Development/Libraries
-# versions up to 2.0.14: http://www.ece.uvic.ca/~frodo/jasper/#download
 #Source0Download: https://github.com/jasper-software/jasper/releases
 Source0:	https://github.com/jasper-software/jasper/releases/download/version-%{version}/jasper-%{version}.tar.gz
-# Source0-md5:	8761ef749b696e3cace330801e27b486
+# Source0-md5:	f9388d52a6220303141a42d4c2c81e62
+Patch0:		jasper-mingw32.patch
 URL:		https://www.ece.uvic.ca/~frodo/jasper/
 BuildRequires:	cmake >= 2.8.11
 BuildRequires:	crossmingw32-gcc
@@ -72,6 +72,7 @@ Biblioteka DLL JasPer dla Windows.
 
 %prep
 %setup -q -n jasper-%{version}
+%patch0 -p1
 
 %build
 # there is upstream directory named "build", use different name
@@ -85,6 +86,7 @@ cd builddir
 	-DJAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF \
 	-DJAS_ENABLE_DOC=OFF \
 	-DJAS_ENABLE_OPENGL=OFF \
+	-DJAS_STDC_VERSION="$(i386-mingw32-cpp -x c -dM < /dev/null | grep __STDC_VERSION__| cut -d' ' -f3)" \
 	-DJPEG_INCLUDE_DIR:PATH=%{_includedir} \
 	-DJPEG_LIBRARY=%{_libdir}/libjpeg.dll.a
 
@@ -113,7 +115,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc LICENSE README doc/jasper.pdf doc/jpeg2000.pdf
+%doc ChangeLog LICENSE.txt NEWS.txt README.md doc/jpeg2000.pdf
 %{_libdir}/libjasper.dll.a
 %{_includedir}/jasper
 %{_pkgconfigdir}/jasper.pc
diff --git a/jasper-mingw32.patch b/jasper-mingw32.patch
new file mode 100644
index 0000000..4832964
--- /dev/null
+++ b/jasper-mingw32.patch
@@ -0,0 +1,33 @@
+Current mingw32 doesn't provide <sysinfoapi.h>, so use older API.
+--- jasper-3.0.6/src/libjasper/base/jas_malloc.c.orig	2023-03-13 13:16:49.488682893 +0100
++++ jasper-3.0.6/src/libjasper/base/jas_malloc.c	2023-03-13 18:13:28.802255734 +0100
+@@ -94,7 +94,6 @@
+ #	include <unistd.h>
+ #elif defined(_WIN32)
+ #	include <windows.h>
+-#	include <sysinfoapi.h>
+ #endif
+ 
+ /******************************************************************************\
+@@ -649,15 +648,14 @@ size_t jas_get_total_mem_size()
+ 	long page_size = sysconf(_SC_PAGE_SIZE);
+ 	return pages * page_size;
+ #elif defined(_WIN32)
+-	/*
+-	Reference:
+-	https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getphysicallyinstalledsystemmemory
+-	*/
+-	ULONGLONG size;
+-	if (!GetPhysicallyInstalledSystemMemory(&size)) {
++	MEMORYSTATUSEX memStatusEx = {0};
++	memStatusEx.dwLength = sizeof(MEMORYSTATUSEX);
++	BOOL bRet = GlobalMemoryStatusEx(&memStatusEx);
++	return memStatusEx.ullTotalPhys;
++	if (!GlobalMemoryStatusEx(&memStatusEx)) {
+ 		return 0;
+ 	}
+-	return 1024 * size;
++	return memStatusEx.ullTotalPhys;
+ #else
+ 	return 0;
+ #endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/crossmingw32-jasper.git/commitdiff/8cf7fbcf9f8832841b9c9cee7d654a448b8e312a



More information about the pld-cvs-commit mailing list