]> git.pld-linux.org Git - packages/crossmingw32-jasper.git/commitdiff
- updated to 3.0.6
authorJakub Bogusz <qboosh@pld-linux.org>
Mon, 13 Mar 2023 18:07:49 +0000 (19:07 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Mon, 13 Mar 2023 18:07:49 +0000 (19:07 +0100)
crossmingw32-jasper.spec
jasper-mingw32.patch [new file with mode: 0644]

index 906674c7d42cfdd5a2f521bc1b41b6a083f6a629..13c48a528901b22d08ada6cec1d60501b757ce34 100644 (file)
@@ -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 (file)
index 0000000..4832964
--- /dev/null
@@ -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
This page took 0.108318 seconds and 4 git commands to generate.