Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions pkgs/by-name/p4/p4est-sc/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
mpi,
zlib,
jansson,
mpiCheckPhaseHook,
debug ? false,
mpiSupport ? true,

# passthru.tests
testers,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "p4est-sc";
version = "2.8.7";

src = fetchFromGitHub {
owner = "cburstedde";
repo = "libsc";
tag = "v${finalAttrs.version}";
hash = "sha256-oeEYNaYx1IdEWefctgUZVUa6wnb8K3z5Il2Y9MtQwBc=";
};

strictDeps = true;

postPatch = ''
echo $version > .tarball-version
'';

nativeBuildInputs = [
autoreconfHook
pkg-config
] ++ lib.optional mpiSupport mpi;

propagatedBuildInputs = [
zlib
jansson
];

configureFlags =
[
"LDFLAGS=-lm"
]
++ lib.optionals mpiSupport [
"--enable-mpi"
"CC=mpicc"
]
++ lib.optional debug "--enable-debug";

__darwinAllowLocalNetworking = mpiSupport;

nativeCheckInputs = lib.optionals mpiSupport [
mpiCheckPhaseHook
];

doCheck = true;

passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;

meta = {
description = "Support for parallel scientific applications";
longDescription = ''
The SC library provides support for parallel scientific applications.
Its main purpose is to support the p4est software library, hence
this package is called p4est-sc, but it works standalone, too.
'';
homepage = "https://www.p4est.org/";
downloadPage = "https://github.com/cburstedde/libsc.git";
pkgConfigModules = [ "libsc" ];
license = lib.licenses.lgpl21Plus;
maintainers = with lib.maintainers; [ qbisi ];
};
})
88 changes: 88 additions & 0 deletions pkgs/by-name/p4/p4est/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
metis,
p4est-sc,
mpi,
mpiCheckPhaseHook,
debug ? false,
withMetis ? true,
mpiSupport ? true,

# passthru.tests
testers,
}:
let
p4est-sc' = p4est-sc.override { inherit mpi mpiSupport debug; };
in
stdenv.mkDerivation (finalAttrs: {
pname = "p4est";
version = "2.8.7";

src = fetchFromGitHub {
owner = "cburstedde";
repo = "p4est";
tag = "v${finalAttrs.version}";
hash = "sha256-8JvKaYOP4IO1Xmim74KNHvMLOV3y9VRoT76RBCaRyhI=";
};

strictDeps = true;

postPatch = ''
echo $version > .tarball-version

substituteInPlace Makefile.am \
--replace-fail "@P4EST_SC_AMFLAGS@" "-I ${p4est-sc}/share/aclocal"
'';

nativeBuildInputs = [
autoreconfHook
pkg-config
] ++ lib.optional mpiSupport mpi;

buildInputs = [
metis
];

propagatedBuildInputs = [ p4est-sc' ];

configureFlags =
[
"--with-sc=${p4est-sc'}"
"--with-metis"
"--enable-p6est"
"LDFLAGS=-lm"
]
++ lib.optionals mpiSupport [
"--enable-mpi"
"CC=mpicc"
]
++ lib.optional debug "--enable-debug";

doCheck = true;

__darwinAllowLocalNetworking = mpiSupport;

nativeCheckInputs = lib.optionals mpiSupport [
mpiCheckPhaseHook
];

passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;

meta = {
description = "Parallel AMR on Forests of Octrees";
longDescription = ''
The p4est software library provides algorithms for parallel AMR.
AMR refers to Adaptive Mesh Refinement, a technique in scientific
computing to cover the domain of a simulation with an adaptive mesh.
'';
homepage = "https://www.p4est.org/";
downloadPage = "https://github.com/cburstedde/p4est.git";
pkgConfigModules = [ "p4est" ];
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ qbisi ];
};
})
78 changes: 0 additions & 78 deletions pkgs/development/libraries/science/math/p4est-sc/default.nix

This file was deleted.

77 changes: 0 additions & 77 deletions pkgs/development/libraries/science/math/p4est/default.nix

This file was deleted.

26 changes: 0 additions & 26 deletions pkgs/development/libraries/science/math/p4est/p4est-metis.patch

This file was deleted.

12 changes: 2 additions & 10 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15397,17 +15397,9 @@ with pkgs;
nodejs = nodejs_20;
};

p4est-sc = callPackage ../development/libraries/science/math/p4est-sc {
p4est-sc-debugEnable = false;
};

p4est-sc-dbg = callPackage ../development/libraries/science/math/p4est-sc { };
p4est-sc-dbg = p4est-sc.override { debug = true; };

p4est = callPackage ../development/libraries/science/math/p4est { };

p4est-dbg = callPackage ../development/libraries/science/math/p4est {
p4est-sc = p4est-sc-dbg;
};
p4est-dbg = p4est.override { debug = true; };

sageWithDoc = sage.override { withDoc = true; };

Expand Down
Loading