about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/librdf
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/librdf')
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/raptor.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/raptor2.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/rasqal.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/redland.nix48
4 files changed, 154 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/librdf/raptor.nix b/nixpkgs/pkgs/development/libraries/librdf/raptor.nix
new file mode 100644
index 000000000000..1dde9402f902
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librdf/raptor.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, libxml2, curl }:
+
+stdenv.mkDerivation rec {
+  pname = "raptor";
+  version = "1.4.21";
+
+  src = fetchurl {
+    url = "http://download.librdf.org/source/raptor-${version}.tar.gz";
+    sha256 = "db3172d6f3c432623ed87d7d609161973d2f7098e3d2233d0702fbcc22cfd8ca";
+  };
+
+  buildInputs = [ libxml2 curl ];
+
+  preBuild = ''
+    sed -e '/curl\/types/d' -i src/*.c src/*.h
+  '';
+
+  meta = {
+    description = "The RDF Parser Toolkit";
+    homepage = "https://librdf.org/raptor";
+    license = with lib.licenses; [ lgpl21 asl20 ];
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librdf/raptor2.nix b/nixpkgs/pkgs/development/libraries/librdf/raptor2.nix
new file mode 100644
index 000000000000..b085e080803b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librdf/raptor2.nix
@@ -0,0 +1,50 @@
+{ 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=";
+    })
+  ];
+
+  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;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librdf/rasqal.nix b/nixpkgs/pkgs/development/libraries/librdf/rasqal.nix
new file mode 100644
index 000000000000..8d935bb08530
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librdf/rasqal.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, librdf_raptor2, gmp, pkg-config, pcre, libxml2, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "rasqal";
+  version = "0.9.33";
+
+  src = fetchurl {
+    url = "http://download.librdf.org/source/rasqal-${version}.tar.gz";
+    sha256 = "0z6rrwn4jsagvarg8d5zf0j352kjgi33py39jqd29gbhcnncj939";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ gmp pcre libxml2 ];
+
+  propagatedBuildInputs = [ librdf_raptor2 ];
+
+  postInstall = "rm -rvf $out/share/gtk-doc";
+
+  nativeCheckInputs = [ perl ];
+  doCheck = false; # fails with "No testsuite plan file sparql-query-plan.ttl could be created in build/..."
+  doInstallCheck = false; # fails with "rasqal-config does not support (--help|--version)"
+
+  meta = {
+    description = "Library that handles Resource Description Framework (RDF)";
+    homepage = "https://librdf.org/rasqal";
+    license = with lib.licenses; [ lgpl21 asl20 ];
+    maintainers = with lib.maintainers; [ marcweber ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librdf/redland.nix b/nixpkgs/pkgs/development/libraries/librdf/redland.nix
new file mode 100644
index 000000000000..252a5037f77c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librdf/redland.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl, pkg-config, openssl, libxslt, perl
+, curl, pcre, libxml2, librdf_rasqal, gmp
+, libmysqlclient, withMysql ? false
+, postgresql, withPostgresql ? false
+, sqlite, withSqlite ? true
+, db, withBdb ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "redland";
+  version = "1.0.17";
+
+  src = fetchurl {
+    url = "http://download.librdf.org/source/redland-${version}.tar.gz";
+    sha256 = "de1847f7b59021c16bdc72abb4d8e2d9187cd6124d69156f3326dd34ee043681";
+  };
+
+  nativeBuildInputs = [ perl pkg-config ];
+
+  buildInputs = [ openssl libxslt curl pcre libxml2 gmp ]
+    ++ lib.optional withMysql libmysqlclient
+    ++ lib.optional withSqlite sqlite
+    ++ lib.optional withPostgresql postgresql
+    ++ lib.optional withBdb db;
+
+  propagatedBuildInputs = [ librdf_rasqal ];
+
+  postInstall = "rm -rvf $out/share/gtk-doc";
+
+  configureFlags =
+    [ "--with-threads" ]
+    ++ lib.optionals withBdb [
+      "--with-bdb-include=${db.dev}/include"
+      "--with-bdb-lib=${db.out}/lib"
+    ];
+
+  # Fix broken DT_NEEDED in lib/redland/librdf_storage_sqlite.so.
+  NIX_CFLAGS_LINK = "-lraptor2";
+
+  doCheck = false; # fails 1 out of 17 tests with a segmentation fault
+
+  meta = with lib; {
+    description = "C libraries that provide support for the Resource Description Framework (RDF)";
+    homepage = "https://librdf.org/";
+    platforms = platforms.unix;
+    license = licenses.asl20;
+  };
+}