Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Nix package #61

Open
nonetrix opened this issue Jan 25, 2024 · 3 comments
Open

Create a Nix package #61

nonetrix opened this issue Jan 25, 2024 · 3 comments

Comments

@nonetrix
Copy link

It would be nice if a nix package was created so it's easier to install on NixOS systems

@nonetrix
Copy link
Author

I might look into doing this, but not really sure how to exactly but seems simple

@stigertropes
Copy link

stigertropes commented Feb 10, 2024

i don't use nur and don't want to go through trying to maintain one pkgs in upstream nixos, but i made a nix package for this for my own use some time ago

if you use flakes it should be pretty easy to add it in your pkgs

also i use wayland and not xorg, so if you use xorg you can probably just add next to/replace wl-clipboard with xclip

default.nix
{
  lib,
  buildPythonPackage,
  fetchPypi,
  fire,
  jaconv,
  loguru,
  numpy,
  pillow,
  torch,
  transformers,
  unidic-lite,
  pyperclip,
  fugashi,
  wl-clipboard,
}:
buildPythonPackage rec {
  pname = "manga-ocr";
  version = "0.1.11";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-Ic6AaSaEY1NaPHgF9xawj1gmrwWqf1NhmTs8NYKZsOs=";
  };

  buildInputs = [wl-clipboard];
  propagatedBuildInputs = [fire jaconv loguru numpy pillow pyperclip torch transformers unidic-lite fugashi];

  postInstall = ''
    mv -v assets $out/lib/python3.11/site-packages/manga_ocr/
  '';
  makeWrapperArgs = [
    "--prefix PATH : ${lib.makeBinPath [wl-clipboard]}"
  ];

  meta = with lib; {
    homepage = "https://github.com/kha-white/manga-ocr";
    description = "Manga OCR";
    license = licenses.asl20;
    platforms = platforms.all;
  };
}

@nonetrix
Copy link
Author

nonetrix commented Feb 11, 2024

I use Wayland too so hopefully it works for me as well, I don't really know exactly how to make use of it, but I will try it. I assume you just import it like anything? I really need to read up on it more, doesn't look hard, I wouldn't mind possibly maintaining it if I can understand it eventually as I will like use it a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants