66 lines
1.4 KiB
Nix
66 lines
1.4 KiB
Nix
{
|
|
self,
|
|
pkgs,
|
|
fetchurl,
|
|
libgcc,
|
|
stdenv,
|
|
autoPatchelfHook,
|
|
makeWrapper,
|
|
defaultModel ? self.packages.${stdenv.hostPlatform.system}.concraft-pl-sgjp-model,
|
|
...
|
|
}: let
|
|
python = pkgs.python311; # Możesz zmienić wersję Python
|
|
pythonPackages = python.pkgs;
|
|
|
|
morfeusz2 = pythonPackages.buildPythonPackage rec {
|
|
pname = "morfeusz2";
|
|
version = "1.99.12";
|
|
|
|
src = fetchurl {
|
|
url = "https://files.pythonhosted.org/packages/08/d6/af24fb23423ffb404b601ef75da20a7339b40e2e3992cd0213db9ab0b889/morfeusz2-1.99.12-cp36-abi3-manylinux_2_28_x86_64.whl";
|
|
hash = "sha256-wxFwDiRQ4g5FhMmEHf9450Jh3BeB14BXxgsNjv/o0Ac=";
|
|
};
|
|
|
|
format = "wheel";
|
|
|
|
propagatedBuildInputs = with pythonPackages; [
|
|
setuptools
|
|
wheel
|
|
];
|
|
|
|
nativeBuildInputs = with pythonPackages; [
|
|
libgcc
|
|
stdenv.cc.cc.lib
|
|
autoPatchelfHook
|
|
];
|
|
};
|
|
in
|
|
pythonPackages.buildPythonPackage rec {
|
|
pname = "conmorfeusz";
|
|
version = "0.1.0";
|
|
|
|
src = ./.;
|
|
|
|
pyproject = true;
|
|
|
|
propagatedBuildInputs = with pythonPackages; [
|
|
morfeusz2
|
|
flask
|
|
requests
|
|
click
|
|
gunicorn
|
|
];
|
|
|
|
nativeBuildInputs = with pythonPackages; [
|
|
makeWrapper
|
|
setuptools
|
|
wheel
|
|
];
|
|
|
|
postInstall = ''
|
|
wrapProgram $out/bin/conmorfeusz \
|
|
--set CONCRAFT_PL_MODEL "${defaultModel}" \
|
|
--set CONCRAFT_PL_BIN "${self.packages.${stdenv.hostPlatform.system}.concraft-pl}/bin/concraft-pl"
|
|
'';
|
|
}
|