- updated to 8a (merged from libjpeg.spec)
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 21 Mar 2010 07:56:41 +0000 (07:56 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    crossmingw32-libjpeg-shared.patch -> 1.3
    crossmingw32-libjpeg.spec -> 1.17
    libjpeg-DESTDIR.patch -> 1.2
    libjpeg-c++.patch -> 1.3
    libjpeg-include.patch -> 1.2
    libjpeg-maxmem-sysconf.patch -> 1.1

crossmingw32-libjpeg-shared.patch [deleted file]
crossmingw32-libjpeg.spec
libjpeg-DESTDIR.patch [deleted file]
libjpeg-c++.patch [deleted file]
libjpeg-include.patch [deleted file]
libjpeg-maxmem-sysconf.patch [new file with mode: 0644]

diff --git a/crossmingw32-libjpeg-shared.patch b/crossmingw32-libjpeg-shared.patch
deleted file mode 100644 (file)
index 82f8047..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-diff -ruN jpeg-6b./makefile.cfg jpeg-6b/makefile.cfg
---- jpeg-6b./makefile.cfg      2003-12-25 03:23:00.000000000 +0100
-+++ jpeg-6b/makefile.cfg       2003-12-25 03:26:30.147554616 +0100
-@@ -166,9 +166,12 @@
-       $(AR) libjpeg.a  $(LIBOBJECTS)
-       $(AR2) libjpeg.a
-+jpeg.dll: $(LIBOBJECTS)
-+      $(CC) $(LIBOBJECTS) -shared -Wl,--enable-auto-image-base -o jpeg.dll -Wl,--out-implib,libjpeg.dll.a
-+
- # with libtool:
- libjpeg.la: @A2K_DEPS@ $(LIBOBJECTS)
--      $(LIBTOOL) --mode=link $(CC) -o libjpeg.la $(LIBOBJECTS) \
-+      $(LIBTOOL) --mode=link $(CC) -no-undefined -o libjpeg.la $(LIBOBJECTS) \
-               -rpath $(libdir) -version-info $(JPEG_LIB_VERSION)
- # sample programs:
index 3d9cb22..a781091 100644 (file)
@@ -2,16 +2,13 @@
 Summary:       Library for handling different jpeg files - Mingw32 cross version
 Summary(pl.UTF-8):     Biblioteka do manipulacji plikami w formacie jpeg - wersja skroĊ›na dla Mingw32
 Name:          crossmingw32-%{realname}
-Version:       6b
-Release:       6
+Version:       8a
+Release:       1
 License:       distributable
 Group:         Development/Libraries
-Source0:       ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v%{version}.tar.gz
-# Source0-md5: dbd5f3b47ed13132f04c685d608a7547
-Patch0:                %{realname}-DESTDIR.patch
-Patch1:                %{realname}-include.patch
-Patch2:                %{realname}-c++.patch
-Patch3:                %{name}-shared.patch
+Source0:       http://www.ijg.org/files/jpegsrc.v%{version}.tar.gz
+# Source0-md5: 5146e68be3633c597b0d14d3ed8fa2ea
+Patch0:                %{realname}-maxmem-sysconf.patch
 URL:           http://www.ijg.org/
 BuildRequires: autoconf >= 2.50
 BuildRequires: automake
@@ -36,6 +33,8 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc
 %define                optflags        -O2
 %endif
+# -z options are invalid for mingw linker
+%define                filterout_ld    -Wl,-z,.*
 
 %description
 The libjpeg package contains a library of functions for manipulating
@@ -75,50 +74,27 @@ libjpeg - biblioteka DLL dla Windows.
 %prep
 %setup -q -n jpeg-%{version}
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-
-cp /usr/share/automake/config.* .
-
-# hack: use recent libtool by configuring for mingw32 in separate dir
-# (cannot regenerate main ac/lt because of missing configure.in)
-mkdir lthack
-cd lthack
-cat >configure.ac <<EOF
-AC_INIT(lthack, 0)
-AC_CONFIG_AUX_DIR(..)
-AC_PROG_LIBTOOL
-EOF
 
 %build
-cd lthack
-%{__libtoolize}
-%{__aclocal}
-%{__autoconf}
-%configure \
-       --target=%{target} \
-       --host=%{target}
-cd ..
-
 %configure \
        --target=%{target} \
        --host=%{target} \
-       --enable-shared \
-       --enable-static
-
-cp -f lthack/libtool .
+       --disable-silent-rules
 
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_dlldir}}
 
