commit
bd2615ed6a
@ -1,42 +1,60 @@ |
|||||||
{ rustPlatform, lib, fetchFromGitHub |
{ rustPlatform, lib, fetchFromGitHub |
||||||
, zlib, elfutils, openssl |
, zlib, openssl |
||||||
, cmake, python3, pkg-config, protobuf, perl, llvmPackages |
, pkg-config, protobuf, llvmPackages |
||||||
}: |
}: |
||||||
rustPlatform.buildRustPackage rec { |
rustPlatform.buildRustPackage rec { |
||||||
#https://github.com/near/nearcore |
|
||||||
pname = "nearcore"; |
pname = "nearcore"; |
||||||
version = "1.25.0"; |
version = "1.26.0"; |
||||||
|
|
||||||
|
# https://github.com/near/nearcore/tags |
||||||
src = fetchFromGitHub { |
src = fetchFromGitHub { |
||||||
owner = "near"; |
owner = "near"; |
||||||
repo = "nearcore"; |
repo = "nearcore"; |
||||||
# there is also a branch for this version number, so we need to be explicit |
# there is also a branch for this version number, so we need to be explicit |
||||||
rev = "refs/tags/${version}"; |
rev = "refs/tags/${version}"; |
||||||
sha256 = "sha256-7hiBqJLGIf+kNKJvMQ7KtGZm/SWLY3pT7YDlwbm3HDM="; |
sha256 = "sha256-N3A+hy5I1/yJ3IN9gDw3m1IZ9qK8LNhn3fuXLMn23bg="; |
||||||
}; |
}; |
||||||
|
|
||||||
cargoSha256 = "sha256-EGv4CibSHL9oTAdWK7d/SOzZWPcEB16hTWlWHjKU4wc="; |
cargoSha256 = "sha256-g07liit048TSL73wFyDK+eKu33Z6fPJcJ+VeGgTtuS8="; |
||||||
|
|
||||||
|
postPatch = '' |
||||||
|
substituteInPlace neard/build.rs \ |
||||||
|
--replace 'get_git_version()?' '"nix:${version}"' |
||||||
|
''; |
||||||
|
|
||||||
|
CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1"; |
||||||
|
CARGO_PROFILE_RELEASE_LTO = "fat"; |
||||||
|
NEAR_RELEASE_BUILD = "release"; |
||||||
|
|
||||||
|
OPENSSL_NO_VENDOR = 1; # we want to link to OpenSSL provided by Nix |
||||||
|
|
||||||
# don't build SDK samples that require wasm-enabled rust |
# don't build SDK samples that require wasm-enabled rust |
||||||
cargoBuildFlags = [ "-p" "neard" ]; |
buildAndTestSubdir = "neard"; |
||||||
doCheck = false; # needs network |
doCheck = false; # needs network |
||||||
|
|
||||||
buildInputs = [ zlib elfutils openssl ]; |
buildInputs = [ |
||||||
|
zlib |
||||||
|
openssl |
||||||
|
]; |
||||||
|
|
||||||
nativeBuildInputs = [ |
nativeBuildInputs = [ |
||||||
cmake |
|
||||||
python3 |
|
||||||
pkg-config |
pkg-config |
||||||
protobuf |
protobuf |
||||||
perl |
|
||||||
]; |
]; |
||||||
|
|
||||||
|
# fat LTO requires ~3.4GB RAM |
||||||
|
requiredSystemFeatures = [ "big-parallel" ]; |
||||||
|
|
||||||
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; |
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; |
||||||
BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion llvmPackages.clang}/include"; |
BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion llvmPackages.clang}/include"; |
||||||
|
|
||||||
meta = with lib; { |
meta = with lib; { |
||||||
description = "Reference client for NEAR Protocol"; |
description = "Reference client for NEAR Protocol"; |
||||||
homepage = "https://github.com/near/nearcore"; |
homepage = "https://github.com/near/nearcore"; |
||||||
license = licenses.mit; |
license = licenses.gpl3; |
||||||
maintainers = with maintainers; [ mic92 ]; |
maintainers = with maintainers; [ mic92 mikroskeem ]; |
||||||
platforms = platforms.unix; |
# only x86_64 is supported in nearcore because of sse4+ support, macOS might |
||||||
|
# be also possible |
||||||
|
platforms = [ "x86_64-linux" ]; |
||||||
}; |
}; |
||||||
} |
} |
||||||
|
@ -0,0 +1,36 @@ |
|||||||
|
{ lib, writeTextFile, runtimeShell, drawio, xvfb-run }: |
||||||
|
|
||||||
|
writeTextFile { |
||||||
|
name = "${drawio.pname}-headless-${drawio.version}"; |
||||||
|
|
||||||
|
executable = true; |
||||||
|
destination = "/bin/drawio"; |
||||||
|
text = '' |
||||||
|
#!${runtimeShell} |
||||||
|
|
||||||
|
# Electron really wants a configuration directory to not die with: |
||||||
|
# "Error: Failed to get 'appData' path" |
||||||
|
# so we give it some temp dir as XDG_CONFIG_HOME |
||||||
|
tmpdir=$(mktemp -d) |
||||||
|
|
||||||
|
function cleanup { |
||||||
|
rm -rf "$tmpdir" |
||||||
|
} |
||||||
|
trap cleanup EXIT |
||||||
|
|
||||||
|
# Drawio needs to run in a virtual X session, because Electron |
||||||
|
# refuses to work and dies with an unhelpful error message otherwise: |
||||||
|
# "The futex facility returned an unexpected error code." |
||||||
|
XDG_CONFIG_HOME="$tmpdir" ${xvfb-run}/bin/xvfb-run ${drawio}/bin/drawio $@ |
||||||
|
''; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
description = "xvfb wrapper around drawio"; |
||||||
|
longDescription = '' |
||||||
|
A wrapper around drawio for running in headless environments. |
||||||
|
Runs drawio under xvfb-run, with configuration going to a temporary |
||||||
|
directory. |
||||||
|
''; |
||||||
|
maintainers = with maintainers; [ qyliss tfc ]; |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
{ lib |
||||||
|
, fetchFromGitHub |
||||||
|
, rustPlatform |
||||||
|
, notmuch |
||||||
|
, stdenv |
||||||
|
, Security |
||||||
|
}: |
||||||
|
|
||||||
|
rustPlatform.buildRustPackage rec { |
||||||
|
pname = "mujmap"; |
||||||
|
version = "0.1.1"; |
||||||
|
|
||||||
|
src = fetchFromGitHub { |
||||||
|
owner = "elizagamedev"; |
||||||
|
repo = pname; |
||||||
|
rev = "v${version}"; |
||||||
|
sha256 = "sha256-O5CbLgs+MkATPtess0gocgPB9kwD8FMR/urwm6jo2rA="; |
||||||
|
}; |
||||||
|
|
||||||
|
cargoSha256 = "sha256-nOZ+HnzXhVp+tLrNMZO1NmZIhIqlWz0fRMbHVIQkOxI="; |
||||||
|
|
||||||
|
buildInputs = [ |
||||||
|
notmuch |
||||||
|
] ++ lib.optional stdenv.isDarwin Security; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
description = "Bridge for synchronizing email and tags between JMAP and notmuch"; |
||||||
|
homepage = "https://github.com/elizagamedev/mujmap/"; |
||||||
|
license = licenses.gpl3Plus; |
||||||
|
maintainers = with maintainers; [ elizagamedev ]; |
||||||
|
mainProgram = "mujmap"; |
||||||
|
}; |
||||||
|
} |
@ -1,28 +0,0 @@ |
|||||||
{ lib, stdenv, fetchFromGitHub, curl, cmake, nlohmann_json }: |
|
||||||
|
|
||||||
stdenv.mkDerivation { |
|
||||||
pname = "cpp-ipfs-api"; |
|
||||||
version = "2017-01-04"; |
|
||||||
|
|
||||||
src = fetchFromGitHub { |
|
||||||
owner = "vasild"; |
|
||||||
repo = "cpp-ipfs-api"; |
|
||||||
rev = "96a890f4518665a56581a2a52311eaa65928eac8"; |
|
||||||
sha256 = "1z6gbd7npg4pd9wmdyzcp9h12sg84d7a43c69pp4lzqkyqg8pz1g"; |
|
||||||
}; |
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ]; |
|
||||||
buildInputs = [ curl ]; |
|
||||||
propagatedBuildInputs = [ nlohmann_json ]; |
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = [ |
|
||||||
"-Wno-error=range-loop-construct" |
|
||||||
]; |
|
||||||
|
|
||||||
meta = with lib; { |
|
||||||
description = "IPFS C++ API client library"; |
|
||||||
homepage = "https://github.com/vasild/cpp-ipfs-api"; |
|
||||||
license = licenses.mit; |
|
||||||
platforms = platforms.all; |
|
||||||
}; |
|
||||||
} |
|
@ -0,0 +1,35 @@ |
|||||||
|
{ lib, stdenv, fetchFromGitHub, curl, cmake, nlohmann_json }: |
||||||
|
|
||||||
|
stdenv.mkDerivation { |
||||||
|
pname = "cpp-ipfs-http-client"; |
||||||
|
version = "unstable-2022-01-30"; |
||||||
|
|
||||||
|
src = fetchFromGitHub { |
||||||
|
owner = "vasild"; |
||||||
|
repo = "cpp-ipfs-http-client"; |
||||||
|
rev = "3cdfa7fc6326e49fc81b3c7ca43ce83bdccef6d9"; |
||||||
|
sha256 = "sha256-/oyafnk4SbrvoCh90wkZXNBjknMKA6EEUoEGo/amLUo="; |
||||||
|
}; |
||||||
|
|
||||||
|
patches = [ ./unvendor-nlohmann-json.patch ]; |
||||||
|
|
||||||
|
postPatch = '' |
||||||
|
substituteInPlace CMakeLists.txt \ |
||||||
|
--replace '# Fetch "JSON for Modern C++"' "include_directories(${nlohmann_json}/include)" |
||||||
|
''; |
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake ]; |
||||||
|
buildInputs = [ curl ]; |
||||||
|
propagatedBuildInputs = [ nlohmann_json ]; |
||||||
|
|
||||||
|
NIX_CFLAGS_COMPILE = [ |
||||||
|
"-Wno-error=range-loop-construct" |
||||||
|
]; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
description = "IPFS C++ API client library"; |
||||||
|
homepage = "https://github.com/vasild/cpp-ipfs-http-client"; |
||||||
|
license = licenses.mit; |
||||||
|
platforms = [ "x86_64-linux" "x86_64-darwin" ]; |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
--- source/CMakeLists.txt
|
||||||
|
+++ source/CMakeLists.txt
|
||||||
|
@@ -56,11 +56,6 @@ target_include_directories(${IPFS_API_LIBNAME}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Fetch "JSON for Modern C++"
|
||||||
|
-include(FetchContent)
|
||||||
|
-message(STATUS "Fetching nlohmann/JSON")
|
||||||
|
-# Retrieve Nlohmann JSON
|
||||||
|
-FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.10.5/json.tar.xz)
|
||||||
|
-FetchContent_MakeAvailable(json)
|
||||||
|
|
||||||
|
# libcurl requires additional libs only for static Windows builds
|
||||||
|
if(WIN32)
|
||||||
|
@@ -71,12 +66,11 @@ set_target_properties(${IPFS_API_LIBNAME} PROPERTIES
|
||||||
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||||
|
VERSION ${PROJECT_VERSION}
|
||||||
|
)
|
||||||
|
-target_link_libraries(${IPFS_API_LIBNAME} ${CURL_LIBRARIES} ${WINDOWS_CURL_LIBS} nlohmann_json::nlohmann_json)
|
||||||
|
+target_link_libraries(${IPFS_API_LIBNAME} ${CURL_LIBRARIES} ${WINDOWS_CURL_LIBS})
|
||||||
|
if(NOT DISABLE_INSTALL)
|
||||||
|
install(TARGETS ${IPFS_API_LIBNAME} DESTINATION lib)
|
||||||
|
install(FILES include/ipfs/client.h DESTINATION include/ipfs)
|
||||||
|
install(FILES include/ipfs/http/transport.h DESTINATION include/ipfs/http)
|
||||||
|
- install(FILES ${json_SOURCE_DIR}/include/nlohmann/json.hpp DESTINATION include/nlohmann)
|
||||||
|
endif()
|
||||||
|
# Tests, use "CTEST_OUTPUT_ON_FAILURE=1 make test" to see output from failed tests
|
@ -0,0 +1,24 @@ |
|||||||
|
{ lib, fetchFromGitHub, stdenv, cmake, libssh, openssl }: |
||||||
|
|
||||||
|
stdenv.mkDerivation rec { |
||||||
|
pname = "rtrlib"; |
||||||
|
version = "0.8.0"; |
||||||
|
|
||||||
|
src = fetchFromGitHub { |
||||||
|
repo = pname; |
||||||
|
owner = "rtrlib"; |
||||||
|
rev = "v${version}"; |
||||||
|
sha256 = "sha256-ISb4ojcDvXY/88GbFMrA5V5+SGE6CmE5D+pokDTwotQ="; |
||||||
|
}; |
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake ]; |
||||||
|
buildInputs = [ libssh openssl ]; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
description = "An open-source C implementation of the RPKI/Router Protocol client"; |
||||||
|
homepage = "https://github.com/rtrlib/rtrlib"; |
||||||
|
license = licenses.mit; |
||||||
|
maintainers = with maintainers; [ Anillc ]; |
||||||
|
platforms = platforms.all; |
||||||
|
}; |
||||||
|
} |
@ -1,31 +0,0 @@ |
|||||||
{ lib |
|
||||||
, buildPythonPackage |
|
||||||
, fetchPypi |
|
||||||
}: |
|
||||||
|
|
||||||
buildPythonPackage rec { |
|
||||||
pname = "ttp-templates"; |
|
||||||
version = "0.1.1"; |
|
||||||
format = "setuptools"; |
|
||||||
|
|
||||||
src = fetchPypi { |
|
||||||
pname = "ttp_templates"; |
|
||||||
inherit version; |
|
||||||
sha256 = "0vg7k733i8jqnfz8mpq8kzr2l7b7drk29zkzik91029f6w7li007"; |
|
||||||
}; |
|
||||||
|
|
||||||
# drop circular dependency on ttp |
|
||||||
postPatch = '' |
|
||||||
substituteInPlace setup.py --replace '"ttp>=0.6.0"' "" |
|
||||||
''; |
|
||||||
|
|
||||||
# circular dependency on ttp |
|
||||||
doCheck = false; |
|
||||||
|
|
||||||
meta = with lib; { |
|
||||||
description = "Template Text Parser Templates"; |
|
||||||
homepage = "https://github.com/dmulyalin/ttp_templates"; |
|
||||||
license = licenses.mit; |
|
||||||
maintainers = with maintainers; [ hexa ]; |
|
||||||
}; |
|
||||||
} |
|
@ -0,0 +1,49 @@ |
|||||||
|
{ runCommandNoCC, cargo, neovim, rust-analyzer, rustc }: |
||||||
|
runCommandNoCC "test-neovim-rust-analyzer" { |
||||||
|
nativeBuildInputs = [ cargo neovim rust-analyzer rustc ]; |
||||||
|
|
||||||
|
testRustSrc = /* rust */ '' |
||||||
|
fn main() { |
||||||
|
let mut var = vec![None]; |
||||||
|
var.push(Some("hello".to_owned())); |
||||||
|
} |
||||||
|
''; |
||||||
|
|
||||||
|
nvimConfig = /* lua */ '' |
||||||
|
vim.lsp.buf_attach_client(vim.api.nvim_get_current_buf(), vim.lsp.start_client({ |
||||||
|
cmd = { "rust-analyzer" }, |
||||||
|
handlers = { |
||||||
|
["$/progress"] = function(_, msg, ctx) |
||||||
|
if msg.token == "rustAnalyzer/Indexing" and msg.value.kind == "end" then |
||||||
|
vim.cmd("goto 23") -- let mut |var =... |
||||||
|
vim.lsp.buf.hover() |
||||||
|
end |
||||||
|
end, |
||||||
|
["textDocument/hover"] = function(_, msg, ctx) |
||||||
|
-- Keep newlines. |
||||||
|
io.write(msg.contents.value) |
||||||
|
vim.cmd("q") |
||||||
|
end, |
||||||
|
}, |
||||||
|
on_error = function(code) |
||||||
|
print("error: " .. code) |
||||||
|
vim.cmd("q") |
||||||
|
end |
||||||
|
})) |
||||||
|
''; |
||||||
|
|
||||||
|
} '' |
||||||
|
# neovim requires a writable HOME. |
||||||
|
export HOME="$(pwd)" |
||||||
|
|
||||||
|
cargo new --bin test-rust-analyzer |
||||||
|
cd test-rust-analyzer |
||||||
|
cat <<<"$testRustSrc" >src/main.rs |
||||||
|
cat <<<"$nvimConfig" >script.lua |
||||||
|
|
||||||
|
# `-u` doesn't work |
||||||
|
result="$(nvim --headless +'lua dofile("script.lua")' src/main.rs)" |
||||||
|
echo "$result" |
||||||
|
[[ "$result" == *"var: Vec<Option<String>>"* ]] |
||||||
|
touch $out |
||||||
|
'' |
@ -0,0 +1,34 @@ |
|||||||
|
{ stdenv |
||||||
|
, lib |
||||||
|
, makeWrapper |
||||||
|
, fetchurl |
||||||
|
, numactl |
||||||
|
, python3 |
||||||
|
}: |
||||||
|
|
||||||
|
stdenv.mkDerivation rec { |
||||||
|
pname = "rt-tests"; |
||||||
|
version = "2.3"; |
||||||
|
|
||||||
|
src = fetchurl { |
||||||
|
url = "https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/snapshot/${pname}-${version}.tar.gz"; |
||||||
|
sha256 = "Q+rNdpRdsmW2gcsrfwg12EzpvO6qlEP/Mb/OWQMNmr8="; |
||||||
|
}; |
||||||
|
|
||||||
|
nativeBuildInputs = [ makeWrapper ]; |
||||||
|
buildInputs = [ numactl python3 ]; |
||||||
|
|
||||||
|
makeFlags = [ "prefix=$(out)" "DESTDIR=" "PYLIB=$(out)/${python3.sitePackages}" ]; |
||||||
|
|
||||||
|
postInstall = '' |
||||||
|
wrapProgram "$out/bin/determine_maximum_mpps.sh" --prefix PATH : $out/bin |
||||||
|
''; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
homepage = https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git; |
||||||
|
description = "Suite of real-time tests - cyclictest, hwlatdetect, pip_stress, pi_stress, pmqtest, ptsematest, rt-migrate-test, sendme, signaltest, sigwaittest, svsematest"; |
||||||
|
platforms = platforms.linux; |
||||||
|
maintainers = with maintainers; [ poelzi ]; |
||||||
|
license = licenses.gpl2; |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,42 @@ |
|||||||
|
{ lib |
||||||
|
, buildGoModule |
||||||
|
, fetchgit |
||||||
|
, unstableGitUpdater |
||||||
|
}: |
||||||
|
|
||||||
|
buildGoModule { |
||||||
|
pname = "bloat"; |
||||||
|
version = "unstable-2022-03-31"; |
||||||
|
|
||||||
|
src = fetchgit { |
||||||
|
url = "git://git.freesoftwareextremist.com/bloat"; |
||||||
|
rev = "a38d29a43592601d37d671db8748f0980071c0c4"; |
||||||
|
sha256 = "sha256-7Hxt0QlOYMBMvDS40fpfSItGkd5nYFQmmjJIevNyeF8="; |
||||||
|
}; |
||||||
|
|
||||||
|
vendorSha256 = null; |
||||||
|
|
||||||
|
postInstall = '' |
||||||
|
mkdir -p $out/share/bloat |
||||||
|
cp -r templates $out/share/bloat/templates |
||||||
|
cp -r static $out/share/bloat/static |
||||||
|
sed \ |
||||||
|
-e "s%=templates%=$out/share/bloat/templates%g" \ |
||||||
|
-e "s%=static%=$out/share/bloat/static%g" \ |
||||||
|
< bloat.conf > $out/share/bloat/bloat.conf.example |
||||||
|
''; |
||||||
|
|
||||||
|
passthru.updateScript = unstableGitUpdater { }; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
description = "A web client for Pleroma and Mastodon"; |
||||||
|
longDescription = '' |
||||||
|
A lightweight web client for Pleroma and Mastodon. |
||||||
|
Does not require JavaScript to display text, images, audio and videos. |
||||||
|
''; |
||||||
|
homepage = "https://bloat.freesoftwareextremist.com"; |
||||||
|
downloadPage = "https://git.freesoftwareextremist.com/bloat/"; |
||||||
|
license = licenses.cc0; |
||||||
|
maintainers = with maintainers; [ fgaz ]; |
||||||
|
}; |
||||||
|
} |
Loading…
Reference in new issue