about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/text/paperoni/default.nix
blob: 203e5b21689f9d96354c99623dd1e63ee2d44ab3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ lib
, rustPlatform
, fetchFromGitHub
, curl
, stdenv
, pkg-config
, zlib
, openssl
}:

rustPlatform.buildRustPackage rec {
  pname = "paperoni";
  version = "0.6.1-alpha1";

  src = fetchFromGitHub {
    owner = "hipstermojo";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-vTylnDtoPpiRtk/vew1hLq3g8pepWRVqBEBnvSif4Zw=";
  };

  cargoLock = {
    lockFile = ./Cargo.lock;
  };

  nativeBuildInputs = [
    curl
  ] ++ lib.optionals stdenv.isLinux [
    pkg-config
  ];

  buildInputs = [
    curl
    zlib
  ] ++ lib.optionals stdenv.isLinux [
    openssl
  ];

  # update Cargo.lock to work with openssl 3
  postPatch = ''
    ln -sf ${./Cargo.lock} Cargo.lock
  '';

  meta = with lib; {
    description = "An article extractor in Rust";
    mainProgram = "paperoni";
    homepage = "https://github.com/hipstermojo/paperoni";
    changelog = "https://github.com/hipstermojo/paperoni/releases/tag/${src.rev}";
    license = licenses.mit;
    maintainers = with maintainers; [ marsam ];
  };
}