python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / libowfat / default.nix
blob3dfb910f1cd6d6f1a347b728a64a695f5cd0b703
1 { lib, stdenv, fetchurl }:
3 stdenv.mkDerivation rec {
4   pname = "libowfat";
5   version = "0.32";
7   src = fetchurl {
8     url = "https://www.fefe.de/libowfat/${pname}-${version}.tar.xz";
9     sha256 = "1hcqg7pvy093bxx8wk7i4gvbmgnxz2grxpyy7b4mphidjbcv7fgl";
10   };
12   patches = [
13     (fetchurl {
14       name = "first_deferred.patch";
15       url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/libowfat/files/libowfat-0.32-gcc10.patch?id=129f4ab9f8571c651937c46ba7bd4c82d6d052a2";
16       sha256 = "zxWb9qq5dkDucOsiPfGG1Gb4BZ6HmhBjgSe3tBnydP4=";
17     })
18   ];
20   # Fix for glibc 2.34 from Gentoo
21   # https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=914a4aa87415dabfe77181a2365766417a5919a4
22   postPatch = ''
23     # do not define "__pure__", this the gcc builtin (bug #806505)
24     sed 's#__pure__;#__attribute__((__pure__));#' -i fmt.h scan.h byte.h stralloc.h str.h critbit.h || die
25     sed 's#__pure__$#__attrib__pure__#' -i  fmt.h scan.h byte.h stralloc.h str.h critbit.h || die
26     # remove unneeded definition of __deprecated__
27     sed '/^#define __deprecated__$/d' -i scan/scan_iso8601.c scan/scan_httpdate.c || die
28   '';
30   makeFlags = [ "prefix=$(out)" ];
31   enableParallelBuilding = true;
33   meta = with lib; {
34     description = "A GPL reimplementation of libdjb";
35     homepage = "https://www.fefe.de/libowfat/";
36     license = licenses.gpl2;
37     platforms = platforms.linux;
38   };