2022-10-30 15:09:59 +00:00
{ lib , stdenv , fetchFromGitHub , libxcrypt }:
2020-04-24 23:36:52 +00:00
stdenv . mkDerivation rec {
pname = " c d e " ;
version = " 0 . 1 " ;
src = fetchFromGitHub {
2020-11-03 02:18:15 +00:00
owner = " u s n i s t g o v " ;
repo = " c o r r - C D E " ;
2020-04-24 23:36:52 +00:00
rev = " v ${ version } " ;
2020-11-03 02:18:15 +00:00
sha256 = " s h a 2 5 6 - s 3 7 5 g t q B W x 0 G G X A L X R + f N 4 b b 3 t m p v P N u / 3 b N z + 7 5 U W U = " ;
2020-04-24 23:36:52 +00:00
} ;
# The build is small, so there should be no problem
# running this locally. There is also a use case for
# older systems, where modern binaries might not be
# useful.
preferLocalBuild = true ;
2022-10-30 15:09:59 +00:00
buildInputs = [ libxcrypt ] ;
2020-04-24 23:36:52 +00:00
patchBuild = ''
2020-11-03 02:18:15 +00:00
sed - i - e ' /install/d ' $ src/Makefile
2020-04-24 23:36:52 +00:00
'' ;
2020-11-03 02:18:15 +00:00
preBuild = ''
patchShebangs .
'' ;
2022-06-16 17:23:12 +00:00
# Workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: ../readelf-mini/libreadelf-mini.a(dwarf.o):/build/source/readelf-mini/dwarf.c:64:
# multiple definition of `do_wide'; ../readelf-mini/libreadelf-mini.a(readelf-mini.o):/build/source/readelf-mini/readelf-mini.c:170: first defined here
2023-03-04 12:14:45 +00:00
env . NIX_CFLAGS_COMPILE = " - f c o m m o n " ;
2022-06-16 17:23:12 +00:00
2020-04-24 23:36:52 +00:00
installPhase = ''
2020-11-03 02:18:15 +00:00
install - d $ out/bin
install - t $ out/bin cde cde-exec
2020-04-24 23:36:52 +00:00
'' ;
2021-01-15 22:18:51 +00:00
meta = with lib ; {
2022-01-13 20:06:32 +00:00
homepage = " h t t p s : / / g i t h u b . c o m / u s n i s t g o v / c o r r - C D E " ;
2020-04-24 23:36:52 +00:00
description = " A p a c k a g i n g t o o l f o r b u i l d i n g p o r t a b l e p a c k a g e s " ;
2020-11-03 02:18:15 +00:00
license = licenses . gpl3Plus ;
2020-04-24 23:36:52 +00:00
maintainers = [ maintainers . rlupton20 ] ;
platforms = platforms . linux ;
2022-06-16 17:23:12 +00:00
# error: architecture aarch64 is not supported by bundled strace
2020-04-24 23:36:52 +00:00
badPlatforms = [ " a a r c h 6 4 - l i n u x " ] ;
} ;
}