2024-05-10 02:05:39 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchgit,
|
|
|
|
}:
|
2011-03-27 04:46:05 +00:00
|
|
|
|
2024-05-10 01:48:45 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "ustr";
|
2011-03-27 04:46:05 +00:00
|
|
|
version = "1.0.4";
|
|
|
|
|
2024-05-10 01:48:45 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "http://www.and.org/ustr/ustr.git";
|
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-pQrQy+S9fVFl8Mop4QmwEAXGiBSheQE4HgAZ4srFz64=";
|
2011-03-27 04:46:05 +00:00
|
|
|
};
|
2013-02-24 12:25:53 +00:00
|
|
|
|
2015-07-31 19:38:36 +00:00
|
|
|
# Fixes bogus warnings that failed libsemanage
|
|
|
|
patches = [ ./va_args.patch ];
|
|
|
|
|
|
|
|
# Work around gcc5 switch to gnu11
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-std=gnu89";
|
2015-07-31 19:38:36 +00:00
|
|
|
|
|
|
|
# Fix detection of stdint.h
|
|
|
|
postPatch = ''
|
2024-05-10 02:05:39 +00:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace-fail "have_stdint_h=0" "have_stdint_h=1"
|
2011-03-27 04:46:05 +00:00
|
|
|
|
2024-05-10 02:05:39 +00:00
|
|
|
cat ustr-import.in | grep USTR_CONF
|
|
|
|
substituteInPlace ustr-import.in \
|
|
|
|
--replace-fail "USTR_CONF_HAVE_STDINT_H 0" "USTR_CONF_HAVE_STDINT_H 1"
|
2015-07-31 19:38:36 +00:00
|
|
|
'';
|
2011-03-27 04:46:05 +00:00
|
|
|
|
2024-05-10 02:05:39 +00:00
|
|
|
makeFlags = [
|
|
|
|
"prefix=${placeholder "out"}"
|
|
|
|
"LDCONFIG=echo"
|
|
|
|
"HIDE="
|
|
|
|
];
|
|
|
|
|
2015-07-31 19:38:36 +00:00
|
|
|
# Remove debug libraries
|
|
|
|
postInstall = ''
|
|
|
|
find $out/lib -name \*debug\* -delete
|
|
|
|
'';
|
2011-03-27 04:46:05 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.and.org/ustr/";
|
2011-03-27 04:46:05 +00:00
|
|
|
description = "Micro String API for C language";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "ustr-import";
|
2011-03-27 04:46:05 +00:00
|
|
|
license = licenses.bsd2;
|
2024-05-10 01:36:51 +00:00
|
|
|
maintainers = with lib.maintainers; [ sigmanificient ];
|
2016-08-02 17:50:55 +00:00
|
|
|
platforms = platforms.linux;
|
2011-03-27 04:46:05 +00:00
|
|
|
};
|
2024-05-10 01:48:45 +00:00
|
|
|
})
|