2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
, pkg-config
|
|
|
|
, cmake
|
|
|
|
, fetchFromGitHub
|
|
|
|
, perl
|
|
|
|
, bison
|
|
|
|
, flex
|
|
|
|
, fetchpatch
|
|
|
|
, static ? stdenv.hostPlatform.isStatic
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-11-15 13:44:38 +00:00
|
|
|
pname = "raptor2";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "unstable-2022-06-06";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dajobe";
|
|
|
|
repo = "raptor";
|
|
|
|
rev = "3cca62a33da68143b687c9e486eefc7c7cbb4586";
|
|
|
|
sha256 = "sha256-h03IyFH1GHPqajfHBBTb19lCEu+VXzQLGC1wiEGVvgY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# Build defaults to static libraries.
|
|
|
|
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
|
|
|
|
];
|
|
|
|
|
2020-11-15 13:44:38 +00:00
|
|
|
patches = [
|
2022-08-12 12:06:08 +00:00
|
|
|
# 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=";
|
2020-11-15 13:44:38 +00:00
|
|
|
})
|
2023-08-04 22:07:22 +00:00
|
|
|
# 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=";
|
|
|
|
})
|
2020-11-15 13:44:38 +00:00
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake perl bison flex ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libxml2 libxslt ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "The RDF Parser Toolkit";
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "https://librdf.org/raptor";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = with lib.licenses; [ lgpl21 asl20 ];
|
|
|
|
maintainers = with lib.maintainers; [ marcweber ];
|
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|