2022-09-30 01:58:59 +00:00
{ lib , stdenv , fetchFromGitHub , libxcrypt }:
2017-03-22 22:44:19 +00:00
2017-03-23 23:04:36 +00:00
stdenv . mkDerivation rec {
2019-08-15 12:41:18 +00:00
pname = " c d e " ;
2017-03-23 23:04:36 +00:00
version = " 0 . 1 " ;
src = fetchFromGitHub {
2020-11-01 00:44:05 +00:00
owner = " u s n i s t g o v " ;
repo = " c o r r - C D E " ;
2017-03-23 23:04:36 +00:00
rev = " v ${ version } " ;
2020-11-01 00:44:05 +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 = " ;
2017-03-22 22:44:19 +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-09-30 01:58:59 +00:00
buildInputs = [ libxcrypt ] ;
2017-03-22 22:44:19 +00:00
patchBuild = ''
2020-11-01 00:44:05 +00:00
sed - i - e ' /install/d ' $ src/Makefile
2017-03-22 22:44:19 +00:00
'' ;
2020-11-01 00:44:05 +00:00
preBuild = ''
patchShebangs .
'' ;
2022-05-19 15:13:05 +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-02-19 19:23:32 +00:00
env . NIX_CFLAGS_COMPILE = " - f c o m m o n " ;
2022-05-19 15:13:05 +00:00
2017-03-22 22:44:19 +00:00
installPhase = ''
2020-11-01 00:44:05 +00:00
install - d $ out/bin
install - t $ out/bin cde cde-exec
2017-03-22 22:44:19 +00:00
'' ;
2021-01-11 07:54:33 +00:00
meta = with lib ; {
2022-01-07 06:57:33 +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 " ;
2017-03-22 22:44:19 +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-01 00:44:05 +00:00
license = licenses . gpl3Plus ;
2017-03-22 22:44:19 +00:00
maintainers = [ maintainers . rlupton20 ] ;
platforms = platforms . linux ;
2022-05-19 15:13:05 +00:00
# error: architecture aarch64 is not supported by bundled strace
2018-12-10 03:36:38 +00:00
badPlatforms = [ " a a r c h 6 4 - l i n u x " ] ;
2017-03-22 22:44:19 +00:00
} ;
}