about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/librdf/raptor2.nix
blob: 4503a0cc43ed5da88cd342c7b7e83c2208f73b47 (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
53
54
55
56
57
{ lib
, stdenv
, libxml2
, libxslt
, pkg-config
, cmake
, fetchFromGitHub
, perl
, bison
, flex
, fetchpatch
, static ? stdenv.hostPlatform.isStatic
}:

stdenv.mkDerivation rec {
  pname = "raptor2";
  version = "unstable-2022-06-06";

  src = fetchFromGitHub {
    owner = "dajobe";
    repo = "raptor";
    rev = "3cca62a33da68143b687c9e486eefc7c7cbb4586";
    sha256 = "sha256-h03IyFH1GHPqajfHBBTb19lCEu+VXzQLGC1wiEGVvgY=";
  };

  cmakeFlags = [
    # Build defaults to static libraries.
    "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
  ];

  patches = [
    # https://github.com/dajobe/raptor/pull/52
    (fetchpatch {
      name = "fix-cmake-generated-pc-file";
      url = "https://github.com/dajobe/raptor/commit/fa1ef9a27d8762f5588ac2e92554a188e73dee9f.diff";
      sha256 = "sha256-zXIbrYGgC9oTpiD0WUikT4vRdc9b6bsyfnDkwUSlqao=";
    })
    # pull upstream fix for libxml2-2.11 API compatibility:
    #   https://github.com/dajobe/raptor/pull/58
    (fetchpatch {
      name = "libxml2-2.11.patch";
      url = "https://github.com/dajobe/raptor/commit/4dbc4c1da2a033c497d84a1291c46f416a9cac51.patch";
      hash = "sha256-fHfvncGymzMtxjwtakCNSr/Lem12UPIHAAcAac648w4=";
    })
  ];

  nativeBuildInputs = [ pkg-config cmake perl bison flex ];
  buildInputs = [ libxml2 libxslt ];

  meta = {
    description = "The RDF Parser Toolkit";
    homepage = "https://librdf.org/raptor";
    license = with lib.licenses; [ lgpl21 asl20 ];
    maintainers = with lib.maintainers; [ marcweber ];
    platforms = lib.platforms.unix;
  };
}