diff --git a/pkgs/by-name/op/openarc/package.nix b/pkgs/by-name/op/openarc/package.nix new file mode 100644 index 000000000000..b099b562de14 --- /dev/null +++ b/pkgs/by-name/op/openarc/package.nix @@ -0,0 +1,83 @@ +{ + lib, + autoreconfHook, + fetchFromGitHub, + makeWrapper, + stdenv, + + jansson, + libidn2, + libmilter, + openssl, + pkg-config, + python3, + python3Packages, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "openarc"; + version = "1.3.0"; + + __structuredAttrs = true; + strictDeps = true; + + src = fetchFromGitHub { + owner = "flowerysong"; + repo = "OpenARC"; + tag = "v${finalAttrs.version}"; + hash = "sha256-eEQ0iiAt/RCxHJPpEiZY1TNgjGJjg+kMsVWI7vNaWlc="; + }; + + nativeBuildInputs = [ + autoreconfHook + pkg-config + makeWrapper + ]; + + buildInputs = [ + jansson + libidn2 + libmilter + openssl + ]; + + enableParallelBuilding = true; + + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DBIND_8_COMPAT"; + + postInstall = '' + wrapProgram $out/bin/openarc-keygen \ + --prefix PATH : ${ + lib.makeBinPath [ + openssl + python3 + ] + } + ''; + + doCheck = true; + + nativeCheckInputs = [ + openssl + python3Packages.miltertest + python3Packages.pytest + ]; + + # The build sandbox breaks these file permission tests + preCheck = '' + substituteInPlace test/test_config.py \ + --replace-fail "def test_config_requiresafekeys" "def disabled_test_config_requiresafekeys" + ''; + + meta = { + homepage = "https://github.com/flowerysong/OpenARC"; + description = "Open source library and filter for adding Authenticated Received Chain (ARC) support (RFC 8617) to email messages"; + sourceProvenance = [ lib.sourceTypes.fromSource ]; + license = with lib.licenses; [ + bsd2 + sendmail + ]; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ lucasbergman ]; + mainProgram = "openarc"; + }; +}) diff --git a/pkgs/development/python-modules/miltertest/default.nix b/pkgs/development/python-modules/miltertest/default.nix new file mode 100644 index 000000000000..029f3eca1f6f --- /dev/null +++ b/pkgs/development/python-modules/miltertest/default.nix @@ -0,0 +1,34 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "miltertest"; + version = "1.0.0"; + pyproject = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "flowerysong"; + repo = "miltertest"; + tag = "v${version}"; + hash = "sha256-8KpuIR+UxRcJbb2pwKDOkSmyXovlyOa4DpeUDn1oK0Y="; + }; + + build-system = [ hatchling ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "miltertest" ]; + + meta = { + description = "Pure python implementation of the milter protocol"; + homepage = "https://github.com/flowerysong/miltertest"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ lucasbergman ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 23b5e9321042..2f59c7af243a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10465,6 +10465,8 @@ self: super: with self; { millheater = callPackage ../development/python-modules/millheater { }; + miltertest = callPackage ../development/python-modules/miltertest { }; + mim-solvers = callPackage ../development/python-modules/mim-solvers { inherit (pkgs) mim-solvers; }; minari = callPackage ../development/python-modules/minari { };