mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-24 13:05:08 +00:00

We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
51 lines
1.3 KiB
Nix
51 lines
1.3 KiB
Nix
{ fetchFromGitHub
|
|
, lib, stdenv
|
|
, cmake
|
|
, eigen
|
|
, nlopt
|
|
, ipopt
|
|
, boost
|
|
, tbb
|
|
# tests pass but take 30+ minutes
|
|
, runTests ? false
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "pagmo2";
|
|
version = "2.19.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "esa";
|
|
repo = "pagmo2";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-ido3e0hQLDEPT0AmsfAVTPlGbWe5QBkxgRO6Fg1wp/c=";
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
buildInputs = [ eigen nlopt boost tbb ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) ipopt;
|
|
|
|
cmakeFlags = [
|
|
"-DPAGMO_BUILD_TESTS=${if runTests then "ON" else "OFF"}"
|
|
"-DPAGMO_WITH_EIGEN3=yes"
|
|
"-DPAGMO_WITH_NLOPT=yes"
|
|
"-DNLOPT_LIBRARY=${nlopt}/lib/libnlopt${stdenv.hostPlatform.extensions.sharedLibrary}"
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
"-DPAGMO_WITH_IPOPT=yes"
|
|
"-DCMAKE_CXX_FLAGS='-fuse-ld=gold'"
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
# FIXME: fails ipopt test with Invalid_Option on darwin, so disable.
|
|
"-DPAGMO_WITH_IPOPT=no"
|
|
"-DLLVM_USE_LINKER=gold"
|
|
];
|
|
|
|
doCheck = runTests;
|
|
|
|
meta = with lib; {
|
|
homepage = "https://esa.github.io/pagmo2/";
|
|
description = "Scientific library for massively parallel optimization";
|
|
license = licenses.gpl3Plus;
|
|
platforms = platforms.unix;
|
|
maintainers = [ maintainers.costrouc ];
|
|
};
|
|
}
|