packages: libjpeg/libjpeg.spec, libjpeg/libjpeg-maxmem-sysconf.patch (NEW) ...
arekm
arekm at pld-linux.org
Tue Aug 18 15:07:10 CEST 2009
Author: arekm Date: Tue Aug 18 13:07:10 2009 GMT
Module: packages Tag: HEAD
---- Log message:
- rel 2; automatic adjusting of maxmem, from gentoo
---- Files affected:
packages/libjpeg:
libjpeg.spec (1.69 -> 1.70) , libjpeg-maxmem-sysconf.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/libjpeg/libjpeg.spec
diff -u packages/libjpeg/libjpeg.spec:1.69 packages/libjpeg/libjpeg.spec:1.70
--- packages/libjpeg/libjpeg.spec:1.69 Fri Jul 10 14:27:11 2009
+++ packages/libjpeg/libjpeg.spec Tue Aug 18 15:07:04 2009
@@ -10,13 +10,14 @@
Summary(uk.UTF-8): Бібліотека для обробки різноманітних JPEG-файлів
Name: libjpeg
Version: 7
-Release: 1
+Release: 2
License: distributable
Group: Libraries
Source0: http://www.ijg.org/files/jpegsrc.v%{version}.tar.gz
# Source0-md5: 382ef33b339c299b56baf1296cda9785
Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
# Source1-md5: d6342c015a489de275ada637a77dc2b0
+Patch0: %{name}-maxmem-sysconf.patch
URL: http://www.ijg.org/
BuildRequires: libtool
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -166,6 +167,7 @@
%prep
%setup -q -n jpeg-%{version}
+%patch0 -p1
%build
%configure \
@@ -242,6 +244,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.70 2009/08/18 13:07:04 arekm
+- rel 2; automatic adjusting of maxmem, from gentoo
+
Revision 1.69 2009/07/10 12:27:11 arekm
- conflicts with libjpeg6
================================================================
Index: packages/libjpeg/libjpeg-maxmem-sysconf.patch
diff -u /dev/null packages/libjpeg/libjpeg-maxmem-sysconf.patch:1.1
--- /dev/null Tue Aug 18 15:07:10 2009
+++ packages/libjpeg/libjpeg-maxmem-sysconf.patch Tue Aug 18 15:07:04 2009
@@ -0,0 +1,49 @@
+# Make a reasonable guess about memory limits using sysconf().
+# includes 5% slop factor as suggested in documentation.
+
+--- jpeg-6b/jmemansi.c
++++ jpeg-6b/jmemansi.c
+@@ -12,6 +12,15 @@
+ * is shoved onto the user.
+ */
+
++#include <unistd.h>
++
++#ifdef __FreeBSD__
++# include <sys/types.h>
++# include <sys/sysctl.h>
++# include <sys/vmmeter.h>
++# include <vm/vm_param.h>
++#endif
++
+ #define JPEG_INTERNALS
+ #include "jinclude.h"
+ #include "jpeglib.h"
+@@ -157,7 +166,26 @@
+ GLOBAL(long)
+ jpeg_mem_init (j_common_ptr cinfo)
+ {
+- return DEFAULT_MAX_MEM; /* default for max_memory_to_use */
++#ifdef _SC_AVPHYS_PAGES
++ long phys_size;
++
++ if ((phys_size = sysconf(_SC_AVPHYS_PAGES)) == -1)
++ return DEFAULT_MAX_MEM; /* default for max_memory_to_use */
++ if ((phys_size *= sysconf(_SC_PAGESIZE)) < 0)
++ return DEFAULT_MAX_MEM;
++ return (long) (phys_size * 0.95);
++#elif defined(HAVE_SYSCTL) && defined(HW_PHYSMEM)
++ /* This works on *bsd and darwin. */
++ unsigned int physmem;
++ size_t len = sizeof physmem;
++ static int mib[2] = { CTL_HW, HW_PHYSMEM };
++
++ if (sysctl (mib, ARRAY_SIZE (mib), &physmem, &len, NULL, 0) == 0
++ && len == sizeof (physmem))
++ return (long) (physmem * 0.95);
++#endif
++
++ return DEFAULT_MAX_MEM;
+ }
+
+ GLOBAL(void)
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/libjpeg/libjpeg.spec?r1=1.69&r2=1.70&f=u
More information about the pld-cvs-commit
mailing list