Skip to content

Commit

Permalink
Add wigxjpf package
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoruto committed Nov 18, 2024
1 parent e74d302 commit 3315a55
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ pkgs: rec {
candy-icons = pkgs.callPackage ./candy-icons/package.nix { };
mstm = pkgs.callPackage ./mstm/parallel.nix { };
zen-browser = pkgs.callPackage ./zen-browser/package.nix { };
wigxjpf = pkgs.callPackage ./wigxjpf/package.nix { };
pywigxjpf = pkgs.python3Packages.callPackage ./wigxjpf/pypackage.nix { };

# Work testing
isis = pkgs.callPackage ./isis/package.nix {
inherit inja;
inherit ale;
Expand Down
67 changes: 67 additions & 0 deletions pkgs/wigxjpf/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
lib,
stdenv,
fetchFromGitHub,
ensureNewerSourcesHook,

cmake,
doxygen,
eigen,
gtest,
nlohmann_json,
python311,
python311Packages,
sphinx,
}:
let
pname = "wigxjpf";
version = "1.13";

in
stdenv.mkDerivation {
inherit pname;
inherit version;

src = builtins.fetchTarball {
url = "http://fy.chalmers.se/subatom/${pname}/${pname}-${version}.tar.gz";
sha256 = "0nmcld6iaz4hlgf0dy86jsqw8hchlpys89d132azjsa1gw3ddaav";
};

# nativeBuildInputs = [
# make
# ];

# buildInputs = [
# ];

# configurePhase = ":";

# buildPhase = ''
# mkdir -p $out
# python setup.py install --prefix=$out
# # python setup.py install --prefix=$(pwd)

# cd build
# cmake -DCMAKE_INSTALL_PREFIX=$out -DCMAKE_BUILD_TYPE=Release ..
# cp Makefile $out
# cp cmake_install.cmake $out
# '';

installPhase = ''
mkdir -p $out
cd $out
make -f $src/Makefile VPATH=$src
# cp -r . $out
'';

doCheck = true;
# checkTarget = "test";

meta = with lib; {
homepage = "https://fy.chalmers.se/subatom/wigxjpf/";
description = "WIGXJPF evaluates Wigner 3j, 6j and 9j symbols accurately using prime factorisation and multi-word integer arithmetic.";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ arunoruto ];
};
}
38 changes: 38 additions & 0 deletions pkgs/wigxjpf/pypackage.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
lib,
buildPythonPackage,
fetchPypi,

# dependencies
cffi,
pycparser,
numpy,
}:
let
pname = "pywigxjpf";
version = "1.13.3";
in
buildPythonPackage {
inherit pname version;
format = "setuptools";
src = fetchPypi {
inherit pname version;
extension = "tar.gz";
hash = "sha256-MBIsmrJ3WqigUx0BlWiSYn8cboK6ZcOr9rj8T7dcOu8=";
};

dependencies = [
cffi
pycparser
numpy
];

meta = with lib; {
homepage = "https://fy.chalmers.se/subatom/wigxjpf/";
changelog = "https://fy.chalmers.se/subatom/wigxjpf/CHANGELOG";
description = "WIGXJPF evaluates Wigner 3j, 6j and 9j symbols accurately using prime factorisation and multi-word integer arithmetic.";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ arunoruto ];
};
}

0 comments on commit 3315a55

Please sign in to comment.