1{ stdenv, lib, fetchurl, graalvm11-ce, glibcLocales }:
2
3stdenv.mkDerivation rec {
4 pname = "zprint";
5 version = "1.1.2";
6
7 src = fetchurl {
8 url =
9 "https://github.com/kkinnear/${pname}/releases/download/${version}/${pname}-filter-${version}";
10 sha256 = "1wh8jyj7alfa6h0cycfwffki83wqb5d5x0p7kvgdkhl7jx7isrwj";
11 };
12
13 dontUnpack = true;
14
15 LC_ALL = "en_US.UTF-8";
16 nativeBuildInputs = [ graalvm11-ce glibcLocales ];
17
18 buildPhase = ''
19 native-image \
20 --no-server \
21 -J-Xmx7G \
22 -J-Xms4G \
23 -jar ${src} \
24 -H:Name=${pname} \
25 -H:EnableURLProtocols=https,http \
26 -H:+ReportExceptionStackTraces \
27 -H:CLibraryPath=${graalvm11-ce.lib}/lib \
28 ${lib.optionalString stdenv.isDarwin ''-H:-CheckToolchain''} \
29 --report-unsupported-elements-at-runtime \
30 --initialize-at-build-time \
31 --no-fallback
32 '';
33
34 installPhase = ''
35 mkdir -p $out/bin
36 install ${pname} $out/bin
37 '';
38
39 meta = with lib; {
40 description = "Clojure/EDN source code formatter and pretty printer";
41 longDescription = ''
42 Library and command line tool providing a variety of pretty printing capabilities
43 for both Clojure code and Clojure/EDN structures. It can meet almost anyone's needs.
44 As such, it supports a number of major source code formatting approaches
45 '';
46 homepage = "https://github.com/kkinnear/zprint";
47 license = licenses.mit;
48 platforms = graalvm11-ce.meta.platforms;
49 maintainers = with maintainers; [ stelcodes ];
50 };
51}