Unverified Commit ce4f3d5a authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

mono: remove llvm build (#391966)

parents e6256d7b bf6a2d24
Loading
Loading
Loading
Loading
+10 −25
Original line number Diff line number Diff line
@@ -9,11 +9,9 @@
  perl,
  libgdiplus,
  libX11,
  callPackage,
  ncurses,
  zlib,
  bash,
  withLLVM ? false,
  cacert,
  Foundation,
  libobjc,
@@ -32,9 +30,6 @@
  env ? { },
}:

let
  llvm = callPackage ./llvm.nix { };
in
stdenv.mkDerivation rec {
  pname = "mono";
  inherit version env;
@@ -72,15 +67,10 @@ stdenv.mkDerivation rec {
      libobjc
    ];

  configureFlags =
    [
  configureFlags = [
    "--x-includes=${libX11.dev}/include"
    "--x-libraries=${libX11.out}/lib"
    "--with-libgdiplus=${libgdiplus}/lib/libgdiplus.so"
    ]
    ++ lib.optionals withLLVM [
      "--enable-llvm"
      "--with-llvm=${llvm}"
  ];

  configurePhase = ''
@@ -92,15 +82,10 @@ stdenv.mkDerivation rec {
  # because we control pkg-config
  patches = [ ./pkgconfig-before-gac.patch ] ++ extraPatches;

  # Patch all the necessary scripts. Also, if we're using LLVM, we fix the default
  # LLVM path to point into the Mono LLVM build, since it's private anyway.
  preBuild =
    ''
  # Patch all the necessary scripts
  preBuild = ''
    makeFlagsArray=(INSTALL=`type -tp install`)
      substituteInPlace mcs/class/corlib/System/Environment.cs --replace /usr/share "$out/share"
    ''
    + lib.optionalString withLLVM ''
      substituteInPlace mono/mini/aot-compiler.c --replace "llvm_path = g_strdup (\"\")" "llvm_path = g_strdup (\"${llvm}/bin/\")"
    substituteInPlace mcs/class/corlib/System/Environment.cs --replace-fail /usr/share "$out/share"
  '';

  # Fix mono DLLMap so it can find libX11 to run winforms apps
+0 −64
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  fetchFromGitHub,
  groff,
  cmake,
  python2,
  perl,
  libffi,
  libbfd,
  libxml2,
  valgrind,
  ncurses,
  zlib,
}:

stdenv.mkDerivation {
  pname = "llvm";
  version = "3.6-mono-2017-02-15";

  src = fetchFromGitHub {
    owner = "mono";
    repo = "llvm";
    rev = "dbb6fdffdeb780d11851a6be77c209bd7ada4bd3";
    sha256 = "07wd1cs3fdvzb1lv41b655z5zk34f47j8fgd9ljjimi5j9pj71f7";
  };

  nativeBuildInputs = [ cmake ];
  buildInputs = [
    perl
    groff
    libxml2
    python2
    libffi
  ] ++ lib.optional stdenv.hostPlatform.isLinux valgrind;

  propagatedBuildInputs = [
    ncurses
    zlib
  ];

  # hacky fix: created binaries need to be run before installation
  preBuild = ''
    mkdir -p $out/
    ln -sv $PWD/lib $out
  '';
  postBuild = "rm -fR $out";

  cmakeFlags =
    with stdenv;
    [
      "-DLLVM_ENABLE_FFI=ON"
      "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
    ]
    ++ lib.optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON";

  meta = {
    description = "Collection of modular and reusable compiler and toolchain technologies - Mono build";
    homepage = "http://llvm.org/";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ thoughtpolice ];
    platforms = lib.platforms.all;
  };
}