1{ lib, stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 pname = "libowfat";
5 version = "0.33";
6
7 src = fetchurl {
8 url = "https://www.fefe.de/libowfat/${pname}-${version}.tar.xz";
9 sha256 = "sha256-MR7Is/S3K7RC4yP7ATqY+Vb6dFVH8ryUVih7INAnzX0=";
10 };
11
12 # Fix for glibc 2.34 from Gentoo
13 # https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=914a4aa87415dabfe77181a2365766417a5919a4
14 postPatch = ''
15 # do not define "__pure__", this the gcc builtin (bug #806505)
16 sed 's#__pure__;#__attribute__((__pure__));#' -i fmt.h scan.h byte.h stralloc.h str.h critbit.h || die
17 sed 's#__pure__$#__attrib__pure__#' -i fmt.h scan.h byte.h stralloc.h str.h critbit.h || die
18 # remove unneeded definition of __deprecated__
19 sed '/^#define __deprecated__$/d' -i scan/scan_iso8601.c scan/scan_httpdate.c || die
20 '';
21 preBuild = ''
22 make headers
23 '';
24
25 makeFlags = [ "prefix=$(out)" ];
26 enableParallelBuilding = true;
27
28 meta = with lib; {
29 description = "A GPL reimplementation of libdjb";
30 homepage = "https://www.fefe.de/libowfat/";
31 license = licenses.gpl2;
32 platforms = platforms.linux;
33 };
34}