1{ stdenv
2, lib
3, fetchurl
4}:
5let
6 pname = "roapi-http";
7 version = "0.6.0";
8 target = lib.optionalString stdenv.isDarwin "apple-darwin";
9in
10# TODO build from source, currently compilation fails on darwin on snmalloc with
11# ./mem/../ds/../pal/pal_apple.h:277:64: error: use of undeclared identifier 'kCCSuccess'
12# reinterpret_cast<void*>(&result), sizeof(result)) != kCCSuccess)
13#
14# rustPlatform.buildRustPackage {
15# pname = "roapi-http";
16# inherit version;
17
18# src = fetchFromGitHub {
19# owner = "roapi";
20# repo = "roapi";
21# rev = "roapi-http-v${version}";
22# sha256 = "sha256-qHAO3h+TTCQQ7vdd4CoXVGfKZ1fIxTWKqbUNnRsJaok=";
23# };
24
25# cargoHash = "sha256-qDJKC6MXeKerPFwJsNND3WkziFtGkTvCgVEsdPbBGAo=";
26
27# buildAndTestSubdir = "roapi-http";
28
29# nativeBuildInputs = [ cmake ];
30
31stdenv.mkDerivation rec {
32 inherit pname version;
33
34 src = fetchurl {
35 url = "https://github.com/roapi/roapi/releases/download/${pname}-v${version}/${pname}-${target}.tar.gz";
36 sha256 = "sha256-lv6BHg/LkrOlyq8D1udAYW8/AbZRb344YCcVnwo3ZHk=";
37 };
38 dontUnpack = true;
39 dontConfigure = true;
40 dontBuild = true;
41
42 installPhase = ''
43 tar xvzf $src
44 mkdir -p "$out/bin"
45 cp roapi-http $out/bin
46 '';
47
48 meta = with lib; {
49 description = "Create full-fledged APIs for static datasets without writing a single line of code.";
50 homepage = "https://roapi.github.io/docs/";
51 license = licenses.asl20;
52 maintainers = with maintainers; [ happysalada ];
53 platforms = platforms.darwin;
54 };
55}