-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Wiktor Kwapisiewicz <[email protected]>
- Loading branch information
1 parent
417b2fa
commit 5679c01
Showing
3 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
# See https://github.com/mhwombat/nix-for-numbskulls/blob/main/flakes.md | ||
# for a brief overview of what each section in a flake should or can contain. | ||
|
||
# TODO: Fix this to something better | ||
description = "a very simple and friendly flake"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { self | ||
, nixpkgs | ||
, flake-utils | ||
}: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
}; | ||
in | ||
{ | ||
devShells = { | ||
default = pkgs.mkShell { | ||
nativeBuildInputs = [ | ||
pkgs.python3 | ||
pkgs.python3.pkgs.virtualenv | ||
pkgs.python3.pkgs.pip | ||
]; | ||
}; | ||
}; | ||
packages = { | ||
# Besides the `src` and `version` arguments, this package.nix could | ||
# be copied as is to Nixpkgs' | ||
# pkgs/development/python-modules/pysequoia/default.nix, and should be | ||
# maintained in parallel to this local version of it. | ||
pysequoia = pkgs.python3.pkgs.callPackage ./package.nix { | ||
src = self; | ||
# Get the version defined in pyproject.toml | ||
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version; | ||
}; | ||
}; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ lib | ||
, buildPythonPackage | ||
, src | ||
, version | ||
, pkg-config | ||
, rustPlatform | ||
, cargo | ||
, rustc | ||
, bzip2 | ||
, nettle | ||
, openssl | ||
, pcsclite | ||
, stdenv | ||
, darwin | ||
, libiconv | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "pysequoia"; | ||
inherit src version; | ||
pyproject = true; | ||
|
||
# This attribute is defined differently in Nixpkgs - using | ||
# `rustPlatform.fetchCargoTarball`. Since we have a Cargo.lock file available | ||
# here, we can use it instead. | ||
cargoDeps = rustPlatform.importCargoLock { | ||
lockFile = ./Cargo.lock; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
pkg-config | ||
rustPlatform.bindgenHook | ||
rustPlatform.cargoSetupHook | ||
rustPlatform.maturinBuildHook | ||
cargo | ||
rustc | ||
]; | ||
|
||
buildInputs = [ | ||
bzip2 | ||
nettle | ||
openssl | ||
pcsclite | ||
] ++ lib.optionals stdenv.isDarwin [ | ||
darwin.apple_sdk.frameworks.CoreFoundation | ||
darwin.apple_sdk.frameworks.Security | ||
libiconv | ||
]; | ||
|
||
pythonImportsCheck = [ "pysequoia" ]; | ||
|
||
meta = with lib; { | ||
description = "This library provides OpenPGP facilities in Python through the Sequoia PGP library"; | ||
downloadPage = "https://codeberg.org/wiktor/pysequoia"; | ||
homepage = "https://sequoia-pgp.gitlab.io/pysequoia"; | ||
license = licenses.asl20; | ||
maintainers = with maintainers; [ doronbehar ]; | ||
}; | ||
} |