Merge pull request #291245 from t4ccer/t4/opshin/init

This commit is contained in:
Jon Seager 2024-03-19 14:54:09 +00:00 committed by GitHub
commit 8e90afb61f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 261 additions and 0 deletions

View file

@ -0,0 +1,37 @@
{ lib
, fetchFromGitHub
, python3
}:
python3.pkgs.buildPythonApplication rec {
pname = "opshin";
version = "0.20.0";
format = "pyproject";
src = fetchFromGitHub {
owner = "OpShin";
repo = "opshin";
rev = version;
hash = "sha256-fJlPeVAuEf80FVxdXnaKASLmjMEgz6ysXenUY72+sos=";
};
propagatedBuildInputs = with python3.pkgs; [
setuptools
poetry-core
uplc
pluthon
pycardano
frozenlist2
astunparse
ordered-set
];
meta = with lib; {
description = "A simple pythonic programming language for Smart Contracts on Cardano";
homepage = "https://opshin.dev";
license = licenses.mit;
maintainers = with maintainers; [ t4ccer ];
mainProgram = "opshin";
};
}

View file

@ -0,0 +1,32 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, setuptools
}:
buildPythonPackage rec {
pname = "frozenlist2";
version = "1.0.0";
format = "pyproject";
src = fetchFromGitHub {
owner = "rohanpm";
repo = "frozenlist2";
rev = "v${version}";
hash = "sha256-fF0oFZ2q1wRH7IKBlCjm3Za4xtEMSHyEaGL09rHgtTY=";
};
propagatedBuildInputs = [
setuptools
];
pythonImportsCheck = [ "frozenlist2" ];
meta = with lib; {
description = "An immutable list for Python";
homepage = "https://github.com/rohanpm/frozenlist2";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ t4ccer ];
};
}

View file

@ -0,0 +1,40 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, setuptools
, poetry-core
}:
buildPythonPackage rec {
pname = "graphlib-backport";
version = "1.1.0";
format = "pyproject";
src = fetchFromGitHub {
owner = "mariushelf";
repo = "graphlib_backport";
rev = version;
hash = "sha256-ssJLtBQH8sSnccgcAKLKfYpPyw5U0RIm1F66/Er81lo=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'poetry>=1.0' 'poetry-core' \
--replace 'poetry.masonry.api' 'poetry.core.masonry.api'
'';
propagatedBuildInputs = [
setuptools
poetry-core
];
pythonImportsCheck = [ "graphlib" ];
meta = with lib; {
description = "Backport of the Python 3.9 graphlib module for Python 3.6+";
homepage = "https://github.com/mariushelf/graphlib_backport";
license = licenses.psfl;
maintainers = with maintainers; [ t4ccer ];
};
}

View file

@ -0,0 +1,39 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, setuptools
, pythonOlder
# Python deps
, uplc
, graphlib-backport
, ordered-set
}:
buildPythonPackage rec {
pname = "pluthon";
version = "0.4.6";
format = "pyproject";
src = fetchFromGitHub {
owner = "OpShin";
repo = "pluthon";
rev = version;
hash = "sha256-ZmBkbglSbBfVhA4yP0tJdwpJiFpJ7vX0A321ldQF0lA=";
};
propagatedBuildInputs = [
setuptools
uplc
ordered-set
] ++ lib.optionals (pythonOlder "3.9") graphlib-backport;
pythonImportsCheck = [ "pluthon" ];
meta = with lib; {
description = "Pluto-like programming language for Cardano Smart Contracts in Python";
homepage = "https://github.com/OpShin/pluthon";
license = licenses.mit;
maintainers = with maintainers; [ t4ccer ];
};
}

View file

