git.iko.soy/typeable/nixpkgs
on master help sign in
pkgsMusl.tbb: fix build

Use patches from openembedded: https://github.com/openembedded/meta-openembedded/tree/39185eb1d1615e919e3ae14ae63b8ed7d3e5d83f/meta-oe/recipes-support/tbb/tbb Also apply the patches unconditionally so that it is obvious when they do not apply any more.

commitd2f30b0b11e66f8064132357892340fd814f8338 authorJan Tojnar <jtojnar@gmail.com> dateTue 11 May 2021, 15:53 (6 years ago) parent99396a4
2 files changed+13−45
pkgs/development/libraries/tbb/default.nix+13−2 pkgs/development/libraries/tbb/glibc-struct-mallinfo.patch−43
pkgs/development/libraries/tbb/default.nix+13−2
@@ -1,5 +1,6 @@
11{ lib
22, stdenv
3+, fetchurl
34, fetchFromGitHub
45, fixDarwinDylibNames
56}:
@@ -15,8 +16,18 @@ stdenv.mkDerivation rec {
1516 sha256 = "prO2O5hd+Wz5iA0vfrqmyHFr0Ptzk64so5KpSpvuKmU=";
1617 };
1718
18− patches = lib.optionals stdenv.hostPlatform.isMusl [
19− ./glibc-struct-mallinfo.patch
19+ patches = [
20+ # Fixes build with Musl.
21+ (fetchurl {
22+ url = "https://github.com/openembedded/meta-openembedded/raw/39185eb1d1615e919e3ae14ae63b8ed7d3e5d83f/meta-oe/recipes-support/tbb/tbb/GLIBC-PREREQ-is-not-defined-on-musl.patch";
23+ sha256 = "gUfXQ9OZQ82qD6brgauBCsKdjLvyHafMc18B+KxZoYs=";
24+ })
25+
26+ # Fixes build with Musl.
27+ (fetchurl {
28+ url = "https://github.com/openembedded/meta-openembedded/raw/39185eb1d1615e919e3ae14ae63b8ed7d3e5d83f/meta-oe/recipes-support/tbb/tbb/0001-mallinfo-is-glibc-specific-API-mark-it-so.patch";
29+ sha256 = "fhorfqO1hHKZ61uq+yTR7eQ8KYdyLwpM3K7WpwJpV74=";
30+ })
2031 ];
2132
2233 nativeBuildInputs = lib.optionals stdenv.isDarwin [
pkgs/development/libraries/tbb/glibc-struct-mallinfo.patchdeleted−43
@@ -1,43 +0,0 @@
1−From b577153a10c98f4e13405dc93ea2ab1a7b990e07 Mon Sep 17 00:00:00 2001
2−From: David Huffman <storedbox+alpine@outlook.com>
3−Date: Wed, 6 Jan 2016 07:09:30 -0500
4−Subject: [PATCH] hard-code glibc's definition of struct mallinfo
5−
6−---
7− src/tbbmalloc/proxy.h | 20 ++++++++++++++++++++
8− 1 file changed, 20 insertions(+)
9−
10−diff --git a/src/tbbmalloc/proxy.h b/src/tbbmalloc/proxy.h
11−index 781cadc..e1ea1ae 100644
12−--- a/src/tbbmalloc/proxy.h
13−+++ b/src/tbbmalloc/proxy.h
14−@@ -32,6 +32,26 @@
15−
16− #include <stddef.h>
17−
18−+// The following definition was taken from /usr/include/malloc.h as provided by
19−+// the glibc-devel-2.19-17.4.x86_64 package on openSUSE Leap 42.1; it is
20−+// made available under the GNU Lesser General Public License v2.1 or later.
21−+// See <https://www.gnu.org/licenses>.
22−+//
23−+// Copyright (C) 1996-2014 Free Software Foundation, Inc.
24−+struct mallinfo
25−+{
26−+ int arena; /* non-mmapped space allocated from system */
27−+ int ordblks; /* number of free chunks */
28−+ int smblks; /* number of fastbin blocks */
29−+ int hblks; /* number of mmapped regions */
30−+ int hblkhd; /* space in mmapped regions */
31−+ int usmblks; /* maximum total allocated space */
32−+ int fsmblks; /* space available in freed fastbin blocks */
33−+ int uordblks; /* total allocated space */
34−+ int fordblks; /* total free space */
35−+ int keepcost; /* top-most, releasable (via malloc_trim) space */
36−+};
37−+
38− extern "C" {
39− void * scalable_malloc(size_t size);
40− void * scalable_calloc(size_t nobj, size_t size);
41−--
42−2.6.2
43−