Skip to content

Commit

Permalink
Merge pull request #330184 from natsukium/freesasa/init
Browse files Browse the repository at this point in the history
freesasa: init at 2.1.2; python312Packages.freesasa: init at 2.2.1
  • Loading branch information
natsukium authored Aug 23, 2024
2 parents 3cd1fa6 + 21872e3 commit 4bee6d2
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
60 changes: 60 additions & 0 deletions pkgs/by-name/fr/freesasa/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
autoreconfHook,
libtool,
pkg-config,
libxml2,
json_c,
testers,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "freesasa";
version = "2.1.2";

src = fetchFromGitHub {
owner = "mittinatten";
repo = "freesasa";
rev = "refs/tags/${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-OH1/GGFtMBnHuoOu3pdR+ohVO1m0I/jmCZbxPQ0C0jo=";
};

patches = [
(fetchpatch {
# https://github.com/mittinatten/freesasa/issues/85
name = "fix-linker-error.patch";
url = "https://github.com/mittinatten/freesasa/commit/d5898c13af0f272697726c567a22f1c48af53d62.patch";
includes = [ "src/Makefile.am" ];
hash = "sha256-NA4jMue9ATxP+A0tYIptwz0qCXTmAqoMRBsi5d5uv3E=";
})
];

nativeBuildInputs = [
autoreconfHook
libtool
pkg-config
];

buildInputs = [
json_c
libxml2
];

passthru.tests = {
version = testers.testVersion { package = finalAttrs.finalPackage; };
};

meta = {
description = "C-library for calculating Solvent Accessible Surface Areas";
homepage = "https://github.com/mittinatten/freesasa";
changelog = "https://github.com/mittinatten/freesasa/blob/${finalAttrs.src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
mainProgram = "freesasa";
platforms = lib.platforms.unix;
};
})
47 changes: 47 additions & 0 deletions pkgs/development/python-modules/freesasa/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
cython,
freesasa,
pytestCheckHook,
}:

buildPythonPackage rec {
pname = "freesasa";
version = "2.2.1";
pyproject = true;

src = fetchFromGitHub {
owner = "freesasa";
repo = "freesasa-python";
rev = "refs/tags/v${version}";
hash = "sha256-/7ymItwXOemY0+IL0k6rWnJI8fAwTFjNXzTV+uf9x9A=";
};

postPatch = ''
ln -s ${freesasa.src}/* lib/
'';

build-system = [
cython
setuptools
];

env.USE_CYTHON = true;

pythonImportsCheck = [ "freesasa" ];

nativeCheckInputs = [ pytestCheckHook ];

pytestFlagsArray = [ "test.py" ];

meta = {
description = "FreeSASA Python Module";
homepage = "https://github.com/freesasa/freesasa-python";
changelog = "https://github.com/freesasa/freesasa-python/blob/${src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};
}
4 changes: 4 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4705,6 +4705,10 @@ self: super: with self; {

freertos-gdb = callPackage ../development/python-modules/freertos-gdb { };

freesasa = callPackage ../development/python-modules/freesasa {
inherit (pkgs) freesasa;
};

freetype-py = callPackage ../development/python-modules/freetype-py { };

freezegun = callPackage ../development/python-modules/freezegun { };
Expand Down

0 comments on commit 4bee6d2

Please sign in to comment.