-%{__make} install-headers install-lib \
-       libdir=%{_libdir} \
+%{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
+install jversion.h $RPM_BUILD_ROOT%{_includedir}
+
+# remove HAVE_STD{DEF,LIB}_H
+# (not necessary but may generate warnings confusing autoconf)
+sed -i -e 's#.*HAVE_STD..._H.*##g' $RPM_BUILD_ROOT%{_includedir}/jconfig.h
+
 install -d $RPM_BUILD_ROOT%{_dlldir}
 mv -f $RPM_BUILD_ROOT%{_prefix}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir}
 
@@ -139,6 +115,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/jerror.h
 %{_includedir}/jmorecfg.h
 %{_includedir}/jpeglib.h
+%{_includedir}/jversion.h
 
 %files static
 %defattr(644,root,root,755)
diff --git a/libjpeg-DESTDIR.patch b/libjpeg-DESTDIR.patch
deleted file mode 100644 (file)
index 62902ec..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-diff -ur jpeg-6b.old/makefile.cfg jpeg-6b/makefile.cfg
---- jpeg-6b.old/makefile.cfg   Sat Mar 21 20:08:57 1998
-+++ jpeg-6b/makefile.cfg       Thu Jun 24 10:37:57 1999
-@@ -17,7 +17,7 @@
- binprefix =
- manprefix =
- manext = 1
--mandir = $(prefix)/man/man$(manext)
-+mandir = @mandir@/man$(manext)
- # The name of your C compiler:
- CC= @CC@
-@@ -191,25 +191,25 @@
- # Installation rules:
- install: cjpeg djpeg jpegtran rdjpgcom wrjpgcom @FORCE_INSTALL_LIB@
--      $(INSTALL_PROGRAM) cjpeg $(bindir)/$(binprefix)cjpeg
--      $(INSTALL_PROGRAM) djpeg $(bindir)/$(binprefix)djpeg
--      $(INSTALL_PROGRAM) jpegtran $(bindir)/$(binprefix)jpegtran
--      $(INSTALL_PROGRAM) rdjpgcom $(bindir)/$(binprefix)rdjpgcom
--      $(INSTALL_PROGRAM) wrjpgcom $(bindir)/$(binprefix)wrjpgcom
--      $(INSTALL_DATA) $(srcdir)/cjpeg.1 $(mandir)/$(manprefix)cjpeg.$(manext)
--      $(INSTALL_DATA) $(srcdir)/djpeg.1 $(mandir)/$(manprefix)djpeg.$(manext)
--      $(INSTALL_DATA) $(srcdir)/jpegtran.1 $(mandir)/$(manprefix)jpegtran.$(manext)
--      $(INSTALL_DATA) $(srcdir)/rdjpgcom.1 $(mandir)/$(manprefix)rdjpgcom.$(manext)
--      $(INSTALL_DATA) $(srcdir)/wrjpgcom.1 $(mandir)/$(manprefix)wrjpgcom.$(manext)
-+      $(INSTALL_PROGRAM) cjpeg $(DESTDIR)$(bindir)/$(binprefix)cjpeg
-+      $(INSTALL_PROGRAM) djpeg $(DESTDIR)$(bindir)/$(binprefix)djpeg
-+      $(INSTALL_PROGRAM) jpegtran $(DESTDIR)$(bindir)/$(binprefix)jpegtran
-+      $(INSTALL_PROGRAM) rdjpgcom $(DESTDIR)$(bindir)/$(binprefix)rdjpgcom
-+      $(INSTALL_PROGRAM) wrjpgcom $(DESTDIR)$(bindir)/$(binprefix)wrjpgcom
-+      $(INSTALL_DATA) $(srcdir)/cjpeg.1 $(DESTDIR)$(mandir)/$(manprefix)cjpeg.$(manext)
-+      $(INSTALL_DATA) $(srcdir)/djpeg.1 $(DESTDIR)$(mandir)/$(manprefix)djpeg.$(manext)
-+      $(INSTALL_DATA) $(srcdir)/jpegtran.1 $(DESTDIR)$(mandir)/$(manprefix)jpegtran.$(manext)
-+      $(INSTALL_DATA) $(srcdir)/rdjpgcom.1 $(DESTDIR)$(mandir)/$(manprefix)rdjpgcom.$(manext)
-+      $(INSTALL_DATA) $(srcdir)/wrjpgcom.1 $(DESTDIR)$(mandir)/$(manprefix)wrjpgcom.$(manext)
- install-lib: libjpeg.$(A) install-headers
--      $(INSTALL_LIB) libjpeg.$(A) $(libdir)/$(binprefix)libjpeg.$(A)
-+      $(INSTALL_LIB) libjpeg.$(A) $(DESTDIR)$(libdir)/$(binprefix)libjpeg.$(A)
- install-headers: jconfig.h
--      $(INSTALL_DATA) jconfig.h $(includedir)/jconfig.h
--      $(INSTALL_DATA) $(srcdir)/jpeglib.h $(includedir)/jpeglib.h
--      $(INSTALL_DATA) $(srcdir)/jmorecfg.h $(includedir)/jmorecfg.h
--      $(INSTALL_DATA) $(srcdir)/jerror.h $(includedir)/jerror.h
-+      $(INSTALL_DATA) jconfig.h $(DESTDIR)$(includedir)/jconfig.h
-+      $(INSTALL_DATA) $(srcdir)/jpeglib.h $(DESTDIR)$(includedir)/jpeglib.h
-+      $(INSTALL_DATA) $(srcdir)/jmorecfg.h $(DESTDIR)$(includedir)/jmorecfg.h
-+      $(INSTALL_DATA) $(srcdir)/jerror.h $(DESTDIR)$(includedir)/jerror.h
- clean:
-       $(RM) *.o *.lo libjpeg.a libjpeg.la
diff --git a/libjpeg-c++.patch b/libjpeg-c++.patch
deleted file mode 100644 (file)
index 3e4166a..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
---- jpeg-6b/jpeglib.h.c++      Sat Jun 17 21:58:15 2000
-+++ jpeg-6b/jpeglib.h  Sat Jun 17 21:58:53 2000
-@@ -13,6 +13,10 @@
- #ifndef JPEGLIB_H
- #define JPEGLIB_H
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
- /*
-  * First we include the configuration files that record how this
-  * installation of the JPEG library is set up.  jconfig.h can be
-@@ -1091,6 +1095,10 @@
- #ifdef JPEG_INTERNALS
- #include <jpegint.h>          /* fetch private declarations */
- #include <jerror.h>           /* fetch error codes too */
-+#endif
-+
-+#ifdef __cplusplus
-+}
- #endif
- #endif /* JPEGLIB_H */
diff --git a/libjpeg-include.patch b/libjpeg-include.patch
deleted file mode 100644 (file)
index edd7286..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- jpeg-6b/jpeglib.h
-+++ jpeg-6b.new/jpeglib.h
-@@ -24 +24 @@
--#include "jconfig.h"          /* widely used configuration options */
-+#include <jconfig.h>          /* widely used configuration options */
-@@ -26 +26 @@
--#include "jmorecfg.h"         /* seldom changed options */
-+#include <jmorecfg.h>         /* seldom changed options */
-@@ -1092,2 +1092,2 @@
--#include "jpegint.h"          /* fetch private declarations */
--#include "jerror.h"           /* fetch error codes too */
-+#include <jpegint.h>          /* fetch private declarations */
-+#include <jerror.h>           /* fetch error codes too */
diff --git a/libjpeg-maxmem-sysconf.patch b/libjpeg-maxmem-sysconf.patch
new file mode 100644 (file)
index 0000000..b1c8d72
--- /dev/null
@@ -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)
This page took 0.099952 seconds and 4 git commands to generate.