Update to version 0.6.4

Drop previously backported patches
This commit is contained in:
Mattias Ellert 2018-01-03 10:38:19 +01:00
parent e91cf9341a
commit f7784d78fc
4 changed files with 7 additions and 211 deletions

View File

@ -1 +1 @@
SHA512 (xxhash-0.6.3.tar.gz) = 5b11009ecf142725c642be55e9072792709bd40d8674f30afdc13f9b9fd6936ea69e683c7b9df212b5126f9ba3925969fc0b65bb5518506b501bb339d3a29372 SHA512 (xxhash-0.6.4.tar.gz) = 6c914bac5092dfd01349c8223c382d3c13ba1b22e08300ce86ea9663a9a934f930debdeb71c14365ec57d72b95088a4354da92dfb7fcf7d07ec01c0f4fb70ca7

View File

@ -1,178 +0,0 @@
From bc32865a237f15cd4aaaa010b4f6a4f2fae71367 Mon Sep 17 00:00:00 2001
From: Yann Collet <cyan@fb.com>
Date: Thu, 14 Sep 2017 09:44:34 -0700
Subject: [PATCH] make : added lib target
make install now also installs static and dynamic libraries
---
.gitignore | 6 ++++
Makefile | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++-----------
2 files changed, 82 insertions(+), 16 deletions(-)
diff --git a/.gitignore b/.gitignore
index 6e41348..36639c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,9 @@
+# objects
+*.o
+
+# libraries
+libxxhash.*
+
# Executables
xxh32sum
xxh64sum
diff --git a/Makefile b/Makefile
index f1b4238..98f6048 100644
--- a/Makefile
+++ b/Makefile
@@ -25,9 +25,12 @@
# ################################################################
# Version numbers
-LIBVER_MAJOR:=`sed -n '/define XXH_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < xxhash.h`
-LIBVER_MINOR:=`sed -n '/define XXH_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < xxhash.h`
-LIBVER_PATCH:=`sed -n '/define XXH_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < xxhash.h`
+LIBVER_MAJOR_SCRIPT:=`sed -n '/define XXH_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < xxhash.h`
+LIBVER_MINOR_SCRIPT:=`sed -n '/define XXH_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < xxhash.h`
+LIBVER_PATCH_SCRIPT:=`sed -n '/define XXH_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < xxhash.h`
+LIBVER_MAJOR := $(shell echo $(LIBVER_MAJOR_SCRIPT))
+LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT))
+LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT))
LIBVER := $(LIBVER_MAJOR).$(LIBVER_MINOR).$(LIBVER_PATCH)
CFLAGS ?= -O3
@@ -46,21 +49,61 @@ else
EXT =
endif
+# OS X linker doesn't support -soname, and use different extension
+# see : https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html
+ifeq ($(shell uname), Darwin)
+ SHARED_EXT = dylib
+ SHARED_EXT_MAJOR = $(LIBVER_MAJOR).$(SHARED_EXT)
+ SHARED_EXT_VER = $(LIBVER).$(SHARED_EXT)
+ SONAME_FLAGS = -install_name $(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR) -compatibility_version $(LIBVER_MAJOR) -current_version $(LIBVER)
+else
+ SONAME_FLAGS = -Wl,-soname=libxxhash.$(SHARED_EXT).$(LIBVER_MAJOR)
+ SHARED_EXT = so
+ SHARED_EXT_MAJOR = $(SHARED_EXT).$(LIBVER_MAJOR)
+ SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER)
+endif
+
+LIBXXH = libxxhash.$(SHARED_EXT_VER)
+
+
.PHONY: default
-default: xxhsum
+default: lib xxhsum
.PHONY: all
-all: xxhsum xxhsum32 xxhsum_inlinedXXH
+all: lib xxhsum xxhsum32 xxhsum_inlinedXXH
xxhsum32: CFLAGS += -m32
xxhsum xxhsum32: xxhash.c xxhsum.c
- $(CC) $(FLAGS) $^ -o $@$(EXT)
+ $(CC) $(FLAGS) $^ -o $@$(EXT)
ln -sf $@ xxh32sum
ln -sf $@ xxh64sum
xxhsum_inlinedXXH: xxhsum.c
$(CC) $(FLAGS) -DXXH_PRIVATE_API $^ -o $@$(EXT)
+
+# library
+
+libxxhash.a: ARFLAGS = rcs
+libxxhash.a: xxhash.o
+ @echo compiling static library
+ @$(AR) $(ARFLAGS) $@ $^
+
+$(LIBXXH): LDFLAGS += -shared -fPIC
+$(LIBXXH): xxhash.c
+ @echo compiling dynamic library $(LIBVER)
+ @$(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@
+ @echo creating versioned links
+ @ln -sf $@ libxxhash.$(SHARED_EXT_MAJOR)
+ @ln -sf $@ libxxhash.$(SHARED_EXT)
+
+libxxhash : $(LIBXXH)
+
+lib: libxxhash.a libxxhash
+
+
+# tests
+
.PHONY: test
test: xxhsum
# stdin
@@ -154,7 +197,8 @@ test-all: clean all namespaceTest test test32 test-xxhsum-c clean-xxhsum-c \
armtest clangtest gpptest c90test test-mem usan staticAnalyze
clean: clean-xxhsum-c
- @$(RM) -f core *.o xxhsum$(EXT) xxhsum32$(EXT) xxhsum_inlinedXXH$(EXT) xxh32sum xxh64sum
+ @$(RM) core *.o libxxhash.*
+ @$(RM) xxhsum$(EXT) xxhsum32$(EXT) xxhsum_inlinedXXH$(EXT) xxh32sum xxh64sum
@echo cleaning completed
@@ -170,6 +214,10 @@ DESTDIR ?=
prefix ?= /usr/local
PREFIX ?= $(prefix)
exec_prefix ?= $(PREFIX)
+libdir ?= $(exec_prefix)/lib
+LIBDIR ?= $(libdir)
+includedir ?= $(PREFIX)/include
+INCLUDEDIR ?= $(includedir)
bindir ?= $(exec_prefix)/bin
BINDIR ?= $(bindir)
datarootdir ?= $(PREFIX)/share
@@ -193,8 +241,15 @@ INSTALL_DATA ?= $(INSTALL) -m 644
.PHONY: install
-install: xxhsum
- @echo Installing binaries
+install: lib xxhsum
+ @echo Installing libxxhash
+ @$(INSTALL_DATA) libxxhash.a $(DESTDIR)$(LIBDIR)
+ @$(INSTALL_PROGRAM) $(LIBXXH) $(DESTDIR)$(LIBDIR)
+ @ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR)
+ @ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT)
+ @$(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR) # includes
+ @$(INSTALL_DATA) xxhash.h $(DESTDIR)$(INCLUDEDIR)
+ @echo Installing xxhsum
@$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/
@$(INSTALL_PROGRAM) xxhsum $(DESTDIR)$(BINDIR)/xxhsum
@ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh32sum
@@ -203,16 +258,21 @@ install: xxhsum
@$(INSTALL_DATA) xxhsum.1 $(DESTDIR)$(MANDIR)/xxhsum.1
@ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh32sum.1
@ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh64sum.1
- @echo xxhsum installation completed
+ @echo xxhash installation completed
.PHONY: uninstall
uninstall:
- $(RM) $(DESTDIR)$(BINDIR)/xxh32sum
- $(RM) $(DESTDIR)$(BINDIR)/xxh64sum
- $(RM) $(DESTDIR)$(BINDIR)/xxhsum
- $(RM) $(DESTDIR)$(MANDIR)/xxh32sum.1
- $(RM) $(DESTDIR)$(MANDIR)/xxh64sum.1
- $(RM) $(DESTDIR)$(MANDIR)/xxhsum.1
+ @$(RM) $(DESTDIR)$(LIBDIR)/libxxhash.a
+ @$(RM) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT)
+ @$(RM) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR)
+ @$(RM) $(DESTDIR)$(LIBDIR)/$(LIBXXH)
+ @$(RM) $(DESTDIR)$(INCLUDEDIR)/xxhash.h
+ @$(RM) $(DESTDIR)$(BINDIR)/xxh32sum
+ @$(RM) $(DESTDIR)$(BINDIR)/xxh64sum
+ @$(RM) $(DESTDIR)$(BINDIR)/xxhsum
+ @$(RM) $(DESTDIR)$(MANDIR)/xxh32sum.1
+ @$(RM) $(DESTDIR)$(MANDIR)/xxh64sum.1
+ @$(RM) $(DESTDIR)$(MANDIR)/xxhsum.1
@echo xxhsum successfully uninstalled
endif

