From a677b148fb7e64982b5a34faa5c0110b4bdd0eec Mon Sep 17 00:00:00 2001 From: Vladimir Pouzanov Date: Sat, 22 Jun 2024 19:17:34 +0000 Subject: [PATCH] cq: init at 2024.06.24-12.10 --- pkgs/by-name/cq/cq/package.nix | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 pkgs/by-name/cq/cq/package.nix diff --git a/pkgs/by-name/cq/cq/package.nix b/pkgs/by-name/cq/cq/package.nix new file mode 100644 index 000000000000..82fc31a7bbdd --- /dev/null +++ b/pkgs/by-name/cq/cq/package.nix @@ -0,0 +1,46 @@ +{ lib +, fetchFromGitHub +, fetchurl +, buildGraalvmNativeImage +, graalvmCEPackages +}: + +buildGraalvmNativeImage rec { + pname = "cq"; + version = "2024.06.24-12.10"; + + # we need both src (the prebuild jar) + src = fetchurl { + url = "https://github.com/markus-wa/cq/releases/download/${version}/cq.jar"; + hash = "sha256-iULV+j/AuGVYPYhbOTQTKd3n+VZhWQYBRE6cRiaa1/M="; + }; + + # and build-src (for the native-image build process) + build-src = fetchFromGitHub { + owner = "markus-wa"; + repo = "cq"; + rev = version; + hash = "sha256-yjAC2obipdmh+JlHzVUTMtTXN2VKe4WKkyJyu2Q93c8="; + }; + + graalvmDrv = graalvmCEPackages.graalvm-ce; + + executable = "cq"; + + # copied verbatim from the upstream build script https://github.com/markus-wa/cq/blob/main/package/build-native.sh#L5 + extraNativeImageBuildArgs = [ + "--report-unsupported-elements-at-runtime" + "--initialize-at-build-time" + "--no-server" + "-H:ReflectionConfigurationFiles=${build-src}/package/reflection-config.json" + ]; + + meta = with lib; { + description = "Clojure Query: A Command-line Data Processor for JSON, YAML, EDN, XML and more"; + homepage = "https://github.com/markus-wa/cq"; + changelog = "https://github.com/markus-wa/cq/releases/releases/tag/${version}"; + license = licenses.epl20; + maintainers = with maintainers; [ farcaller ]; + platforms = platforms.unix; + }; +}