commit
de57d754a0
@ -0,0 +1,166 @@ |
||||
{ config, pkgs, lib, ... }: |
||||
with lib; |
||||
|
||||
let |
||||
cfg = config.services.kthxbye; |
||||
in |
||||
|
||||
{ |
||||
options.services.kthxbye = { |
||||
enable = mkEnableOption (mdDoc "kthxbye alert acknowledgement management daemon"); |
||||
|
||||
package = mkOption { |
||||
type = types.package; |
||||
default = pkgs.kthxbye; |
||||
defaultText = literalExpression "pkgs.kthxbye"; |
||||
description = mdDoc '' |
||||
The kthxbye package that should be used. |
||||
''; |
||||
}; |
||||
|
||||
openFirewall = mkOption { |
||||
type = types.bool; |
||||
default = false; |
||||
description = mdDoc '' |
||||
Whether to open ports in the firewall needed for the daemon to function. |
||||
''; |
||||
}; |
||||
|
||||
extraOptions = mkOption { |
||||
type = with types; listOf str; |
||||
default = []; |
||||
description = mdDoc '' |
||||
Extra command line options. |
||||
|
||||
Documentation can be found [here](https://github.com/prymitive/kthxbye/blob/main/README.md). |
||||
''; |
||||
example = literalExpression '' |
||||
[ |
||||
"-extend-with-prefix 'ACK!'" |
||||
]; |
||||
''; |
||||
}; |
||||
|
||||
alertmanager = { |
||||
timeout = mkOption { |
||||
type = types.str; |
||||
default = "1m0s"; |
||||
description = mdDoc '' |
||||
Alertmanager request timeout duration in the [time.Duration](https://pkg.go.dev/time#ParseDuration) format. |
||||
''; |
||||
example = "30s"; |
||||
}; |
||||
uri = mkOption { |
||||
type = types.str; |
||||
default = "http://localhost:9093"; |
||||
description = mdDoc '' |
||||
Alertmanager URI to use. |
||||
''; |
||||
example = "https://alertmanager.example.com"; |
||||
}; |
||||
}; |
||||
|
||||
extendBy = mkOption { |
||||
type = types.str; |
||||
default = "15m0s"; |
||||
description = mdDoc '' |
||||
Extend silences by adding DURATION seconds. |
||||
|
||||
DURATION should be provided in the [time.Duration](https://pkg.go.dev/time#ParseDuration) format. |
||||
''; |
||||
example = "6h0m0s"; |
||||
}; |
||||
|
||||
extendIfExpiringIn = mkOption { |
||||
type = types.str; |
||||
default = "5m0s"; |
||||
description = mdDoc '' |
||||
Extend silences that are about to expire in the next DURATION seconds. |
||||
|
||||
DURATION should be provided in the [time.Duration](https://pkg.go.dev/time#ParseDuration) format. |
||||
''; |
||||
example = "1m0s"; |
||||
}; |
||||
|
||||
extendWithPrefix = mkOption { |
||||
type = types.str; |
||||
default = "ACK!"; |
||||
description = mdDoc '' |
||||
Extend silences with comment starting with PREFIX string. |
||||
''; |
||||
example = "!perma-silence"; |
||||
}; |
||||
|
||||
interval = mkOption { |
||||
type = types.str; |
||||
default = "45s"; |
||||
description = mdDoc '' |
||||
Silence check interval duration in the [time.Duration](https://pkg.go.dev/time#ParseDuration) format. |
||||
''; |
||||
example = "30s"; |
||||
}; |
||||
|
||||
listenAddress = mkOption { |
||||
type = types.str; |
||||
default = "0.0.0.0"; |
||||
description = mdDoc '' |
||||
The address to listen on for HTTP requests. |
||||
''; |
||||
example = "127.0.0.1"; |
||||
}; |
||||
|
||||
port = mkOption { |
||||
type = types.port; |
||||
default = 8080; |
||||
description = mdDoc '' |
||||
The port to listen on for HTTP requests. |
||||
''; |
||||
}; |
||||
|
||||
logJSON = mkOption { |
||||
type = types.bool; |
||||
default = false; |
||||
description = mdDoc '' |
||||
Format logged messages as JSON. |
||||
''; |
||||
}; |
||||
|
||||
maxDuration = mkOption { |
||||
type = with types; nullOr str; |
||||
default = null; |
||||
description = mdDoc '' |
||||
Maximum duration of a silence, it won't be extended anymore after reaching it. |
||||
|
||||
Duration should be provided in the [time.Duration](https://pkg.go.dev/time#ParseDuration) format. |
||||
''; |
||||
example = "30d"; |
||||
}; |
||||
}; |
||||
|
||||
config = mkIf cfg.enable { |
||||
systemd.services.kthxbye = { |
||||
description = "kthxbye Alertmanager ack management daemon"; |
||||
wantedBy = [ "multi-user.target" ]; |
||||
script = '' |
||||
${cfg.package}/bin/kthxbye \ |
||||
-alertmanager.timeout ${cfg.alertmanager.timeout} \ |
||||
-alertmanager.uri ${cfg.alertmanager.uri} \ |
||||
-extend-by ${cfg.extendBy} \ |
||||
-extend-if-expiring-in ${cfg.extendIfExpiringIn} \ |
||||
-extend-with-prefix ${cfg.extendWithPrefix} \ |
||||
-interval ${cfg.interval} \ |
||||
-listen ${cfg.listenAddress}:${toString cfg.port} \ |
||||
${optionalString cfg.logJSON "-log-json"} \ |
||||
${optionalString (cfg.maxDuration != null) "-max-duration ${cfg.maxDuration}"} \ |
||||
${concatStringsSep " " cfg.extraOptions} |
||||
''; |
||||
serviceConfig = { |
||||
Type = "simple"; |
||||
DynamicUser = true; |
||||
Restart = "on-failure"; |
||||
}; |
||||
}; |
||||
|
||||
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ]; |
||||
}; |
||||
} |
@ -0,0 +1,110 @@ |
||||
import ./make-test-python.nix ({ lib, pkgs, ... }: |
||||
{ |
||||
name = "kthxbye"; |
||||
|
||||
meta = with lib.maintainers; { |
||||
maintainers = [ nukaduka ]; |
||||
}; |
||||
|
||||
nodes.server = { ... }: { |
||||
environment.systemPackages = with pkgs; [ prometheus-alertmanager ]; |
||||
services.prometheus = { |
||||
enable = true; |
||||
|
||||
globalConfig = { |
||||
scrape_interval = "5s"; |
||||
scrape_timeout = "5s"; |
||||
evaluation_interval = "5s"; |
||||
}; |
||||
|
||||
scrapeConfigs = [ |
||||
{ |
||||
job_name = "prometheus"; |
||||
scrape_interval = "5s"; |
||||
static_configs = [ |
||||
{ |
||||
targets = [ "localhost:9090" ]; |
||||
} |
||||
]; |
||||
} |
||||
]; |
||||
|
||||
rules = [ |
||||
'' |
||||
groups: |
||||
- name: test |
||||
rules: |
||||
- alert: node_up |
||||
expr: up != 0 |
||||
for: 5s |
||||
labels: |
||||
severity: bottom of the barrel |
||||
annotations: |
||||
summary: node is fine |
||||
'' |
||||
]; |
||||
|
||||
alertmanagers = [ |
||||
{ |
||||
static_configs = [ |
||||
{ |
||||
targets = [ |
||||
"localhost:9093" |
||||
]; |
||||
} |
||||
]; |
||||
} |
||||
]; |
||||
|
||||
alertmanager = { |
||||
enable = true; |
||||
openFirewall = true; |
||||
configuration.route = { |
||||
receiver = "test"; |
||||
group_wait = "5s"; |
||||
group_interval = "5s"; |
||||
group_by = [ "..." ]; |
||||
}; |
||||
configuration.receivers = [ |
||||
{ |
||||
name = "test"; |
||||
webhook_configs = [ |
||||
{ |
||||
url = "http://localhost:1234"; |
||||
} |
||||
]; |
||||
} |
||||
]; |
||||
}; |
||||
}; |
||||
|
||||
services.kthxbye = { |
||||
enable = true; |
||||
openFirewall = true; |
||||
extendIfExpiringIn = "30s"; |
||||
logJSON = true; |
||||
maxDuration = "15m"; |
||||
interval = "5s"; |
||||
}; |
||||
}; |
||||
|
||||
testScript = '' |
||||
with subtest("start the server"): |
||||
start_all() |
||||
server.wait_for_unit("prometheus.service") |
||||
server.wait_for_unit("alertmanager.service") |
||||
server.wait_for_unit("kthxbye.service") |
||||
|
||||
server.sleep(2) # wait for units to settle |
||||
server.systemctl("restart kthxbye.service") # make sure kthxbye comes up after alertmanager |
||||
server.sleep(2) |
||||
|
||||
with subtest("set up test silence which expires in 20s"): |
||||
server.succeed('amtool --alertmanager.url "http://localhost:9093" silence add alertname="node_up" -a "nixosTest" -d "20s" -c "ACK! this server is fine!!"') |
||||
|
||||
with subtest("wait for 21 seconds and check if the silence is still active"): |
||||
server.sleep(21) |
||||
server.systemctl("status kthxbye.service") |
||||
server.succeed("amtool --alertmanager.url 'http://localhost:9093' silence | grep 'ACK'") |
||||
''; |
||||
}) |
@ -0,0 +1,62 @@ |
||||
From fbf2ddd872db6a3640bc7d693356b99be9dd70f5 Mon Sep 17 00:00:00 2001
|
||||
From: OPNA2608 <christoph.neidahl@gmail.com>
|
||||
Date: Thu, 18 Aug 2022 20:12:07 +0200
|
||||
Subject: [PATCH] Remove FetchContent usage
|
||||
|
||||
---
|
||||
CMakeLists.txt | 27 +++++----------------------
|
||||
1 file changed, 5 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 84c66a7..5234903 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -30,20 +30,9 @@ project(Fire VERSION 0.9.9)
|
||||
# or
|
||||
# add_subdirectory(JUCE) # If you've put JUCE in a subdirectory called JUCE
|
||||
|
||||
-include(FetchContent)
|
||||
-FetchContent_Declare(
|
||||
- JUCE
|
||||
- GIT_REPOSITORY https://github.com/juce-framework/JUCE.git
|
||||
- GIT_TAG 7.0.1
|
||||
-)
|
||||
-FetchContent_MakeAvailable(JUCE)
|
||||
-
|
||||
-FetchContent_Declare(
|
||||
- readerwriterqueue
|
||||
- GIT_REPOSITORY https://github.com/cameron314/readerwriterqueue
|
||||
- GIT_TAG v1.0.6
|
||||
-)
|
||||
-FetchContent_MakeAvailable(readerwriterqueue)
|
||||
+add_subdirectory(JUCE EXCLUDE_FROM_ALL)
|
||||
+
|
||||
+add_subdirectory(readerwriterqueue EXCLUDE_FROM_ALL)
|
||||
|
||||
# If you are building a VST2 or AAX plugin, CMake needs to be told where to find these SDKs on your
|
||||
# system. This setup should be done before calling `juce_add_plugin`.
|
||||
@@ -172,13 +161,7 @@ set(TestFiles
|
||||
test/CatchMain.cpp
|
||||
test/PluginTest.cpp)
|
||||
|
||||
-# Download the tagged version of Catch2
|
||||
-Include(FetchContent)
|
||||
-FetchContent_Declare(
|
||||
- Catch2
|
||||
- GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
- GIT_TAG v2.13.7)
|
||||
-FetchContent_MakeAvailable(Catch2)
|
||||
+add_subdirectory(Catch2 EXCLUDE_FROM_ALL)
|
||||
|
||||
# Setup the test executable, again C++ 20 please
|
||||
add_executable(Tests ${TestFiles})
|
||||
@@ -199,4 +182,4 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/test PREFIX "" FILES ${TestFiles})
|
||||
# We have to manually provide the source directory here for now
|
||||
# https://github.com/catchorg/Catch2/issues/2026
|
||||
include(${Catch2_SOURCE_DIR}/contrib/Catch.cmake)
|
||||
-catch_discover_tests(Tests)
|
||||
\ No newline at end of file
|
||||
+catch_discover_tests(Tests)
|
||||
--
|
||||
2.36.0
|
||||
|
@ -0,0 +1,117 @@ |
||||
{ stdenv |
||||
, lib |
||||
, fetchFromGitHub |
||||
, cmake |
||||
, pkg-config |
||||
, catch2 |
||||
, libX11 |
||||
, libXrandr |
||||
, libXinerama |
||||
, libXext |
||||
, libXcursor |
||||
, freetype |
||||
, alsa-lib |
||||
, Cocoa |
||||
, WebKit |
||||
, CoreServices |
||||
, DiscRecording |
||||
, CoreAudioKit |
||||
, MetalKit |
||||
, simd |
||||
}: |
||||
|
||||
let |
||||
# FetchContent replacement, check CMakeLists.txt for requested versions (Nixpkgs' Catch2 works) |
||||
readerwriterqueue = fetchFromGitHub { |
||||
owner = "cameron314"; |
||||
repo = "readerwriterqueue"; |
||||
rev = "v1.0.6"; |
||||
sha256 = "sha256-g7NX7Ucl5GWw3u6TiUOITjhv7492ByTzACtWR0Ph2Jc="; |
||||
}; |
||||
in |
||||
stdenv.mkDerivation rec { |
||||
pname = "fire"; |
||||
version = "1.0.0.3"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "jerryuhoo"; |
||||
repo = "Fire"; |
||||
rev = "v${version}"; |
||||
fetchSubmodules = true; |
||||
sha256 = "sha256-X3pzTrNd0G6BouCDkr3dukQTFDzZ7qblIYxFQActKGE="; |
||||
}; |
||||
|
||||
patches = [ |
||||
./0001-Remove-FetchContent-usage.patch |
||||
]; |
||||
|
||||
postPatch = '' |
||||
# 1. Remove hardcoded LTO flags: needs extra setup on Linux, |
||||
# possibly broken on Darwin |
||||
# https://github.com/NixOS/nixpkgs/issues/19098 |
||||
# 2. Disable automatic copying of built plugins during buildPhase, it defaults |
||||
# into user home and we want to have building & installing separated. |
||||
sed -i \ |
||||
-e '/juce::juce_recommended_lto_flags/d' \ |
||||
-e 's/COPY_PLUGIN_AFTER_BUILD TRUE/COPY_PLUGIN_AFTER_BUILD FALSE/g' \ |
||||
CMakeLists.txt |
||||
''; |
||||
|
||||
preConfigure = '' |
||||
ln -s ${readerwriterqueue} readerwriterqueue |
||||
ln -s ${catch2.src} Catch2 |
||||
''; |
||||
|
||||
nativeBuildInputs = [ |
||||
cmake |
||||
pkg-config |
||||
]; |
||||
|
||||
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ |
||||
libX11 |
||||
libXrandr |
||||
libXinerama |
||||
libXext |
||||
libXcursor |
||||
freetype |
||||
alsa-lib |
||||
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ |
||||
Cocoa |
||||
WebKit |
||||
CoreServices |
||||
DiscRecording |
||||
CoreAudioKit |
||||
MetalKit |
||||
simd |
||||
]; |
||||
|
||||
installPhase = let |
||||
vst3Dir = "${placeholder "out"}/${if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/VST3" else "lib/vst3"}"; |
||||
auDir = "${placeholder "out"}/Library/Audio/Plug-Ins/Components"; |
||||
in '' |
||||
runHook preInstall |
||||
|
||||
mkdir -p ${vst3Dir} |
||||
# Exact path of the build artefact depends on used CMAKE_BUILD_TYPE |
||||
cp -R Fire_artefacts/*/VST3/* ${vst3Dir}/ |
||||
'' + lib.optionalString stdenv.hostPlatform.isDarwin '' |
||||
mkdir -p ${auDir} |
||||
cp -R Fire_artefacts/*/AU/* ${auDir}/ |
||||
'' + '' |
||||
|
||||
runHook postInstall |
||||
''; |
||||
|
||||
# Fails to find fp.h on its own |
||||
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-isystem ${CoreServices}/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/CarbonCore.framework/Versions/Current/Headers/"; |
||||
|
||||
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; |
||||
|
||||
meta = with lib; { |
||||
description = "Multi-band distortion plugin by Wings"; |
||||
homepage = "https://github.com/jerryuhoo/Fire"; |
||||
license = licenses.agpl3Only; # Not clarified if Only or Plus |
||||
platforms = platforms.unix; |
||||
maintainers = with maintainers; [ OPNA2608 ]; |
||||
}; |
||||
} |
@ -0,0 +1,18 @@ |
||||
commit 5e0cb8066fb1653399c54e93e42375295c2562bd
|
||||
Author: Ivar Scholten <ivar.scholten@protonmail.com>
|
||||
Date: Fri Sep 9 14:27:55 2022 +0200
|
||||
|
||||
Externals/minizip: add missing include to CheckFunctionExists
|
||||
|
||||
diff --git a/Externals/minizip/CMakeLists.txt b/Externals/minizip/CMakeLists.txt
|
||||
index c3d7c5512e..f59f8b295c 100644
|
||||
--- a/Externals/minizip/CMakeLists.txt
|
||||
+++ b/Externals/minizip/CMakeLists.txt
|
||||
@@ -60,6 +60,7 @@ if (HAVE_INTTYPES_H)
|
||||
target_compile_definitions(minizip PRIVATE HAVE_INTTYPES_H)
|
||||
endif()
|
||||
|
||||
+include(CheckFunctionExists)
|
||||
check_function_exists(fseeko HAVE_FSEEKO)
|
||||
if (NOT HAVE_FSEEKO)
|
||||
target_compile_definitions(minizip PRIVATE NO_FSEEKO)
|
@ -0,0 +1,39 @@ |
||||
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }: |
||||
|
||||
buildGoModule rec { |
||||
pname = "mangal"; |
||||
version = "3.10.0"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "metafates"; |
||||
repo = pname; |
||||
rev = "v${version}"; |
||||
hash = "sha256-rWj9CknWNI6SSh0AwaPpj5TxHQzkAmaAhWW7kze3xiY="; |
||||
}; |
||||
|
||||
proxyVendor = true; |
||||
vendorSha256 = "sha256-ZgeG8S78/yS9KfEK1bZ3VlQGmZPBo9TXLQLz8rXOEGo="; |
||||
|
||||
ldflags = [ "-s" "-w" ]; |
||||
|
||||
nativeBuildInputs = [ installShellFiles ]; |
||||
|
||||
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' |
||||
# Mangal creates a config file in the folder ~/.config/mangal and fails if not possible |
||||
export MANGAL_CONFIG_PATH=`mktemp -d` |
||||
installShellCompletion --cmd mangal \ |
||||
--bash <($out/bin/mangal completion bash) \ |
||||
--zsh <($out/bin/mangal completion zsh) \ |
||||
--fish <($out/bin/mangal completion fish) |
||||
''; |
||||
|
||||
doCheck = false; # test fail because of sandbox |
||||
|
||||
meta = with lib; { |
||||
description = |
||||
"A fancy CLI app written in Go which scrapes, downloads and packs manga into different formats"; |
||||
homepage = "https://github.com/metafates/mangal"; |
||||
license = licenses.mit; |
||||
maintainers = [ maintainers.bertof ]; |
||||
}; |
||||
} |
@ -0,0 +1,39 @@ |
||||
{ lib |
||||
, stdenv |
||||
, fetchFromGitHub |
||||
, zlib |
||||
, libdeflate |
||||
, isa-l |
||||
}: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
pname = "seqtk"; |
||||
version = "1.3"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "lh3"; |
||||
repo = "seqtk"; |
||||
rev = "v${version}"; |
||||
hash = "sha256-1Hw/lnoFQumuEJg1n2C6vnWkBa+VLiEiDrosghSm360="; |
||||
}; |
||||
|
||||
buildInputs = [ zlib libdeflate isa-l ]; |
||||
|
||||
makeFlags = [ "CC=cc" ]; |
||||
|
||||
installPhase = '' |
||||
runHook preInstall |
||||
|
||||
install -Dm755 -t $out/bin seqtk |
||||
|
||||
runHook postInstall |
||||
''; |
||||
|
||||
meta = with lib; { |
||||
description = "Toolkit for processing sequences in FASTA/Q formats"; |
||||
license = licenses.mit; |
||||
homepage = "https://github.com/lh3/seqtk"; |
||||
platforms = platforms.all; |
||||
maintainers = with maintainers; [ bwlang ]; |
||||
}; |
||||
} |
@ -0,0 +1,153 @@ |
||||
{ lib |
||||
, stdenv |
||||
, fetchurl |
||||
, which |
||||
, python3 |
||||
, gfortran |
||||
, gcc |
||||
, cmake |
||||
, perl |
||||
, gnum4 |
||||
, libwhich |
||||
, libxml2 |
||||
, libunwind |
||||
, libgit2 |
||||
, curl |
||||
, nghttp2 |
||||
, mbedtls |
||||
, libssh2 |
||||
, gmp |
||||
, mpfr |
||||
, suitesparse |
||||
, utf8proc |
||||
, zlib |
||||
, p7zip |
||||
, ncurses |
||||
, pcre2 |
||||
}: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
pname = "julia"; |
||||
version = "1.8.1"; |
||||
|
||||
src = fetchurl { |
||||
url = "https://github.com/JuliaLang/julia/releases/download/v${version}/julia-${version}-full.tar.gz"; |
||||
sha256 = "sha256-MeRlX0s3fnPW9YPFOdAiHte0gKPqCRgz0ABTFhhcW2E="; |
||||
}; |
||||
|
||||
patches = |
||||
let |
||||
path = name: "https://raw.githubusercontent.com/archlinux/svntogit-community/6fd126d089d44fdc875c363488a7c7435a223cec/trunk/${name}"; |
||||
in |
||||
[ |
||||
(fetchurl { |
||||
url = path "julia-hardcoded-libs.patch"; |
||||
sha256 = "sha256-kppSpVA7bRohd0wXDs4Jgct9ocHnpbeiiSz7ElFom1U="; |
||||
}) |
||||
(fetchurl { |
||||
url = path "julia-libgit-1.4.patch"; |
||||
sha256 = "sha256-rcVXYoGpAxwAbAl33n0/Rkwsi8ZJz8cnHQ5CalUx+1o="; |
||||
}) |
||||
(fetchurl { |
||||
url = path "julia-libunwind-1.6.patch"; |
||||
sha256 = "sha256-zqMh9+Fjgd15XuINe9Xtpk+bRTwB0T6WCWLrJyOQfiQ="; |
||||
}) |
||||
./patches/1.8/0001-skip-symlink-system-libraries.patch |
||||
./patches/1.8/0002-skip-building-doc.patch |
||||
./patches/1.8/0003-skip-failing-tests.patch |
||||
./patches/1.8/0004-ignore-absolute-path-when-loading-library.patch |
||||
]; |
||||
|
||||
nativeBuildInputs = [ |
||||
which |
||||
python3 |
||||
gfortran |
||||
cmake |
||||
perl |
||||
gnum4 |
||||
libwhich |
||||
]; |
||||
|
||||
buildInputs = [ |
||||
libxml2 |
||||
libunwind |
||||
libgit2 |
||||
curl |
||||
nghttp2 |
||||
mbedtls |
||||
libssh2 |
||||
gmp |
||||
mpfr |
||||
utf8proc |
||||
zlib |
||||
p7zip |
||||
pcre2 |
||||
]; |
||||
|
||||
JULIA_RPATH = lib.makeLibraryPath (buildInputs ++ [ stdenv.cc.cc gfortran.cc ncurses ]); |
||||
|
||||
dontUseCmakeConfigure = true; |
||||
|
||||
postPatch = '' |
||||
patchShebangs . |
||||
''; |
||||
|
||||
LDFLAGS = "-Wl,-rpath,${JULIA_RPATH}"; |
||||
|
||||
makeFlags = [ |
||||
"prefix=$(out)" |
||||
"USE_BINARYBUILDER=0" |
||||
"USE_SYSTEM_CSL=1" |
||||
"USE_SYSTEM_LLVM=0" # a patched version is required |
||||
"USE_SYSTEM_LIBUNWIND=1" |
||||
"USE_SYSTEM_PCRE=1" |
||||
"USE_SYSTEM_LIBM=0" |
||||
"USE_SYSTEM_OPENLIBM=0" |
||||
"USE_SYSTEM_DSFMT=0" # not available in nixpkgs |
||||
"USE_SYSTEM_LIBBLASTRAMPOLINE=0" # not available in nixpkgs |
||||
"USE_SYSTEM_BLAS=0" # test failure |
||||
"USE_SYSTEM_LAPACK=0" # test failure |
||||
"USE_SYSTEM_GMP=1" |
||||
"USE_SYSTEM_MPFR=1" |
||||
"USE_SYSTEM_LIBSUITESPARSE=0" # test failure |
||||
"USE_SYSTEM_LIBUV=0" # a patched version is required |
||||
"USE_SYSTEM_UTF8PROC=1" |
||||
"USE_SYSTEM_MBEDTLS=1" |
||||
"USE_SYSTEM_LIBSSH2=1" |
||||
"USE_SYSTEM_NGHTTP2=1" |
||||
"USE_SYSTEM_CURL=1" |
||||
"USE_SYSTEM_LIBGIT2=1" |
||||
"USE_SYSTEM_PATCHELF=1" |
||||
"USE_SYSTEM_LIBWHICH=1" |
||||
"USE_SYSTEM_ZLIB=1" |
||||
"USE_SYSTEM_P7ZIP=1" |
||||
|
||||
"PCRE_INCL_PATH=${pcre2.dev}/include/pcre2.h" |
||||
]; |
||||
|
||||
doInstallCheck = true; |
||||
installCheckTarget = "testall"; |
||||
|
||||
preInstallCheck = '' |
||||
export HOME="$TMPDIR" |
||||
export JULIA_TEST_USE_MULTIPLE_WORKERS="true" |
||||
''; |
||||
|
||||
dontStrip = true; |
||||
|
||||
postFixup = '' |
||||
for file in $out/bin/julia $out/lib/libjulia.so $out/lib/julia/libjulia-internal.so $out/lib/julia/libjulia-codegen.so; do |
||||
patchelf --set-rpath "$out/lib:$out/lib/julia:${JULIA_RPATH}" $file |
||||
done |
||||
''; |
||||
|
||||
enableParallelBuilding = true; |
||||
|
||||
meta = with lib; { |
||||
description = "High-level performance-oriented dynamical language for technical computing"; |
||||
homepage = "https://julialang.org/"; |
||||
license = licenses.mit; |
||||
maintainers = with maintainers; [ nickcao ]; |
||||
platforms = [ "x86_64-linux" "aarch64-linux" ]; |
||||
}; |
||||
} |
@ -0,0 +1,32 @@ |
||||
From f342b6bfab5eee9c7fea9ddc8804d9a5ff6953eb Mon Sep 17 00:00:00 2001
|
||||
From: Nick Cao <nickcao@nichi.co>
|
||||
Date: Tue, 20 Sep 2022 18:42:08 +0800
|
||||
Subject: [PATCH 1/4] skip symlink system libraries
|
||||
|
||||
---
|
||||
base/Makefile | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/base/Makefile b/base/Makefile
|
||||
index 23a9c40..12f92aa 100644
|
||||
--- a/base/Makefile
|
||||
+++ b/base/Makefile
|
||||
@@ -181,7 +181,6 @@ $$(build_private_libdir)/$$(libname_$2):
|
||||
fi; \
|
||||
fi
|
||||
ifneq ($$(USE_SYSTEM_$1),0)
|
||||
-SYMLINK_SYSTEM_LIBRARIES += symlink_$2
|
||||
endif
|
||||
endef
|
||||
|
||||
@@ -265,7 +264,6 @@ $(build_private_libdir)/libLLVM.$(SHLIB_EXT):
|
||||
ln -sf "$$REALPATH" "$@"
|
||||
ifneq ($(USE_SYSTEM_LLVM),0)
|
||||
ifneq ($(USE_LLVM_SHLIB),0)
|
||||
-SYMLINK_SYSTEM_LIBRARIES += symlink_libLLVM
|
||||
endif
|
||||
endif
|
||||
|
||||
--
|
||||
2.37.2
|
||||
|
@ -0,0 +1,25 @@ |
||||
From 6a7723be33261cdc302e0f7bdb37fb50d30cc5fc Mon Sep 17 00:00:00 2001
|
||||
From: Nick Cao <nickcao@nichi.co>
|
||||
Date: Tue, 20 Sep 2022 18:42:31 +0800
|
||||
Subject: [PATCH 2/4] skip building doc
|
||||
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index d38311d..a775d36 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -227,7 +227,7 @@ define stringreplace
|
||||
endef
|
||||
|
||||
|
||||
-install: $(build_depsbindir)/stringreplace $(BUILDROOT)/doc/_build/html/en/index.html
|
||||
+install: $(build_depsbindir)/stringreplace
|
||||
ifeq ($(BUNDLE_DEBUG_LIBS),1)
|
||||
@$(MAKE) $(QUIET_MAKE) all
|
||||
else
|
||||
--
|
||||
2.37.2
|
||||
|
@ -0,0 +1,25 @@ |
||||
From a57c582eabc4703ed627b32f7f11893db9676fb6 Mon Sep 17 00:00:00 2001
|
||||
From: Nick Cao <nickcao@nichi.co>
|
||||
Date: Tue, 20 Sep 2022 18:42:59 +0800
|
||||
Subject: [PATCH 3/4] skip failing tests
|
||||
|
||||
---
|
||||
test/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/Makefile b/test/Makefile
|
||||
index 24e137a..0e82acf 100644
|
||||
--- a/test/Makefile
|
||||
+++ b/test/Makefile
|
||||
@@ -23,7 +23,7 @@ default:
|
||||
|
||||
$(TESTS):
|
||||
@cd $(SRCDIR) && \
|
||||
- $(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) --check-bounds=yes --startup-file=no --depwarn=error ./runtests.jl $@)
|
||||
+ $(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) --check-bounds=yes --startup-file=no --depwarn=error ./runtests.jl --skip LibGit2_jll --skip MozillaCACerts_jll --skip NetworkOptions --skip nghttp2_jll $@)
|
||||
|
||||
$(addprefix revise-, $(TESTS)): revise-% :
|
||||
@cd $(SRCDIR) && \
|
||||
--
|
||||
2.37.2
|
||||
|
@ -0,0 +1,27 @@ |
||||
From a60100f06f48fbb4697aced65175bf3d41185e3e Mon Sep 17 00:00:00 2001
|
||||
From: Nick Cao <nickcao@nichi.co>
|
||||
Date: Tue, 20 Sep 2022 18:43:15 +0800
|
||||
Subject: [PATCH 4/4] ignore absolute path when loading library
|
||||
|
||||
---
|
||||
cli/loader_lib.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/cli/loader_lib.c b/cli/loader_lib.c
|
||||
index 0301b6e..5cbda61 100644
|
||||
--- a/cli/loader_lib.c
|
||||
+++ b/cli/loader_lib.c
|
||||
@@ -50,9 +50,7 @@ static void * load_library(const char * rel_path, const char * src_dir, int err)
|
||||
#endif
|
||||
|
||||
char path[2*JL_PATH_MAX + 1] = {0};
|
||||
- strncat(path, src_dir, sizeof(path) - 1);
|
||||
- strncat(path, PATHSEPSTRING, sizeof(path) - 1);
|
||||
- strncat(path, rel_path, sizeof(path) - 1);
|
||||
+ strncat(path, basename, sizeof(path) - 1);
|
||||
|
||||
#if defined(_OS_WINDOWS_)
|
||||
wchar_t wpath[2*JL_PATH_MAX + 1] = {0};
|
||||
--
|
||||
2.37.2
|
||||
|
@ -0,0 +1,68 @@ |
||||
{ stdenv |
||||
, lib |
||||
, pandoc |
||||
, esbuild |
||||
, deno |
||||
, fetchurl |
||||
, nodePackages |
||||
, rWrapper |
||||
, rPackages |
||||
, makeWrapper |
||||
, python3 |
||||
}: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
pname = "quarto"; |
||||
version = "1.1.189"; |
||||
src = fetchurl { |
||||
url = "https://github.com/quarto-dev/quarto-cli/releases/download/v${version}/quarto-${version}-linux-amd64.tar.gz"; |
||||
sha256 = "1a3xsgqdccm4ky1xjnin1idpp8gsansskq37c00mrxz1raxn1mi7"; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ |
||||
makeWrapper |
||||
]; |
||||
|
||||
patches = [ |
||||
./fix-deno-path.patch |
||||
]; |
||||
|
||||
dontStrip = true; |
||||
|
||||
preFixup = '' |
||||
wrapProgram $out/bin/quarto \ |
||||
--prefix PATH : ${lib.makeBinPath [ deno ]} \ |
||||
--prefix QUARTO_PANDOC : ${pandoc}/bin/pandoc \ |
||||
--prefix QUARTO_ESBUILD : ${esbuild}/bin/esbuild \ |
||||
--prefix QUARTO_DART_SASS : ${nodePackages.sass}/bin/sass \ |
||||
--prefix QUARTO_R : ${rWrapper.override { packages = [ rPackages.rmarkdown]; }}/bin/R \ |
||||
--prefix QUARTO_PYTHON : ${python3.withPackages (ps: with ps; [ jupyter ipython ])}/bin/python3 |
||||
''; |
||||
|
||||
installPhase = '' |
||||
runHook preInstall |
||||
|
||||
mkdir -p $out/bin $out/share |
||||
|
||||
rm -r bin/tools |
||||
|
||||
mv bin/* $out/bin |
||||
mv share/* $out/share |
||||
|
||||
runHook preInstall |
||||
''; |
||||
|
||||
meta = with lib; { |
||||
description = "Open-source scientific and technical publishing system built on Pandoc"; |
||||
longDescription = '' |
||||
Quarto is an open-source scientific and technical publishing system built on Pandoc. |
||||
Quarto documents are authored using markdown, an easy to write plain text format. |
||||
''; |
||||
homepage = "https://quarto.org/"; |
||||
changelog = "https://github.com/quarto-dev/quarto-cli/releases/tag/v${version}"; |
||||
license = licenses.gpl2Plus; |
||||
maintainers = with maintainers; [ mrtarantoga ]; |
||||
platforms = [ "x86_64-linux" ]; |
||||
sourceProvenance = with sourceTypes; [ binaryNativeCode binaryBytecode ]; |
||||
}; |
||||
} |
@ -0,0 +1,8 @@ |
||||
--- a/bin/quarto
|
||||
+++ b/bin/quarto
|
||||
@@ -125,4 +125,4 @@ fi
|
||||
# Be sure to include any already defined QUARTO_DENO_OPTIONS
|
||||
QUARTO_DENO_OPTIONS="--unstable --no-config --cached-only --allow-read --allow-write --allow-run --allow-env --allow-net --allow-ffi ${QUARTO_DENO_OPTIONS}"
|
||||
|
||||
-"${QUARTO_DENO}" ${QUARTO_ACTION} ${QUARTO_DENO_OPTIONS} ${QUARTO_DENO_EXTRA_OPTIONS} "${QUARTO_IMPORT_ARGMAP}" "${QUARTO_TARGET}" "$@"
|
||||
+deno ${QUARTO_ACTION} ${QUARTO_DENO_OPTIONS} ${QUARTO_DENO_EXTRA_OPTIONS} "${QUARTO_IMPORT_ARGMAP}" "${QUARTO_TARGET}" "$@"
|
@ -0,0 +1,25 @@ |
||||
{ lib, stdenv, buildGoModule, fetchFromGitHub, OpenGL }: |
||||
|
||||
buildGoModule rec { |
||||
pname = "gdlv"; |
||||
version = "1.8.0"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "aarzilli"; |
||||
repo = "gdlv"; |
||||
rev = "v${version}"; |
||||
sha256 = "sha256-G1/Wbz836yfGZ/1ArICrNbWU6eh4SHXDmo4FKkjUszY="; |
||||
}; |
||||
|
||||
vendorSha256 = null; |
||||
subPackages = "."; |
||||
|
||||
buildInputs = lib.optionals stdenv.isDarwin [ OpenGL ]; |
||||
|
||||
meta = with lib; { |
||||
description = "GUI frontend for Delve"; |
||||
homepage = "https://github.com/aarzilli/gdlv"; |
||||
maintainers = with maintainers; [ mmlb ]; |
||||
license = licenses.gpl3; |
||||
}; |
||||
} |
@ -0,0 +1,32 @@ |
||||
{ lib |
||||
, rustPlatform |
||||
, fetchFromGitHub |
||||
, libusb |
||||
, libftdi |
||||
, cargo-readme |
||||
, pkg-config |
||||
}: |
||||
|
||||
rustPlatform.buildRustPackage rec { |
||||
pname = "humility"; |
||||
version = "unstable-2022-09-15"; |
||||
|
||||
nativeBuildInputs = [ pkg-config cargo-readme ]; |
||||
buildInputs = [ libusb libftdi ]; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "oxidecomputer"; |
||||
repo = pname; |
||||
rev = "d336c21c7b6da7f8203a9331c7657581de2bc6ad"; |
||||
sha256 = "sha256-yW7QcxTWbL2YsV2bvfhbqQ2nawlPQbYxBfIGCWo28GY="; |
||||
}; |
||||
|
||||
cargoSha256 = "sha256-UhO8VO3OCfYc8Xq/P+l9f5ZrhOD/TBzSClAeAXLJLlc="; |
||||
|
||||
meta = with lib; { |
||||
description = "Debugger for Hubris"; |
||||
homepage = "https://github.com/oxidecomputer/humility"; |
||||
license = with licenses; [ mpl20 ]; |
||||
maintainers = with maintainers; [ therishidesai ]; |
||||
}; |
||||
} |
@ -0,0 +1,26 @@ |
||||
{ lib, stdenv, fetchFromGitHub, Foundation }: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
pname = "defaultbrowser"; |
||||
version = "unstable-2020-07-23"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "kerma"; |
||||
repo = pname; |
||||
rev = "d2860c00dd7fbb5d615232cc819d7d492a6a6ddb"; |
||||
sha256 = "sha256-SelUQXoKtShcDjq8uKg3wM0kG2opREa2DGQCDd6IsOQ="; |
||||
}; |
||||
|
||||
makeFlags = [ "CC=cc" "PREFIX=$(out)" ]; |
||||
|
||||
buildInputs = [ Foundation ]; |
||||
|
||||
meta = with lib; { |
||||
mainProgram = "defaultbrowser"; |
||||
description = "Command line tool for getting and setting a default browser (HTTP handler) in Mac OS X"; |
||||
homepage = "https://github.com/kerma/defaultbrowser"; |
||||
platforms = platforms.darwin; |
||||
maintainers = with maintainers; [ Enzime ]; |
||||
license = licenses.mit; |
||||
}; |
||||
} |
@ -0,0 +1,39 @@ |
||||
{ pkgs |
||||
, lib |
||||
, buildGoModule |
||||
, fetchFromGitHub |
||||
, nixosTests |
||||
}: |
||||
|
||||
buildGoModule rec { |
||||
pname = "kthxbye"; |
||||
version = "0.15"; |
||||
|
||||
src = fetchFromGitHub rec { |
||||
owner = "prymitive"; |
||||
repo = "kthxbye"; |
||||
rev = "v${version}"; |
||||
hash = "sha256-N1MzutjzLk9MnE1b7dKRsiS7LL4Nb61+NpmjTBPGohI="; |
||||
}; |
||||
|
||||
vendorHash = "sha256-PtINxblqX/wxJyN42mS+hmwMy0lCd6FcQgmBnxTUdcc="; |
||||
|
||||
buildPhase = '' |
||||
make -j$NIX_BUILD_CORES |
||||
''; |
||||
|
||||
installPhase = '' |
||||
install -Dm755 ./kthxbye -t $out/bin |
||||
''; |
||||
|
||||
passthru.tests = { |
||||
kthxbye = nixosTests.kthxbye; |
||||
}; |
||||
|
||||
meta = with lib; { |
||||
description = "Prometheus Alertmanager alert acknowledgement management daemon"; |
||||
homepage = "https://github.com/prymitive/kthxbye"; |
||||
license = licenses.asl20; |
||||
maintainers = with maintainers; [ nukaduka ]; |
||||
}; |
||||
} |
@ -0,0 +1,36 @@ |
||||
{ lib, stdenvNoCC, fetchFromGitHub, makeWrapper, jq, glow }: |
||||
|
||||
stdenvNoCC.mkDerivation rec { |
||||
pname = "xdg-ninja"; |
||||
version = "0.2.0.1"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "b3nj5m1n"; |
||||
repo = "xdg-ninja"; |
||||
rev = "v${version}"; |
||||
sha256 = "sha256-ZyqxMlyCB8gEsZTVrxgLdW/mQ/4xeTHTK+lDKIzYs6I="; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ makeWrapper ]; |
||||
|
||||
installPhase = '' |
||||
runHook preInstall |
||||
install -Dm755 xdg-ninja.sh "$out/share/xdg-ninja/xdg-ninja.sh" |
||||
install -Dm644 programs/* -t "$out/share/xdg-ninja/programs" |
||||
|
||||
mkdir -p "$out/bin" |
||||
ln -s "$out/share/xdg-ninja/xdg-ninja.sh" "$out/bin/xdg-ninja" |
||||
|
||||
wrapProgram "$out/bin/xdg-ninja" \ |
||||
--prefix PATH : "${lib.makeBinPath [ glow jq ]}" |
||||
runHook postInstall |
||||
''; |
||||
|
||||
meta = with lib; { |
||||
description = "A shell script which checks your $HOME for unwanted files and directories"; |
||||
homepage = "https://github.com/b3nj5m1n/xdg-ninja"; |
||||
license = licenses.mit; |
||||
platforms = platforms.all; |
||||
maintainers = with maintainers; [ patricksjackson ]; |
||||
}; |
||||
} |
@ -0,0 +1,62 @@ |
||||
{ lib |
||||
, stdenv |
||||
, fetchFromGitHub |
||||
, python3 |
||||
}: |
||||
|
||||
python3.pkgs.buildPythonApplication rec { |
||||
pname = "gallia"; |
||||
version = "1.0.3"; |
||||
format = "pyproject"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "Fraunhofer-AISEC"; |
||||
repo = pname; |
||||
rev = "refs/tags/v${version}"; |
||||
hash = "sha256-CoZ3niGuEjcaSyIGc0MIy95v64nTbhgqW/0uz4a/f1o="; |
||||
}; |
||||
|
||||
nativeBuildInputs = with python3.pkgs; [ |
||||
poetry-core |
||||
]; |
||||
|
||||
propagatedBuildInputs = with python3.pkgs; [ |
||||
aiofiles |
||||
aiohttp |
||||
aiosqlite |
||||
argcomplete |
||||
can |
||||
construct |
||||
msgspec |
||||
pydantic |
||||
tabulate |
||||
tomlkit |
||||
xdg |
||||
zstandard |
||||
]; |
||||
|
||||
checkInputs = with python3.pkgs; [ |
||||
pytestCheckHook |
||||
]; |
||||
|
||||
postPatch = '' |
||||
substituteInPlace pyproject.toml \ |
||||
--replace 'zstandard = "^0.17.0"' 'zstandard = "*"' |
||||
''; |
||||
|
||||
pythonImportsCheck = [ |
||||
"gallia" |
||||
]; |
||||
|
||||
preCheck = '' |
||||
export PATH=$out/bin:$PATH |
||||
''; |
||||
|
||||
meta = with lib; { |
||||
description = "Pentesting framework with the focus on the automotive domain"; |
||||
homepage = "https://github.com/Fraunhofer-AISEC/gallia"; |
||||
license = with licenses; [ asl20 ]; |
||||
maintainers = with maintainers; [ fab ]; |
||||
broken = stdenv.isDarwin; |
||||
}; |
||||
} |
@ -0,0 +1,26 @@ |
||||
{ lib, rustPlatform, fetchCrate, installShellFiles }: |
||||
|
||||
rustPlatform.buildRustPackage rec { |
||||
pname = "scraper"; |
||||
version = "0.13.0"; |
||||
|
||||
src = fetchCrate { |
||||
inherit pname version; |
||||
sha256 = "sha256-5fFO51I6DqH1BBELt9FW2BCwYcsXVXaQLgocMn446Bs="; |
||||
}; |
||||
|
||||
cargoSha256 = "sha256-Y4m7C7v4ekJfb3BoWwDF+X8uuRH9muaTwPECgu4WaMQ="; |
||||
|
||||
nativeBuildInputs = [ installShellFiles ]; |
||||
|
||||
postInstall = '' |
||||
installManPage scraper.1 |
||||
''; |
||||
|
||||
meta = with lib; { |
||||
description = "A tool to query HTML files with CSS selectors"; |
||||
homepage = "https://github.com/causal-agent/scraper"; |
||||
license = licenses.isc; |
||||
maintainers = with maintainers; [ figsoda ]; |
||||
}; |
||||
} |
@ -0,0 +1,25 @@ |
||||
{ lib |
||||
, fetchFromGitHub |
||||
, rustPlatform |
||||
}: |
||||
|
||||
rustPlatform.buildRustPackage rec { |
||||
pname = "uefi-run"; |
||||
version = "0.5.0"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "Richard-W"; |
||||
repo = pname; |
||||
rev = "v${version}"; |
||||
sha256 = "sha256-fwzWdOinW/ECVI/65pPB1shxPdl2nZThAqlg8wlWg/g="; |
||||
}; |
||||
|
||||
cargoSha256 = "sha256-c+wzMzTkG0FpfQ1rZ8e9dn0ez12vmoecrtNeFk90sdQ="; |
||||
|
||||
meta = with lib; { |
||||
description = "Directly run UEFI applications in qemu"; |
||||
homepage = "https://github.com/Richard-W/uefi-run"; |
||||
license = licenses.mit; |
||||
maintainers = [ maintainers.maddiethecafebabe ]; |
||||
}; |
||||
} |
Loading…
Reference in new issue