Commit 1abbbc0a authored by Jiajie Chen's avatar Jiajie Chen
Browse files

ecl: import upstream patches for gcc15 compat

Instead of downgrading to C17, import upstream patches for gcc15
compatibility. So downstream packages e.g. sage can build correctly
without setting CFLAGS.
parent 26f2138c
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -56,11 +56,24 @@ stdenv.mkDerivation rec {
      url = "https://raw.githubusercontent.com/sagemath/sage/9.2/build/pkgs/ecl/patches/write_error.patch";
      sha256 = "0hfxacpgn4919hg0mn4wf4m8r7y592r4gw7aqfnva7sckxi6w089";
    })
    # Fix gcc15 compat for downstream packages e.g. sage
    # error: ‘bool’ cannot be defined via ‘typedef’
    (fetchpatch {
      url = "https://gitlab.com/embeddable-common-lisp/ecl/-/commit/1aec8f741f69fd736f020b7fe4d3afc33e60ae6a.patch";
      sha256 = "sha256-/cA6iOOob0ATViQm5EwBbdin5peqRMjLPKa7RjkrJ94=";
    })
    # error: too many arguments to function 'fn'; expected 0, have 1
    (fetchpatch {
      url = "https://gitlab.com/embeddable-common-lisp/ecl/-/commit/5b4e9c4bbd7cce4a678eecd493e56c495490e8b5.patch";
      sha256 = "sha256-QHxswFiW2rfDAQ98Sl+VVmyP4M/eIjJWQEcR/B+m398=";
    })
    (fetchpatch {
      url = "https://gitlab.com/embeddable-common-lisp/ecl/-/commit/5ec9e02f6db9694dcdef7574036f1e320d64a8af.patch";
      sha256 = "sha256-ZRah0IqOt6OQZGqlCq0RKiToyxsRXQEXAiSUGgqZnKU=";
    })
  ];

  configureFlags = [
    # Fix build with gcc15
    "CFLAGS=-std=gnu17"
    (if threadSupport then "--enable-threads" else "--disable-threads")
    "--with-gmp-incdir=${lib.getDev gmp}/include"
    "--with-gmp-libdir=${lib.getLib gmp}/lib"