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, libtommath,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: {
pname = "convertlit"; pname = "convertlit";
version = "1.8"; version = "1.8";
src = fetchzip { 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"; sha256 = "182nsin7qscgbw2h92m0zadh3h8q410h5cza6v486yjfvla3dxjx";
stripRoot = false; stripRoot = false;
}; };
@ -19,18 +21,22 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "format" ]; 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 = '' buildPhase = ''
cd lib cd lib
make make
cd ../clit18 cd ../clit18
substituteInPlace Makefile \
--replace ../libtommath-0.30/libtommath.a -ltommath
make make
''; '';
installPhase = '' installPhase = ''
mkdir -p $out/bin install -Dm755 clit $out/bin/clit
cp clit $out/bin
''; '';
meta = { meta = {
@ -40,4 +46,4 @@ stdenv.mkDerivation rec {
license = lib.licenses.gpl2Plus; license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux; platforms = lib.platforms.linux;
}; };
} })