[packages/crnlib] - new

qboosh qboosh at pld-linux.org
Thu May 15 18:43:18 CEST 2014


commit fb6fa1b1aeb7d061016193f56a6e786da87d6c48
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu May 15 18:45:53 2014 +0200

    - new

 crnlib-c++.patch |  45 +++++++++++++++++++++++
 crnlib.spec      | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 151 insertions(+)
---
diff --git a/crnlib.spec b/crnlib.spec
new file mode 100644
index 0000000..269f600
--- /dev/null
+++ b/crnlib.spec
@@ -0,0 +1,106 @@
+# NOTE: we use "crnlib" because plain "crunch" or "libcrunch" isn't unique project name
+Summary:	crunch/crnlib - advanced DXTn texture compression library
+Summary(pl.UTF-8):	crunch/crnlib - zaawansowana biblioteka do kompresji tekstur DXTn
+Name:		crnlib
+Version:	1.04
+Release:	1
+License:	ZLib
+Group:		Libraries
+#Source0Download: http://code.google.com/p/crunch/downloads/list
+# but no Linux-supporting releases there
+# svn co http://crunch.googlecode.com/svn/tags/v104 crunch
+# rm -rf crunch/bin*
+# tar cJf crunch-104.tar.xz -x .svn crunch
+Source0:	crunch-104.tar.xz
+# Source0-md5:	f92837bba95abf27d6bd9ae0b2b04863
+Patch0:		%{name}-c++.patch
+URL:		http://code.google.com/p/crunch/
+BuildRequires:	libstdc++-devel
+BuildRequires:	libtool
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+crnlib is a lossy texture compression library for developers that ship
+content using the DXT1/5/N or 3DC compressed color/normal map/cubemap
+mipmapped texture formats.
+
+%description -l pl.UTF-8
+crnlib to biblioteka stratnej kompresji dla programistów
+dostarczających dane przy użyciu formatów tekstur (kolorów, map
+normalnych i innych) z zastosowaną kompresją DXT1/5/N lub 3DC.
+
+%package devel
+Summary:	Header files for crnlib library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki crnlib
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	libstdc++-devel
+
+%description devel
+Header files for crnlib library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki crnlib.
+
+%package static
+Summary:	Static crnlib library
+Summary(pl.UTF-8):	Statyczna biblioteka crnlib
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static crnlib library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka crnlib.
+
+%prep
+%setup -q -n crunch
+%patch0 -p1
+
+%{__sed} -i -e '/g++.*COMPILE_OPTIONS/s/g++/$(CXX)/' crnlib/Makefile
+%{__sed} -i -e '/g++.*LINKER_OPTIONS/s/g++/$(CXXLINK)/' crnlib/Makefile
+
+%build
+%{__make} -C crnlib \
+	CXX="libtool --mode=compile %{__cxx}" \
+	CXXLINK="libtool --mode=link %{__cxx}" \
+	COMPILE_OPTIONS="%{rpmcflags} -fomit-frame-pointer -ffast-math -fno-math-errno -fno-strict-aliasing -Wall -Wno-unused-value -Wno-unused" \
+	LINKER_OPTIONS="%{rpmldflags} -lpthread"
+
+libtool --mode=link %{__cxx} %{rpmldflags} -o crnlib/libcrunch.la crnlib/{crnlib,crn_*,lzma_*}.lo -rpath %{_libdir} -lpthread
+# relink using shared library
+libtool --mode=link %{__cxx} %{rpmldflags} -o crnlib/crunch crnlib/{crunch,corpus_gen,corpus_test}.o crnlib/libcrunch.la -lpthread
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir}}
+
+libtool --mode=install install crnlib/libcrunch.la $RPM_BUILD_ROOT%{_libdir}
+cp -p inc/*.h $RPM_BUILD_ROOT%{_includedir}
+install crnlib/crunch $RPM_BUILD_ROOT%{_bindir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc license.txt readme.txt
+%attr(755,root,root) %{_bindir}/crunch
+%attr(755,root,root) %{_libdir}/libcrunch.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libcrunch.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libcrunch.so
+%{_libdir}/libcrunch.la
+%{_includedir}/crn_decomp.h
+%{_includedir}/crnlib.h
+%{_includedir}/dds_defs.h
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libcrunch.a
diff --git a/crnlib-c++.patch b/crnlib-c++.patch
new file mode 100644
index 0000000..d884d88
--- /dev/null
+++ b/crnlib-c++.patch
@@ -0,0 +1,45 @@
+--- crunch/crnlib/crn_sparse_array.h.orig	2014-05-14 19:48:47.133895619 +0200
++++ crunch/crnlib/crn_sparse_array.h	2014-05-14 21:54:04.600405597 +0200
+@@ -355,7 +355,7 @@
+ 
+       inline T* alloc_group(bool nofail = false)
+       {
+-         T* p = static_cast<T*>(alloc_space(N * sizeof(T)));
++         T* p = static_cast<T*>(this->alloc_space(N * sizeof(T)));
+ 
+          if (!p)
+          {
+@@ -365,7 +365,7 @@
+             CRNLIB_FAIL("Out of memory");
+          }
+ 
+-         construct_group(p);
++         this->construct_group(p);
+ 
+          m_num_active_groups++;
+ 
+@@ -379,20 +379,20 @@
+             CRNLIB_ASSERT(m_num_active_groups);
+             m_num_active_groups--;
+ 
+-            destruct_group(p);
++            this->destruct_group(p);
+ 
+-            free_space(p);
++            this->free_space(p);
+          }
+       }
+ 
+       inline void init_default()
+       {
+-         construct_element(reinterpret_cast<T*>(m_default));
++         this->construct_element(reinterpret_cast<T*>(m_default));
+       }
+ 
+       inline void deinit_default()
+       {
+-         destruct_element(reinterpret_cast<T*>(m_default));
++         this->destruct_element(reinterpret_cast<T*>(m_default));
+       }
+    };
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/crnlib.git/commitdiff/fb6fa1b1aeb7d061016193f56a6e786da87d6c48



More information about the pld-cvs-commit mailing list