-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #291245 from t4ccer/t4/opshin/init
- Loading branch information
Showing
8 changed files
with
261 additions
and
0 deletions.
There are no files selected for viewing
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,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"; | ||
}; | ||
} |
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,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 ]; | ||
}; | ||
} |
40 changes: 40 additions & 0 deletions
40
pkgs/development/python-modules/graphlib-backport/default.nix
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,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 ]; | ||
}; | ||
} |
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,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 ]; | ||
}; | ||
} |
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
41 changes: 41 additions & 0 deletions
41
pkgs/development/python-modules/python-secp256k1-cardano/default.nix
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,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 ]; | ||
}; | ||
} |
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,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"; | ||
}; | ||
} |
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