convertlit: fix build with GCC 14 (#407582)

This commit is contained in:
Yohann Boniface 2025-05-17 14:24:18 +02:00 committed by GitHub
commit f21da74e5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,12 +5,14 @@
libtommath,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "convertlit";
version = "1.8";
src = fetchzip {
url = "http://www.convertlit.com/convertlit${lib.replaceStrings [ "." ] [ "" ] version}src.zip";
url = "http://www.convertlit.com/convertlit${
lib.replaceStrings [ "." ] [ "" ] finalAttrs.version
}src.zip";
sha256 = "182nsin7qscgbw2h92m0zadh3h8q410h5cza6v486yjfvla3dxjx";
stripRoot = false;
};
@ -19,18 +21,22 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "format" ];
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
postPatch = ''
substituteInPlace clit18/Makefile --replace gcc \$\(CC\)
substituteInPlace clit18/Makefile --replace ../libtommath-0.30/libtommath.a -ltommath
'';
buildPhase = ''
cd lib
make
cd ../clit18
substituteInPlace Makefile \
--replace ../libtommath-0.30/libtommath.a -ltommath
make
'';
installPhase = ''
mkdir -p $out/bin
cp clit $out/bin
install -Dm755 clit $out/bin/clit
'';
meta = {
@ -40,4 +46,4 @@ stdenv.mkDerivation rec {
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux;
};
}
})