too lazy to write but it works
This commit is contained in:
parent
4b536b9b11
commit
3a7ec9f943
6 changed files with 145 additions and 90 deletions
|
|
@ -1,29 +1,44 @@
|
|||
{
|
||||
pkgs ? import <nixpkgs> {},
|
||||
lib ? pkgs.lib,
|
||||
}: let
|
||||
python-opencv-headless = pkgs.callPackage ./python-opencv-headless {
|
||||
inherit (pkgs) lib fetchurl;
|
||||
python311Packages = pkgs.python311.pkgs;
|
||||
};
|
||||
|
||||
python-pymatting = pkgs.callPackage ./python-pymatting {
|
||||
inherit (pkgs) lib fetchPypi;
|
||||
python311Packages = pkgs.python311.pkgs;
|
||||
};
|
||||
|
||||
python-rembg = pkgs.callPackage ./python-rembg {
|
||||
inherit (pkgs) lib fetchPypi;
|
||||
inherit python-pymatting python-opencv-headless;
|
||||
python311Packages = pkgs.python311.pkgs;
|
||||
};
|
||||
in {
|
||||
}: {
|
||||
fish-rust = pkgs.callPackage ./fish-rust {};
|
||||
python-pymatting = python-pymatting;
|
||||
python-opencv-headless = python-opencv-headless;
|
||||
python-rembg = python-rembg;
|
||||
|
||||
python-pymatting = pkgs.callPackage ./python-pymatting {
|
||||
inherit lib;
|
||||
fetchPypi = pkgs.fetchPypi;
|
||||
python311Packages = pkgs.python311Packages;
|
||||
};
|
||||
python-opencv-headless = pkgs.callPackage ./python-opencv-headless {
|
||||
inherit lib;
|
||||
fetchPypi = pkgs.fetchPypi;
|
||||
cmake = pkgs.cmake;
|
||||
pkg-config = pkgs.pkg-config;
|
||||
stdenv = pkgs.stdenv;
|
||||
makeWrapper = pkgs.makeWrapper;
|
||||
python311Packages = pkgs.python311Packages;
|
||||
};
|
||||
python-rembg = pkgs.callPackage ./python-rembg {
|
||||
inherit lib;
|
||||
fetchPypi = pkgs.fetchPypi;
|
||||
python-pymatting = pkgs.callPackage ./python-pymatting {
|
||||
inherit lib;
|
||||
fetchPypi = pkgs.fetchPypi;
|
||||
python311Packages = pkgs.python311Packages;
|
||||
};
|
||||
python-opencv-headless = pkgs.callPackage ./python-opencv-headless {
|
||||
inherit lib;
|
||||
fetchPypi = pkgs.fetchPypi;
|
||||
cmake = pkgs.cmake;
|
||||
pkg-config = pkgs.pkg-config;
|
||||
stdenv = pkgs.stdenv;
|
||||
makeWrapper = pkgs.makeWrapper;
|
||||
python311Packages = pkgs.python311Packages;
|
||||
};
|
||||
python311Packages = pkgs.python311Packages;
|
||||
};
|
||||
vivid-icons = pkgs.callPackage ./vivid-icons {
|
||||
inherit (pkgs) lib stdenv fetchFromGitHub;
|
||||
inherit lib;
|
||||
stdenv = pkgs.stdenv;
|
||||
fetchFromGitHub = pkgs.fetchFromGitHub;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,52 @@
|
|||
{lib, python311Packages, fetchurl}:
|
||||
{ lib
|
||||
, python311Packages
|
||||
, fetchPypi
|
||||
, stdenv
|
||||
, makeWrapper
|
||||
, cmake
|
||||
, pkg-config
|
||||
}:
|
||||
|
||||
python311Packages.buildPythonPackage rec {
|
||||
pname = "opencv-python-headless";
|
||||
version = "4.9.0.80";
|
||||
format = "wheel";
|
||||
version = "4.11.0.86";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://files.pythonhosted.org/packages/71/19/3c65483a80a1d062d46ae20faf5404712d25cb1dfdcaf371efbd67c38544/opencv_python_headless-4.9.0.80-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl";
|
||||
sha256 = "976656362d68d9f40a5c66f83901430538002465f7db59142784f3893918f3df";
|
||||
src = fetchPypi {
|
||||
pname = "opencv-python-headless";
|
||||
inherit version;
|
||||
format = "setuptools";
|
||||
sha256 = "mW6ygspLQ+xqOXJBTeDiMx9dnNorQQkaSXOcGfuEN5g=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = with python311Packages; [
|
||||
cmake
|
||||
pkg-config
|
||||
makeWrapper
|
||||
scikit-build
|
||||
];
|
||||
|
||||
buildInputs = with python311Packages; [
|
||||
scikit-build
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with python311Packages; [
|
||||
numpy
|
||||
setuptools
|
||||
];
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
|
||||
doCheck = false;
|
||||
|
||||
pythonImportsCheck = [ "cv2" ];
|
||||
|
||||
postFixup = ''
|
||||
wrapPythonProgramsIn "$out/lib/python3.11/site-packages" "${stdenv.cc.cc.lib}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Wrapper package for OpenCV python bindings";
|
||||
description = "Wrapper package for OpenCV python bindings (headless)";
|
||||
homepage = "https://github.com/opencv/opencv-python";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
|
|
|
|||
|
|
@ -1,44 +1,44 @@
|
|||
{ lib,
|
||||
python311Packages,
|
||||
fetchPypi,
|
||||
python-pymatting,
|
||||
python-opencv-headless
|
||||
{ lib
|
||||
, python311Packages
|
||||
, fetchPypi
|
||||
, python-pymatting
|
||||
, python-opencv-headless
|
||||
}:
|
||||
python311Packages.buildPythonPackage rec {
|
||||
pname = "rembg";
|
||||
version = "2.0.50";
|
||||
format = "pyproject";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-bMt/GbplRawFZUqoXq37zAq1dribnu/ZlIYTuUIS+DU=";
|
||||
sha256 = "bMt/GbplRawFZUqoXq37zAq1dribnu/ZlIYTuUIS+DU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = with python311Packages; [
|
||||
poetry-core
|
||||
setuptools
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with python311Packages; [
|
||||
numpy
|
||||
onnxruntime
|
||||
python-opencv-headless
|
||||
pillow
|
||||
pooch
|
||||
python-pymatting
|
||||
scikit-image
|
||||
scipy
|
||||
tqdm
|
||||
aiohttp
|
||||
pytorch-bin
|
||||
] ++ [
|
||||
python-opencv-headless
|
||||
python-pymatting
|
||||
];
|
||||
|
||||
pythonRemoveDeps = [ "opencv-python-headless" ];
|
||||
dontPrecompilePages = true;
|
||||
doInstallCheck = false;
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Tool to remove image backgrounds";
|
||||
homepage = "https://github.com/danielgatis/rembg";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; ["Cobray"];
|
||||
maintainers = with maintainers; [ "Cobray" ];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue