Unverified Commit aed6e56f authored by Wolfgang Walther's avatar Wolfgang Walther Committed by GitHub
Browse files

ocaml-ng: drop ocaml <=4.08 (#427222)

parents 291b5a6c 36c4abcd
Loading
Loading
Loading
Loading
+0 −99
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchurl,
  fetchpatch,
  ncurses,
  libX11,
}:

let
  useX11 = !stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isMips;
  useNativeCompilers = !stdenv.hostPlatform.isMips;
  inherit (lib) optional optionals optionalString;
in

stdenv.mkDerivation rec {
  pname = "ocaml";
  version = "4.00.1";

  src = fetchurl {
    url = "https://caml.inria.fr/pub/distrib/ocaml-4.00/${pname}-${version}.tar.bz2";
    sha256 = "33c3f4acff51685f5bfd7c260f066645e767d4e865877bf1613c176a77799951";
  };

  # Compatibility with Glibc 2.34
  patches = [
    (fetchpatch {
      url = "https://github.com/ocaml/ocaml/commit/60b0cdaf2519d881947af4175ac4c6ff68901be3.patch";
      sha256 = "sha256:07g9q9sjk4xsbqix7jxggfp36v15pmqw4bms80g5car0hfbszirn";
    })
  ];

  # Workaround build failure on -fno-common toolchains like upstream
  # gcc-10. Otherwise build fails as:
  #   ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of
  #     `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here
  env.NIX_CFLAGS_COMPILE = "-fcommon";

  prefixKey = "-prefix ";
  configureFlags = [
    "-no-tk"
  ]
  ++ optionals useX11 [
    "-x11lib"
    libX11
  ];
  buildFlags = [
    "world"
  ]
  ++ optionals useNativeCompilers [
    "bootstrap"
    "world.opt"
  ];
  buildInputs = [ ncurses ] ++ optionals useX11 [ libX11 ];
  installTargets = "install" + optionalString useNativeCompilers " installopt";
  preConfigure = ''
    CAT=$(type -tp cat)
    sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
  '';
  postBuild = ''
    mkdir -p $out/include
    ln -sv $out/lib/ocaml/caml $out/include/caml
  '';

  passthru = {
    nativeCompilers = useNativeCompilers;
  };

  meta = with lib; {
    homepage = "http://caml.inria.fr/ocaml";
    branch = "4.00";
    license = with licenses; [
      qpl # compiler
      lgpl2 # library
    ];
    description = "Most popular variant of the Caml language";

    longDescription = ''
      OCaml is the most popular variant of the Caml language.  From a
      language standpoint, it extends the core Caml language with a
      fully-fledged object-oriented layer, as well as a powerful module
      system, all connected by a sound, polymorphic type system featuring
      type inference.

      The OCaml system is an industrial-strength implementation of this
      language, featuring a high-performance native-code compiler (ocamlopt)
      for 9 processor architectures (IA32, PowerPC, AMD64, Alpha, Sparc,
      Mips, IA64, HPPA, StrongArm), as well as a bytecode compiler (ocamlc)
      and an interactive read-eval-print loop (ocaml) for quick development
      and portability.  The OCaml distribution includes a comprehensive
      standard library, a replay debugger (ocamldebug), lexer (ocamllex) and
      parser (ocamlyacc) generators, a pre-processor pretty-printer (camlp4)
      and a documentation generator (ocamldoc).
    '';

    platforms = with platforms; linux;
  };

}
+0 −21
Original line number Diff line number Diff line
import ./generic.nix {
  major_version = "4";
  minor_version = "01";
  patch_version = "0";
  patches = [
    ./fix-clang-build-on-osx.diff

    # Compatibility with Glibc 2.34
    {
      url = "https://github.com/ocaml/ocaml/commit/d111407bf4ff71171598d30825c8e59ed5f75fd6.patch";
      sha256 = "sha256:08mpy7lsiwv8m5qrqc4xzyiv2hri5713gz2qs1nfz02hz1bd79mc";
    }
  ];
  sha256 = "03d7ida94s1gpr3gadf4jyhmh5rrszd5s4m4z59daaib25rvfyv7";

  # Workaround build failure on -fno-common toolchains like upstream
  # gcc-10. Otherwise build fails as:
  #   ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of
  #     `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here
  env.NIX_CFLAGS_COMPILE = "-fcommon";
}
+0 −26
Original line number Diff line number Diff line
import ./generic.nix {
  major_version = "4";
  minor_version = "02";
  patch_version = "3";
  patches = [
    ./ocamlbuild.patch

    # Compatibility with Glibc 2.34
    {
      url = "https://github.com/ocaml/ocaml/commit/9de2b77472aee18a94b41cff70caee27fb901225.patch";
      sha256 = "sha256:12sw512kpwk0xf2g6j0h5vqgd8xcmgrvgyilx6fxbd6bnfv1yib9";
    }
    # Compatibility with Binutils 2.29
    {
      url = "https://github.com/ocaml/ocaml/commit/bcc7a767279ff70518b3f4219cc0b9bffec7dd43.patch";
      sha256 = "sha256-z3xrqN6bh/EW9dkPg6Hz8mT79DFm26yGRoPbE+RMYi0=";
    }
  ];
  sha256 = "1qwwvy8nzd87hk8rd9sm667nppakiapnx4ypdwcrlnav2dz6kil3";

  # Workaround build failure on -fno-common toolchains like upstream
  # gcc-10. Otherwise build fails as:
  #   ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of
  #     `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here
  env.NIX_CFLAGS_COMPILE = "-fcommon";
}
+0 −25
Original line number Diff line number Diff line
import ./generic.nix {
  major_version = "4";
  minor_version = "03";
  patch_version = "0";
  sha256 = "09p3iwwi55r6rbrpyp8f0wmkb0ppcgw67yxw6yfky60524wayp39";

  patches = [
    # Compatibility with Glibc 2.34
    {
      url = "https://github.com/ocaml/ocaml/commit/a8b2cc3b40f5269ce8525164ec2a63b35722b22b.patch";
      sha256 = "sha256:1rrknmrk86xrj2k3hznnjk1gwnliyqh125zabg1hvy6dlvml9b0x";
    }
    # Compatibility with Binutils 2.29
    {
      url = "https://github.com/ocaml/ocaml/commit/c204f07bfb20174f9e1c9ff586fb7b2f42b8bf18.patch";
      sha256 = "sha256-AAXyMZ7ujO67SGz+tGXKZkVcINAwvccHlFHmKnUt848=";
    }
  ];

  # Workaround build failure on -fno-common toolchains like upstream
  # gcc-10. Otherwise build fails as:
  #   ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of
  #     `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here
  env.NIX_CFLAGS_COMPILE = "-fcommon";
}
+0 −28
Original line number Diff line number Diff line
import ./generic.nix {
  major_version = "4";
  minor_version = "04";
  patch_version = "2";
  sha256 = "0bhgjzi78l10824qga85nlh18jg9lb6aiamf9dah1cs6jhzfsn6i";

  # If the executable is stripped it does not work
  dontStrip = true;

  patches = [
    # Compatibility with Glibc 2.34
    {
      url = "https://github.com/ocaml/ocaml/commit/6bcff7e6ce1a43e088469278eb3a9341e6a2ca5b.patch";
      sha256 = "sha256:1hd45f7mwwrrym2y4dbcwklpv0g94avbz7qrn81l7w8mrrj3bngi";
    }
    # Compatibility with Binutils 2.29
    {
      url = "https://github.com/ocaml/ocaml/commit/db11f141a0e35c7fbaec419a33c4c39d199e2635.patch";
      sha256 = "sha256-oIwmbXOCzDGyASpbQ7hd7SCs4YHjd9hBBksJ74V3GiY=";
    }
  ];

  # Workaround build failure on -fno-common toolchains like upstream
  # gcc-10. Otherwise build fails as:
  #   ld: libcamlrun.a(startup.o):(.bss+0x800): multiple definition of
  #     `caml_code_fragments_table'; libcamlrun.a(backtrace.o):(.bss+0x20): first defined here
  env.NIX_CFLAGS_COMPILE = "-fcommon";
}
Loading