diff --git a/pkgs/by-name/fr/freesasa/package.nix b/pkgs/by-name/fr/freesasa/package.nix new file mode 100644 index 0000000000000..a20ace885373f --- /dev/null +++ b/pkgs/by-name/fr/freesasa/package.nix @@ -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; + }; +}) diff --git a/pkgs/development/python-modules/freesasa/default.nix b/pkgs/development/python-modules/freesasa/default.nix new file mode 100644 index 0000000000000..92b2359862f01 --- /dev/null +++ b/pkgs/development/python-modules/freesasa/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4c8c0bd5f40f1..dfeafc38dc4a9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -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 { };