View File

@ -1,24 +0,0 @@
From 7080470ed35aa1450c2b3b52320778e41bc7d3a3 Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Wed, 18 Oct 2017 10:25:54 +0200
Subject: [PATCH] Create library directory before installing files in it
---
Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index 845e892..c352b51 100644
--- a/Makefile
+++ b/Makefile
@@ -248,6 +248,7 @@ INSTALL_DATA ?= $(INSTALL) -m 644
.PHONY: install
install: lib xxhsum
@echo Installing libxxhash
+ @$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)
@$(INSTALL_DATA) libxxhash.a $(DESTDIR)$(LIBDIR)
@$(INSTALL_PROGRAM) $(LIBXXH) $(DESTDIR)$(LIBDIR)
@ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR)
--
2.13.6

View File

@ -1,6 +1,6 @@
Name: xxhash Name: xxhash
Version: 0.6.3 Version: 0.6.4
Release: 2%{?dist} Release: 1%{?dist}
Summary: Extremely fast hash algorithm Summary: Extremely fast hash algorithm
# The source for the library (xxhash.c and xxhash.h) is BSD # The source for the library (xxhash.c and xxhash.h) is BSD
@ -8,10 +8,6 @@ Summary: Extremely fast hash algorithm
License: BSD and GPLv2+ License: BSD and GPLv2+
URL: http://www.xxhash.com/ URL: http://www.xxhash.com/
Source0: https://github.com/Cyan4973/xxHash/archive/v%{version}/%{name}-%{version}.tar.gz Source0: https://github.com/Cyan4973/xxHash/archive/v%{version}/%{name}-%{version}.tar.gz
# Build library - backport from upstream git (commit bc32865)
Patch0: %{name}-lib.patch
# Create libdir - backport from upstream git (commit 7080470)
Patch1: %{name}-libdir.patch
%description %description
xxHash is an Extremely fast Hash algorithm, running at RAM speed xxHash is an Extremely fast Hash algorithm, running at RAM speed
@ -41,8 +37,6 @@ Development files for the xxhash library
%prep %prep
%setup -q -n xxHash-%{version} %setup -q -n xxHash-%{version}
%patch0 -p1
%patch1 -p1
%build %build
make %{?_smp_mflags} CFLAGS="%{optflags}" MOREFLAGS="%{?__global_ldflags}" make %{?_smp_mflags} CFLAGS="%{optflags}" MOREFLAGS="%{?__global_ldflags}"
@ -74,6 +68,10 @@ make test-xxhsum-c
%{_libdir}/libxxhash.so %{_libdir}/libxxhash.so
%changelog %changelog
* Wed Jan 03 2018 Mattias Ellert <mattias.ellert@physics.uu.se> - 0.6.4-1
- Update to version 0.6.4
- Drop previously backported patches
* Thu Oct 19 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 0.6.3-2 * Thu Oct 19 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 0.6.3-2
- Correct License tag (command line tool is GPLv2+) - Correct License tag (command line tool is GPLv2+)
- Adjust Source tag to get a more descriptive tarfile name - Adjust Source tag to get a more descriptive tarfile name