diff --git a/pkgs/servers/oxigraph/default.nix b/pkgs/servers/oxigraph/default.nix index c1bf8fa265b5..f77a1c45b465 100644 --- a/pkgs/servers/oxigraph/default.nix +++ b/pkgs/servers/oxigraph/default.nix @@ -2,34 +2,48 @@ , stdenv , rustPlatform , fetchFromGitHub +, installShellFiles , IOKit , Security }: rustPlatform.buildRustPackage rec { pname = "oxigraph"; - version = "0.3.22"; + version = "0.4.7"; src = fetchFromGitHub { owner = pname; repo = pname; rev = "v${version}"; - hash = "sha256-zwUiUDWdrmLF+Qj9Jy6JGXHaBskRnm+pMKW2GKGGeN8="; + hash = "sha256-xkmCfOLlNvQe8VwUS/jFHACxzo8RwIvX3jGGarj1LSg="; fetchSubmodules = true; }; useFetchCargoVendor = true; - cargoHash = "sha256-UnXWBq+oS7tXFCsOhlTkq0L1j8pqzXZ0QKrdYayLunA="; + cargoHash = "sha256-sAAwQnV7p7x0bQb/VIJ9hh+UncYB6aGRorjhD2wgosk="; nativeBuildInputs = [ rustPlatform.bindgenHook + installShellFiles ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ IOKit Security ]; - cargoBuildFlags = [ "--package" "oxigraph_server" ]; + buildAndTestSubdir = "cli"; + buildNoDefaultFeatures = true; + buildFeatures = [ "rustls-webpki" "geosparql" ]; - # requires packaging of the associated python modules - doCheck = false; + # Man pages and autocompletion + postInstall = '' + MAN_DIR="$(find target/*/release -name man)" + installManPage "$MAN_DIR"/*.1 + COMPLETE_DIR="$(find target/*/release -name complete)" + installShellCompletion --bash --name oxigraph.bash "$COMPLETE_DIR/oxigraph.bash" + installShellCompletion --fish --name oxigraph.fish "$COMPLETE_DIR/oxigraph.fish" + installShellCompletion --zsh --name _oxigraph "$COMPLETE_DIR/_oxigraph" + ''; + + cargoCheckNoDefaultFeatures = true; + cargoCheckFeatures = buildFeatures; meta = with lib; { homepage = "https://github.com/oxigraph/oxigraph"; @@ -37,6 +51,6 @@ rustPlatform.buildRustPackage rec { platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; maintainers = with maintainers; [ astro ]; license = with licenses; [ asl20 mit ]; - mainProgram = "oxigraph_server"; + mainProgram = "oxigraph"; }; }