2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, buildNpmPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, jq
|
|
|
|
, stdenv
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
let
|
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
# pyCA is incompatible with SQLAlchemy 2.0
|
2024-01-13 08:15:51 +00:00
|
|
|
sqlalchemy = super.sqlalchemy_1_4;
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
frontend = buildNpmPackage rec {
|
|
|
|
pname = "pyca";
|
|
|
|
version = "4.5";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "opencast";
|
|
|
|
repo = "pyCA";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-cTkWkOmgxJZlddqaSYKva2wih4Mvsdrd7LD4NggxKQk=";
|
|
|
|
};
|
|
|
|
|
|
|
|
npmDepsHash = "sha256-0U+semrNWTkNu3uQQkiJKZT1hB0/IfkL84G7/oP8XYY=";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ jq python ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
${jq}/bin/jq '. += {"version": "${version}"}' < package.json > package.json.tmp
|
|
|
|
mv package.json.tmp package.json
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/static
|
|
|
|
cp -R pyca/ui/static/* $out/static/
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pyca";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "4.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "opencast";
|
|
|
|
repo = "pyCA";
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-cTkWkOmgxJZlddqaSYKva2wih4Mvsdrd7LD4NggxKQk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2020-04-24 23:36:52 +00:00
|
|
|
pycurl
|
2021-07-04 02:40:35 +00:00
|
|
|
python-dateutil
|
2020-04-24 23:36:52 +00:00
|
|
|
configobj
|
|
|
|
sqlalchemy
|
|
|
|
sdnotify
|
2023-05-24 13:37:59 +00:00
|
|
|
psutil
|
2020-04-24 23:36:52 +00:00
|
|
|
flask
|
2023-05-24 13:37:59 +00:00
|
|
|
prometheus-client
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's#static_folder=.*#static_folder="${frontend}/static")#' pyca/ui/__init__.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit frontend;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A fully functional Opencast capture agent written in Python";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pyca";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/opencast/pyCA";
|
|
|
|
license = licenses.lgpl3;
|
|
|
|
maintainers = with maintainers; [ pmiddend ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|