Unverified Commit a2ef3073 authored by Ethan Carter Edwards's avatar Ethan Carter Edwards
Browse files

python3Packages.opaque: init at 1.0.1

parent eca97313
Loading
Loading
Loading
Loading
+53 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildPythonPackage,
  libopaque,
  setuptools,
  pysodium,
  python,
}:

buildPythonPackage rec {
  pname = "opaque";
  pyproject = true;

  inherit (libopaque)
    version
    src
    ;

  sourceRoot = "${src.name}/python";

  postPatch =
    let
      soext = stdenv.hostPlatform.extensions.sharedLibrary;
    in
    ''
      substituteInPlace ./opaque/__init__.py --replace-fail \
        "ctypes.util.find_library('opaque') or ctypes.util.find_library('libopaque')" "'${lib.getLib libopaque}/lib/libopaque${soext}'"
    '';

  build-system = [ setuptools ];

  dependencies = [ pysodium ];

  pythonImportsCheck = [ "opaque" ];

  checkPhase = ''
    runHook preCheck

    ${python.interpreter} test/simple.py

    runHook postCheck
  '';

  meta = {
    inherit (libopaque.meta)
      description
      homepage
      license
      teams
      ;
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -10775,6 +10775,8 @@ self: super: with self; {
  oocsi = callPackage ../development/python-modules/oocsi { };
  opaque = callPackage ../development/python-modules/opaque { };
  opcua-widgets = callPackage ../development/python-modules/opcua-widgets { };
  open-clip-torch = callPackage ../development/python-modules/open-clip-torch { };