at 23.11-beta 42 lines 1.0 kB view raw
1{ lib, stdenv, fetchurl }: 2 3stdenv.mkDerivation rec { 4 pname = "ustr"; 5 version = "1.0.4"; 6 7 src = fetchurl { 8 url = "http://www.and.org/ustr/${version}/${pname}-${version}.tar.bz2"; 9 sha256 = "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx"; 10 }; 11 12 # Fixes bogus warnings that failed libsemanage 13 patches = [ ./va_args.patch ]; 14 15 # Work around gcc5 switch to gnu11 16 env.NIX_CFLAGS_COMPILE = "-std=gnu89"; 17 18 # Fix detection of stdint.h 19 postPatch = '' 20 sed -i 's,\(have_stdint_h\)=0,\1=1,g' Makefile 21 sed -i 's,\(USTR_CONF_HAVE_STDINT_H\) 0,\1 1,g' ustr-import.in 22 ''; 23 24 preBuild = '' 25 makeFlagsArray+=("prefix=$out") 26 makeFlagsArray+=("LDCONFIG=echo") 27 makeFlagsArray+=("HIDE=") 28 ''; 29 30 # Remove debug libraries 31 postInstall = '' 32 find $out/lib -name \*debug\* -delete 33 ''; 34 35 meta = with lib; { 36 homepage = "http://www.and.org/ustr/"; 37 description = "Micro String API for C language"; 38 license = licenses.bsd2; 39 maintainers = [ ]; 40 platforms = platforms.linux; 41 }; 42}