nixpkgs/pkgs/development/compilers/llvm/15/openmp/default.nix
Alyssa Ross f9afd57302 Revert "llvmPackages_15: update licenses"
This reverts commit 386aba3115.

As I understand it from reading
<https://llvm.org/docs/DeveloperPolicy.html#copyright-license-and-patents>,
the structure of LLVM licensing is as follows:

 - They're in the process of relicensing to Apache-2.0 WITH LLVM-exception,
   but they haven't got permission to relicense all the code yet.
   This means that some of the code can be used under the new license,
   but not all of it, and it's difficult to know which is which.  This
   license is therefore probably not useful yet, until the relicensing
   effort is commit.

 - While the relicensing effort is ongoing, code being contributed to
   LLVM has to have permission to be used under the old and new
   licensing schemes.  Since the new licensing scheme can't be used
   for all code yet, it only makes sense to use LLVM's code under the
   old licensing scheme at the moment.

 - The old licensing scheme is that code for the LLVM components we
   care about is all available under the NCSA license, and some
   components are optionally available under a different license,
   usually the MIT license, instead.

So I think we should go back to just listing NCSA, or NCSA/MIT, and
forget about the new license until it actually becomes useful,
i.e. LLVM's relicensing effort is complete.
2023-02-24 00:06:46 +00:00

75 lines
1.7 KiB
Nix

{ lib
, stdenv
, llvm_meta
, monorepoSrc
, runCommand
, cmake
, ninja
, llvm
, targetLlvm
, lit
, clang-unwrapped
, perl
, pkg-config
, xcbuild
, version
}:
stdenv.mkDerivation rec {
pname = "openmp";
inherit version;
src = runCommand "${pname}-src-${version}" {} ''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/${pname} "$out"
'';
sourceRoot = "${src.name}/${pname}";
patches = [
./fix-find-tool.patch
./gnu-install-dirs.patch
./run-lit-directly.patch
];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake ninja perl pkg-config lit ];
buildInputs = [
(if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm)
];
nativeCheckInputs = lib.optional stdenv.hostPlatform.isDarwin xcbuild.xcrun;
# Unsup:Pass:XFail:Fail
# 26:267:16:8
doCheck = false;
checkTarget = "check-openmp";
preCheck = ''
patchShebangs ../tools/archer/tests/deflake.bash
'';
cmakeFlags = [
"-DCLANG_TOOL=${clang-unwrapped}/bin/clang"
"-DOPT_TOOL=${llvm}/bin/opt"
"-DLINK_TOOL=${llvm}/bin/llvm-link"
];
meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
description = "Support for the OpenMP language";
longDescription = ''
The OpenMP subproject of LLVM contains the components required to build an
executable OpenMP program that are outside the compiler itself.
Contains the code for the runtime library against which code compiled by
"clang -fopenmp" must be linked before it can run and the library that
supports offload to target devices.
'';
# "All of the code is dual licensed under the MIT license and the UIUC
# License (a BSD-like license)":
license = with lib.licenses; [ mit ncsa ];
};
}