-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opshin: init at 0.20.0 #291245
opshin: init at 0.20.0 #291245
Changes from all commits
3851be8
5e1d995
502ba8d
9f35934
b7f2456
f6d41f4
b401506
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ lib | ||
, fetchFromGitHub | ||
, buildPythonPackage | ||
, setuptools | ||
}: | ||
|
||
buildPythonPackage rec { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using rec is an anti-pattern, ref: https://discourse.nixos.org/t/avoid-rec-expresions-in-nixpkgs/8293/18 / #119942 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I know but #271387 is not merged yet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, thanks |
||
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 ]; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ]; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ]; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ]; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ lib | ||
, fetchFromGitHub | ||
, buildPythonPackage | ||
, pythonRelaxDepsHook | ||
# Python deps | ||
, frozenlist2 | ||
, python-secp256k1-cardano | ||
, setuptools | ||
, poetry-core | ||
, frozendict | ||
, cbor2 | ||
, rply | ||
, pycardano | ||
}: | ||
|
||
buildPythonPackage rec { | ||
jnsgruk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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"; | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking nit: I generally prefer lists like this to be alphabetically ordered to make updating/reasoning about them a bit easier later on 😄