[packages/squish] - new URLs, updated to 1.13 - removed obsolete shared,gcc4 patches - added cmake patch (adjust sonam
qboosh
qboosh at pld-linux.org
Wed May 18 22:19:34 CEST 2016
commit 8063d7aca405831fbffd8057197305027cff2698
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed May 18 22:19:47 2016 +0200
- new URLs, updated to 1.13
- removed obsolete shared,gcc4 patches
- added cmake patch (adjust soname for compatibility with pure make, adjust libdir)
- use cmake buildsystem
squish-cmake.patch | 21 ++++++++++++++++++
squish-gcc4.patch | 21 ------------------
squish-shared.patch | 36 ------------------------------
squish.spec | 64 +++++++++++++++++++++++++++++++++--------------------
4 files changed, 61 insertions(+), 81 deletions(-)
---
diff --git a/squish.spec b/squish.spec
index aaa699f..b28014f 100644
--- a/squish.spec
+++ b/squish.spec
@@ -3,6 +3,7 @@
%bcond_with altivec # use Altivec (PPC only)
%bcond_with sse # use SSE (x86 only)
%bcond_with sse2 # use SSE2 (x86 only)
+%bcond_without static_libs # static library
#
%ifarch pentium3 pentium4 %{x8664}
%define with_sse 1
@@ -16,18 +17,16 @@
Summary: libsquish - DXT compression library
Summary(pl.UTF-8): libsquish - biblioteka kompresji DXT
Name: squish
-Version: 1.11
-Release: 2
+Version: 1.13
+Release: 1
License: MIT
Group: Libraries
-#Source0Download: http://code.google.com/p/libsquish/downloads/list
-Source0: http://libsquish.googlecode.com/files/%{name}-%{version}.zip
-# Source0-md5: 150ba1117d2c1678de12650357787994
-Patch0: %{name}-shared.patch
-Patch1: %{name}-gcc4.patch
-URL: http://code.google.com/p/libsquish/
+Source0: http://downloads.sourceforge.net/libsquish/libsquish-%{version}.tgz
+# Source0-md5: ca4b9563953ad6ea9c43f7831a8c50c7
+Patch0: %{name}-cmake.patch
+URL: http://sourceforge.net/projects/libsquish/
+BuildRequires: cmake >= 2.8.3
BuildRequires: libstdc++-devel
-BuildRequires: libtool
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -72,25 +71,41 @@ Static squish library.
Statyczna biblioteka squish.
%prep
-%setup -q
+%setup -q -c
%patch0 -p1
-%patch1 -p1
%build
-%{__make} \
- CXX="%{__cxx}" \
- CXXFLAGS="%{rpmcxxflags} %{?with_altivec:-maltivec} %{?use_sse:-msse}" \
- CPPFLAGS="%{rpmcppflags} %{?with_altivec:-DSQUISH_USE_ALTIVEC=1} %{?use_sse:-DSQUISH_USE_SSE=%{use_sse}}" \
- libdir=%{_libdir}
+# disable sse setting on cmake level, control none/sse/sse2 settings through flags
+CXXFLAGS="%{rpmcxxflags} %{?with_altivec:-maltivec} %{?with_sse2:-msse2}%{!?with_sse2:%{?with_sse:-msse}}"
+CPPFLAGS="%{rpmcppflags} %{?with_altivec:-DSQUISH_USE_ALTIVEC=1} %{?use_sse:-DSQUISH_USE_SSE=%{use_sse}}"
+
+install -d build
+cd build
+%cmake .. \
+ -DBUILD_SQUISH_WITH_SSE2=OFF
+%{__make}
+cd ..
+
+%if %{with static_libs}
+install -d build-static
+cd build-static
+%cmake .. \
+ -DBUILD_SHARED_LIBS=OFF \
+ -DBUILD_SQUISH_WITH_SSE2=OFF
+%{__make}
+cd ..
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir}}
-%{__make} install \
- DESTDIR=$RPM_BUILD_ROOT \
- includedir=%{_includedir} \
- libdir=%{_libdir}
+%if %{with static_libs}
+%{__make} -C build-static install \
+ DESTDIR=$RPM_BUILD_ROOT
+%endif
+
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
@@ -100,16 +115,17 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc ChangeLog README texture_compression_s3tc.txt
-%attr(755,root,root) %{_libdir}/libsquish.so.*.*.*
+%doc ChangeLog LICENSE README
+%attr(755,root,root) %{_libdir}/libsquish.so.*.*
%attr(755,root,root) %ghost %{_libdir}/libsquish.so.0
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libsquish.so
-%{_libdir}/libsquish.la
%{_includedir}/squish.h
+%if %{with static_libs}
%files static
%defattr(644,root,root,755)
%{_libdir}/libsquish.a
+%endif
diff --git a/squish-cmake.patch b/squish-cmake.patch
new file mode 100644
index 0000000..bd249a3
--- /dev/null
+++ b/squish-cmake.patch
@@ -0,0 +1,21 @@
+--- squish-1.13/CMakeLists.txt.orig 2015-04-30 12:48:49.000000000 +0200
++++ squish-1.13/CMakeLists.txt 2016-05-18 21:11:07.904855550 +0200
+@@ -66,7 +66,7 @@
+ squish PROPERTIES
+ PUBLIC_HEADER "${SQUISH_HDRS}"
+ VERSION 0.0
+- SOVERSION 0.0
++ SOVERSION 0
+ DEBUG_POSTFIX "d"
+ XCODE_ATTRIBUTE_GCC_PREPROCESSOR_DEFINITIONS "$(SQUISH_CPP_$(CURRENT_ARCH))"
+ XCODE_ATTRIBUTE_OTHER_CFLAGS "$(SQUISH_CFLAGS_$(CURRENT_ARCH))"
+@@ -98,7 +98,7 @@
+
+ INSTALL(
+ TARGETS squish
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SUFFIX}
+ PUBLIC_HEADER DESTINATION include
+ )
diff --git a/squish-gcc4.patch b/squish-gcc4.patch
deleted file mode 100644
index 17152e6..0000000
--- a/squish-gcc4.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- squish-1.10/alpha.cpp.orig 2006-06-29 14:43:24.000000000 +0200
-+++ squish-1.10/alpha.cpp 2010-10-16 08:31:13.411734339 +0200
-@@ -25,6 +25,7 @@
-
- #include "alpha.h"
- #include <algorithm>
-+#include <climits>
-
- namespace squish {
-
---- squish-1.10/singlecolourfit.cpp.orig 2007-03-21 20:43:59.000000000 +0100
-+++ squish-1.10/singlecolourfit.cpp 2010-10-16 08:39:11.391740205 +0200
-@@ -27,6 +27,8 @@
- #include "colourset.h"
- #include "colourblock.h"
-
-+#include <climits>
-+
- namespace squish {
-
- struct SourceBlock
diff --git a/squish-shared.patch b/squish-shared.patch
deleted file mode 100644
index 99a2b4a..0000000
--- a/squish-shared.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- squish-1.10/Makefile.orig 2006-04-07 19:30:11.000000000 +0200
-+++ squish-1.10/Makefile 2010-10-16 07:53:52.799740205 +0200
-@@ -3,26 +3,25 @@
-
- SRC = alpha.cpp clusterfit.cpp colourblock.cpp colourfit.cpp colourset.cpp maths.cpp rangefit.cpp singlecolourfit.cpp squish.cpp
-
--OBJ = $(SRC:%.cpp=%.o)
-+OBJ = $(SRC:%.cpp=%.lo)
-
--LIB = libsquish.a
-+LIB = libsquish.la
-
- all : $(LIB)
-
- install : $(LIB)
-- install squish.h $(INSTALL_DIR)/include
-- install libsquish.a $(INSTALL_DIR)/lib
-+ install squish.h $(DESTDIR)$(includedir)
-+ libtool --mode=install install libsquish.la $(DESTDIR)$(libdir)
-
- uninstall:
- $(RM) $(INSTALL_DIR)/include/squish.h
- $(RM) $(INSTALL_DIR)/lib/libsquish.a
-
- $(LIB) : $(OBJ)
-- $(AR) cr $@ $?
-- ranlib $@
-+ libtool --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) -rpath $(libdir) $^
-
--%.o : %.cpp
-- $(CXX) $(CPPFLAGS) -I. $(CXXFLAGS) -o$@ -c $<
-+%.lo : %.cpp
-+ libtool --mode=compile --tag=CXX $(CXX) $(CPPFLAGS) -I. $(CXXFLAGS) -o$@ -c $<
-
- clean :
- $(RM) $(OBJ) $(LIB)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/squish.git/commitdiff/8063d7aca405831fbffd8057197305027cff2698
More information about the pld-cvs-commit
mailing list