2023-05-25 16:51:30 +02:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, buildNpmPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, jq
|
|
|
|
, stdenv
|
|
|
|
}:
|
2018-11-20 10:34:01 +01:00
|
|
|
|
2023-05-09 08:31:48 +02:00
|
|
|
let
|
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
# pyCA is incompatible with SQLAlchemy 2.0
|
2024-01-03 03:04:24 +01:00
|
|
|
sqlalchemy = super.sqlalchemy_1_4;
|
2023-05-09 08:31:48 +02: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 {
|
2018-11-20 10:34:01 +01:00
|
|
|
pname = "pyca";
|
2023-05-09 08:31:48 +02:00
|
|
|
version = "4.5";
|
2018-11-20 10:34:01 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "opencast";
|
|
|
|
repo = "pyCA";
|
|
|
|
rev = "v${version}";
|
2023-05-09 08:31:48 +02:00
|
|
|
sha256 = "sha256-cTkWkOmgxJZlddqaSYKva2wih4Mvsdrd7LD4NggxKQk=";
|
2018-11-20 10:34:01 +01:00
|
|
|
};
|
|
|
|
|
2023-05-09 08:31:48 +02:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2018-11-20 10:34:01 +01:00
|
|
|
pycurl
|
2021-07-03 13:37:24 +02:00
|
|
|
python-dateutil
|
2018-11-20 10:34:01 +01:00
|
|
|
configobj
|
|
|
|
sqlalchemy
|
|
|
|
sdnotify
|
2023-05-09 08:31:48 +02:00
|
|
|
psutil
|
2018-11-20 10:34:01 +01:00
|
|
|
flask
|
2023-05-09 08:31:48 +02:00
|
|
|
prometheus-client
|
2018-11-20 10:34:01 +01:00
|
|
|
];
|
|
|
|
|
2023-05-09 08:31:48 +02:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's#static_folder=.*#static_folder="${frontend}/static")#' pyca/ui/__init__.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit frontend;
|
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2022-05-28 15:28:44 +02:00
|
|
|
broken = stdenv.isDarwin;
|
2018-11-20 10:34:01 +01:00
|
|
|
description = "A fully functional Opencast capture agent written in Python";
|
2024-03-19 03:14:51 +01:00
|
|
|
mainProgram = "pyca";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/opencast/pyCA";
|
2018-11-20 10:34:01 +01:00
|
|
|
license = licenses.lgpl3;
|
|
|
|
maintainers = with maintainers; [ pmiddend ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|