@ -1,6 +1,7 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub , fetchFromGitHub
, pythonRelaxDepsHook
# Python deps # Python deps
, blockfrost-python , blockfrost-python
, cachetools , cachetools
@ -41,6 +42,10 @@ in buildPythonPackage rec {
hash = "sha256-LP/W8IC2del476fGFq10VMWwMrbAoCCcZOngA8unBM0="; hash = "sha256-LP/W8IC2del476fGFq10VMWwMrbAoCCcZOngA8unBM0=";
}; };
nativeBuildInputs = [
pythonRelaxDepsHook
];
propagatedBuildInputs = [ propagatedBuildInputs = [
blockfrost-python blockfrost-python
cachetools cachetools
@ -58,6 +63,8 @@ in buildPythonPackage rec {
websocket-client websocket-client
]; ];
pythonRelaxDeps = [ "typeguard" ];
pythonImportsCheck = [ "pycardano" ]; pythonImportsCheck = [ "pycardano" ];
meta = with lib; { meta = with lib; {

View file

@ -0,0 +1,41 @@
{ lib
, fetchFromGitHub
, python3
, pkg-config
}:
python3.pkgs.buildPythonPackage {
pname = "python-secp256k1-cardano";
version = "0.2.3";
format = "setuptools";
src = fetchFromGitHub {
owner = "OpShin";
repo = "python-secp256k1";
rev = "5a8f761a4b9a1594653cc4deebadc3398b07533c"; # No tags in repo
hash = "sha256-6bE4/G2gW2F8h5FWtI3TZ6FtijsB/slvFT/SIVv7VIY=";
};
nativeBuildInputs = [ pkg-config ];
propagatedBuildInputs = with python3.pkgs; [ cffi secp256k1 ];
nativeCheckInputs = [ python3.pkgs.pytestCheckHook ];
# Tests expect .so files and are failing
doCheck = false;
preConfigure = ''
cp -r ${python3.pkgs.secp256k1.src} libsecp256k1
export INCLUDE_DIR=${python3.pkgs.secp256k1}/include
export LIB_DIR=${python3.pkgs.secp256k1}/lib
'';
meta = {
homepage = "https://github.com/OpShin/python-secp256k1";
description = "A fork of python-secp256k1, fixing the commit hash of libsecp256k1 to a Cardano compatible version";
license = with lib.licenses; [ mit ];
maintainers = with lib.maintainers; [ t4ccer ];
};
}

View file

@ -0,0 +1,55 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, pythonRelaxDepsHook
# Python deps
, frozenlist2
, python-secp256k1-cardano
, setuptools
, poetry-core
, frozendict
, cbor2
, rply
, pycardano
}:
buildPythonPackage rec {
pname = "uplc";
version = "0.6.9";
format = "pyproject";
src = fetchFromGitHub {
owner = "OpShin";
repo = "uplc";
rev = version;
hash = "sha256-djJMNXijMVzMVzw8NZSe3YFRGyAPqdvr0P374Za5XkU=";
};
nativeBuildInputs = [
pythonRelaxDepsHook
];
propagatedBuildInputs = [
setuptools
poetry-core
frozendict
cbor2
frozenlist2
rply
pycardano
python-secp256k1-cardano
];
pythonRelaxDeps = [ "pycardano" "rply" ];
pythonImportsCheck = [ "uplc" ];
meta = with lib; {
description = "Python implementation of untyped plutus language core";
homepage = "https://opshin.dev";
license = licenses.mit;
maintainers = with maintainers; [ t4ccer ];
mainProgram = "opshin";
};
}

View file

@ -4446,6 +4446,8 @@ self: super: with self; {
frozenlist = callPackage ../development/python-modules/frozenlist { }; frozenlist = callPackage ../development/python-modules/frozenlist { };
frozenlist2 = callPackage ../development/python-modules/frozenlist2 { };
fs = callPackage ../development/python-modules/fs { }; fs = callPackage ../development/python-modules/fs { };
fs-s3fs = callPackage ../development/python-modules/fs-s3fs { }; fs-s3fs = callPackage ../development/python-modules/fs-s3fs { };
@ -4995,6 +4997,8 @@ self: super: with self; {
graphene-django = callPackage ../development/python-modules/graphene-django { }; graphene-django = callPackage ../development/python-modules/graphene-django { };
graphlib-backport = callPackage ../development/python-modules/graphlib-backport { };
graphqlclient= callPackage ../development/python-modules/graphqlclient { }; graphqlclient= callPackage ../development/python-modules/graphqlclient { };
graphql-core = callPackage ../development/python-modules/graphql-core { }; graphql-core = callPackage ../development/python-modules/graphql-core { };
@ -8752,6 +8756,8 @@ self: super: with self; {
python-nvd3 = callPackage ../development/python-modules/python-nvd3 { }; python-nvd3 = callPackage ../development/python-modules/python-nvd3 { };
python-secp256k1-cardano = callPackage ../development/python-modules/python-secp256k1-cardano { };
python-tds = callPackage ../development/python-modules/python-tds { }; python-tds = callPackage ../development/python-modules/python-tds { };
python-yate = callPackage ../development/python-modules/python-yate { }; python-yate = callPackage ../development/python-modules/python-yate { };
@ -9940,6 +9946,8 @@ self: super: with self; {
plumbum = callPackage ../development/python-modules/plumbum { }; plumbum = callPackage ../development/python-modules/plumbum { };
pluthon = callPackage ../development/python-modules/pluthon { };
plux = callPackage ../development/python-modules/plux { }; plux = callPackage ../development/python-modules/plux { };
ply = callPackage ../development/python-modules/ply { }; ply = callPackage ../development/python-modules/ply { };
@ -16128,6 +16136,8 @@ self: super: with self; {
update-dotdee = callPackage ../development/python-modules/update-dotdee { }; update-dotdee = callPackage ../development/python-modules/update-dotdee { };
uplc = callPackage ../development/python-modules/uplc { };
upnpy = callPackage ../development/python-modules/upnpy { }; upnpy = callPackage ../development/python-modules/upnpy { };
uproot = callPackage ../development/python-modules/uproot { }; uproot = callPackage ../development/python-modules/uproot { };