redstore: fix build, modernize

Hydra: https://hydra.nixos.org/build/326899035
ZHF: https://github.com/NixOS/nixpkgs/issues/503391

Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
This commit is contained in:
Ethan Carter Edwards 2026-05-18 03:12:20 -04:00
commit f8b7e6c78c
No known key found for this signature in database
GPG key ID: D83DC5377393C7E6

View file

@ -8,17 +8,28 @@
zlib,
librdf_raptor2,
librdf_rasqal,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "redstore";
version = "0.5.4";
__structuredAttrs = true;
strictDeps = true;
src = fetchurl {
url = "https://www.aelius.com/njh/redstore/redstore-${finalAttrs.version}.tar.gz";
sha256 = "0hc1fjfbfvggl72zqx27v4wy84f5m7bp4dnwd8g41aw8lgynbgaq";
hash = "sha256-WL1l/aOIq0Aeatw2ctepxRHkOdlHdPzFoe9tt5x0gUE=";
};
# source code tries to use `true` as a variable
# despite it being a reserved keyword
postPatch = ''
substituteInPlace ./src/redhttp/server.c --replace-fail \
'true' 'opt'
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [
gmp
@ -35,6 +46,9 @@ stdenv.mkDerivation (finalAttrs: {
)
'';
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
meta = {
description = "HTTP interface to Redland RDF store";
mainProgram = "redstore";