Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/bitshuffle/files/, dev-libs/bitshuffle/
Date: Wed, 19 Jan 2022 09:21:14
Message-Id: 1642584066.e13afd32c88258f381c8e35e2520201f18211b2d.fordfrog@gentoo
1 commit: e13afd32c88258f381c8e35e2520201f18211b2d
2 Author: Yuan Liao <liaoyuan <AT> gmail <DOT> com>
3 AuthorDate: Mon Dec 20 15:56:10 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 19 09:21:06 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e13afd32
7
8 dev-libs/bitshuffle: Initial import
9
10 Signed-off-by: Yuan Liao <liaoyuan <AT> gmail.com>
11 Closes: https://github.com/gentoo/gentoo/pull/23438/commits/2f68538368b6456bdd83fe9dd7b9b159bb850756
12 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
13
14 dev-libs/bitshuffle/Manifest | 1 +
15 dev-libs/bitshuffle/bitshuffle-0.3.5.ebuild | 37 ++++++++++++++++
16 .../bitshuffle/files/bitshuffle-0.3.5-Makefile | 50 ++++++++++++++++++++++
17 dev-libs/bitshuffle/metadata.xml | 11 +++++
18 4 files changed, 99 insertions(+)
19
20 diff --git a/dev-libs/bitshuffle/Manifest b/dev-libs/bitshuffle/Manifest
21 new file mode 100644
22 index 000000000000..4ac005d2b7cd
23 --- /dev/null
24 +++ b/dev-libs/bitshuffle/Manifest
25 @@ -0,0 +1 @@
26 +DIST bitshuffle-0.3.5.tar.gz 112312 BLAKE2B e9e70608217743a93d2bf5319af0f48feff391bb2893b161a1a4c391ab630c90fc59483041d7594eb8366a9469feb309f3b8054c8ecc630d070a9170735f61f5 SHA512 4ae371ab2e1adedb5c3a2c047e0583d320c87f0687d9dc1c921ed9e38d8b90a447fb305f399cd591adf48a473471fd5827f4da2777dd7f0fb6d5fd145fdeb36f
27
28 diff --git a/dev-libs/bitshuffle/bitshuffle-0.3.5.ebuild b/dev-libs/bitshuffle/bitshuffle-0.3.5.ebuild
29 new file mode 100644
30 index 000000000000..3a4dd5a7574d
31 --- /dev/null
32 +++ b/dev-libs/bitshuffle/bitshuffle-0.3.5.ebuild
33 @@ -0,0 +1,37 @@
34 +# Copyright 2021-2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +inherit toolchain-funcs
40 +
41 +DESCRIPTION="Bitshuffle C library"
42 +HOMEPAGE="https://github.com/kiyo-masui/bitshuffle"
43 +SRC_URI="https://github.com/kiyo-masui/bitshuffle/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
44 +
45 +LICENSE="MIT"
46 +SLOT="0"
47 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
48 +
49 +DEPEND="
50 + app-arch/lz4
51 +"
52 +
53 +src_prepare() {
54 + cp "${FILESDIR}/${P}-Makefile" "Makefile" || die "Failed to copy Makefile"
55 + default
56 +}
57 +
58 +src_configure() {
59 + tc-export CC
60 + export PACKAGE_VERSION="${PV}"
61 +}
62 +
63 +src_install() {
64 + local prefix="${EPREFIX}/usr"
65 + emake \
66 + DESTDIR="${D}" \
67 + PREFIX="${prefix}" \
68 + LIBDIR="${prefix}/$(get_libdir)" \
69 + install
70 +}
71
72 diff --git a/dev-libs/bitshuffle/files/bitshuffle-0.3.5-Makefile b/dev-libs/bitshuffle/files/bitshuffle-0.3.5-Makefile
73 new file mode 100644
74 index 000000000000..f38d0cc5f149
75 --- /dev/null
76 +++ b/dev-libs/bitshuffle/files/bitshuffle-0.3.5-Makefile
77 @@ -0,0 +1,50 @@
78 +# Gentoo custom Makefile for Bitshuffle C library
79 +# Adapted from GNU Guix:
80 +# https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/python-compression.scm?h=v1.3.0#n346
81 +# Distributed under the terms of the GNU General Public License v3
82 +
83 +# To avoid bundled dependency, the copy of lz4 included
84 +# in Bitshuffle's source tree is not used
85 +
86 +PACKAGE_VERSION ?= 0.3.5
87 +
88 +# Upstream has never specified an soname, so we need to conduct downstream
89 +# soname versioning. The format of soname is "lib${PN}.so.$(ver_cut 1)".
90 +# No incompatible ABI changes have been observed yet since version 0.2.4,
91 +# but just in case the upstream recklessly handles ABI compatibility,
92 +# please try to test ABI compatibility when updating to a new release,
93 +# using tools like 'abidiff' in dev-util/libabigail or alike.
94 +SONAME_VERSION := $(shell echo $(PACKAGE_VERSION) | cut -d. -f1)
95 +SONAME_BASE = libbitshuffle.so
96 +SONAME := $(SONAME_BASE).$(SONAME_VERSION)
97 +SOFILE := $(SONAME_BASE).$(PACKAGE_VERSION)
98 +
99 +CFLAGS := -O3 -ffast-math -std=c99 -fPIC $(CFLAGS)
100 +
101 +OBJS = \
102 + src/bitshuffle.o \
103 + src/bitshuffle_core.o \
104 + src/iochain.o
105 +
106 +$(SOFILE): $(OBJS)
107 + $(CC) $(CFLAGS) -o $@ -shared $(LDFLAGS) -Wl,-soname,$(SONAME) $^
108 +
109 +%.o: %.c
110 + $(CC) $(CFLAGS) -Isrc -c $< -o $@
111 +
112 +INSTALL = install
113 +LN_S = ln -s
114 +
115 +PREFIX = /usr/local
116 +LIBDIR = $(PREFIX)/lib
117 +INCLUDEDIR = $(PREFIX)/include
118 +
119 +install: $(SOFILE)
120 + $(INSTALL) -dm755 $(DESTDIR)$(LIBDIR)
121 + $(INSTALL) -dm755 $(DESTDIR)$(INCLUDEDIR)
122 + $(INSTALL) -m755 $(SOFILE) $(DESTDIR)$(LIBDIR)
123 + $(INSTALL) -m644 src/bitshuffle.h $(DESTDIR)$(INCLUDEDIR)
124 + $(INSTALL) -m644 src/bitshuffle_core.h $(DESTDIR)$(INCLUDEDIR)
125 + $(INSTALL) -m644 src/iochain.h $(DESTDIR)$(INCLUDEDIR)
126 + $(LN_S) $(SOFILE) $(DESTDIR)$(LIBDIR)/$(SONAME_BASE)
127 + $(LN_S) $(SOFILE) $(DESTDIR)$(LIBDIR)/$(SONAME)
128
129 diff --git a/dev-libs/bitshuffle/metadata.xml b/dev-libs/bitshuffle/metadata.xml
130 new file mode 100644
131 index 000000000000..1dca9429232c
132 --- /dev/null
133 +++ b/dev-libs/bitshuffle/metadata.xml
134 @@ -0,0 +1,11 @@
135 +<?xml version="1.0" encoding="UTF-8"?>
136 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
137 +<pkgmetadata>
138 + <maintainer type="project">
139 + <email>java@g.o</email>
140 + <name>Java</name>
141 + </maintainer>
142 + <upstream>
143 + <remote-id type="github">kiyo-masui/bitshuffle</remote-id>
144 + </upstream>
145 +</pkgmetadata>