···4041:::
420000000000000000000043## `lycheeLinkCheck` {#tester-lycheeLinkCheck}
4445Check a packaged static site's links with the [`lychee` package](https://search.nixos.org/packages?show=lychee&type=packages&query=lychee).
···4041:::
4243+## `hasCmakeConfigModules` {#tester-hasCmakeConfigModules}
44+45+Checks whether a package exposes a given list of `*config.cmake` modules.
46+Note the moduleNames used in cmake find_package are case sensitive.
47+48+:::{.example #ex-hascmakeconfigmodules}
49+50+# Check that `*config.cmake` modules are exposed using explicit module names
51+52+```nix
53+{
54+ passthru.tests.cmake-config = testers.hasCmakeConfigModules {
55+ package = finalAttrs.finalPackage;
56+ moduleNames = [ "Foo" ];
57+ };
58+}
59+```
60+61+:::
62+63## `lycheeLinkCheck` {#tester-lycheeLinkCheck}
6465Check a packaged static site's links with the [`lychee` package](https://search.nixos.org/packages?show=lychee&type=packages&query=lychee).
···20 # Test_EventFilters/trace_only_events_from_"dockerd"_binary_and_contain_it's_pid
21 # require docker/dockerd
22 virtualisation.docker.enable = true;
23-24- environment.systemPackages = with pkgs; [
25- # required by Test_EventFilters/trace_events_from_ls_and_which_binary_in_separate_scopes
26- which
27- # the go integration tests as a binary
28- tracee.passthru.tests.integration-test-cli
29- ];
0030 };
31 };
32···38 # the policies and run tracee myself but doesn't work in the integration
39 # test either with the automatic run or running the commands by hand
40 # while it's searching.
41- "Test_EventFilters/comm:_event:_args:_trace_event_set_in_a_specific_policy_with_args_from_ls_command"
0000042 "Test_EventFilters/comm:_event:_trace_events_set_in_two_specific_policies_from_ls_and_uname_commands"
43-44- # worked at some point, seems to be flakey
45- "Test_EventFilters/pid:_event:_args:_trace_event_sched_switch_with_args_from_pid_0"
0046 ];
47 in
48 ''
···61 )
6263 with subtest("run integration tests"):
64- # Test_EventFilters/trace_event_set_in_a_specific_scope expects to be in a dir that includes "integration"
65 # tests must be ran with 1 process
66 print(machine.succeed(
67 'mkdir /tmp/integration',
68- 'cd /tmp/integration && export PATH="/tmp/testdir:$PATH" && integration.test -test.v -test.parallel 1 -test.skip="^${builtins.concatStringsSep "$|^" skippedTests}$"'
69 ))
70 '';
71 }
···20 # Test_EventFilters/trace_only_events_from_"dockerd"_binary_and_contain_it's_pid
21 # require docker/dockerd
22 virtualisation.docker.enable = true;
23+ environment = {
24+ variables.PATH = "/tmp/testdir";
25+ systemPackages = with pkgs; [
26+ # 'ls', 'uname' and 'who' are required by many tests in event_filters_test.go
27+ coreutils
28+ # the go integration tests as a binary
29+ tracee.passthru.tests.integration-test-cli
30+ ];
31+ };
32 };
33 };
34···40 # the policies and run tracee myself but doesn't work in the integration
41 # test either with the automatic run or running the commands by hand
42 # while it's searching.
43+ "Test_EventFilters/comm:_event:_data:_trace_event_magic_write_set_in_multiple_policies_using_multiple_filter_types"
44+ "Test_EventFilters/comm:_event:_data:_trace_event_security_file_open_and_magic_write_using_multiple_filter_types"
45+ "Test_EventFilters/comm:_event:_data:_trace_event_security_file_open_and_magic_write_using_multiple_filter_types_combined"
46+ "Test_EventFilters/comm:_event:_data:_trace_event_security_file_open_set_in_multiple_policies_\\(with_and_without_in-kernel_filter\\)"
47+ "Test_EventFilters/comm:_event:_data:_trace_event_security_file_open_set_in_multiple_policies_using_multiple_filter_types"
48+ "Test_EventFilters/comm:_event:_data:_trace_event_set_in_a_specific_policy_with_data_from_ls_command"
49 "Test_EventFilters/comm:_event:_trace_events_set_in_two_specific_policies_from_ls_and_uname_commands"
50+ "Test_EventFilters/pid:_event:_data:_trace_event_sched_switch_with_data_from_pid_0"
51+ "Test_EventsDependencies/non_existing_ksymbol_dependency_with_sanity"
52+ "Test_EventsDependencies/non_existing_probe_function_with_sanity"
53+ "Test_EventsDependencies/sanity_of_exec_test_event"
54+ "Test_TraceeCapture/capture_packet_context"
55 ];
56 in
57 ''
···70 )
7172 with subtest("run integration tests"):
73+ # Test_EventFilters/comm:_event:_data:_trace_event_set_in_a_specific_policy_with_data_from_ls_command expects to be in a dir that includes "integration"
74 # tests must be ran with 1 process
75 print(machine.succeed(
76 'mkdir /tmp/integration',
77+ 'cd /tmp/integration && integration.test -test.v -test.parallel 1 -test.skip="^${builtins.concatStringsSep "$|^" skippedTests}$"'
78 ))
79 '';
80 }
···1+# Static arguments
2+{
3+ lib,
4+ runCommandCC,
5+ cmake,
6+}:
7+8+# Tester arguments
9+{
10+ package,
11+ moduleNames,
12+ # Extra nativeBuildInputs needed to pass the cmake find_package test, e.g. pkg-config.
13+ nativeBuildInputs ? [ ],
14+ # buildInputs is used to help pass the cmake find_package test.
15+ # The purpose of buildInputs here is to allow us to iteratively add
16+ # any missing dependencies required by the *Config.cmake module
17+ # during testing. This allows us to test and fix the CMake setup
18+ # without rebuilding the finalPackage each time. Once all required
19+ # packages are properly added to the finalPackage's propagateBuildInputs,
20+ # this buildInputs should be set to an empty list [].
21+ buildInputs ? [ ],
22+ # Extra cmakeFlags needed to pass the cmake find_package test.
23+ # Can be used to set verbose/debug flags.
24+ cmakeFlags ? [ ],
25+ testName ? "check-cmake-config-${package.pname or package.name}",
26+ version ? package.version or null,
27+ versionCheck ? false,
28+}:
29+30+runCommandCC testName
31+ {
32+ inherit moduleNames versionCheck cmakeFlags;
33+ version = if versionCheck then version else null;
34+ nativeBuildInputs = [
35+ cmake
36+ ] ++ nativeBuildInputs;
37+ buildInputs = [ package ] ++ buildInputs;
38+ meta =
39+ {
40+ description = "Test whether ${package.name} exposes cmake-config modules ${lib.concatStringsSep ", " moduleNames}";
41+ }
42+ # Make sure licensing info etc is preserved, as this is a concern for e.g. cache.nixos.org,
43+ # as hydra can't check this meta info in dependencies.
44+ # The test itself is just Nixpkgs, with MIT license.
45+ // builtins.intersectAttrs {
46+ available = throw "unused";
47+ broken = throw "unused";
48+ insecure = throw "unused";
49+ license = throw "unused";
50+ maintainers = throw "unused";
51+ teams = throw "unused";
52+ platforms = throw "unused";
53+ unfree = throw "unused";
54+ unsupported = throw "unused";
55+ } package.meta;
56+ }
57+ ''
58+ touch "$out"
59+ notFound=0
60+ for moduleName in $moduleNames; do
61+ echo "checking cmake-config module $moduleName"
62+63+ cat <<EOF > CMakeLists.txt
64+ cmake_minimum_required(VERSION 3.14)
65+ project(CheckCmakeModule)
66+67+ find_package($moduleName $version EXACT NO_MODULE REQUIRED)
68+ EOF
69+70+ echoCmd 'cmake flags' $cmakeFlags
71+ set +e
72+ cmake . $cmakeFlags
73+ r=$?
74+ set -e
75+ if [[ $r = 0 ]]; then
76+ echo "✅ cmake-config module $moduleName exists"
77+ else
78+ echo "❌ cmake-config module $moduleName was not found"
79+ ((notFound+=1))
80+ fi
81+ done
82+83+ if [[ $notFound -ne 0 ]]; then
84+ exit 1
85+ fi
86+ ''
···89stdenv.mkDerivation (finalAttrs: {
10 pname = "game-devices-udev-rules";
11- version = "0.23";
1213 src = fetchFromGitea {
14 domain = "codeberg.org";
15 owner = "fabiscafe";
16 repo = "game-devices-udev";
17- rev = finalAttrs.version;
18- hash = "sha256-dWWo3qXnxdLP68NuFKM4/Cw5yE6uAsWzj0vZa9UTT0U=";
19 };
2021 nativeBuildInputs = [
···30 --replace-fail "/bin/sh" "${bash}/bin/bash"
31 '';
3233- meta = with lib; {
34 description = "Udev rules to make supported controllers available with user-grade permissions";
35 homepage = "https://codeberg.org/fabiscafe/game-devices-udev";
36- license = licenses.mit;
37 longDescription = ''
38 These udev rules are intended to be used as a package under 'services.udev.packages'.
39 They will not be activated if installed as 'environment.systemPackages' or 'users.user.<user>.packages'.
4041 Additionally, you may need to enable 'hardware.uinput'.
42 '';
43- platforms = platforms.linux;
44- maintainers = with maintainers; [ keenanweaver ];
45 };
46})
···89stdenv.mkDerivation (finalAttrs: {
10 pname = "game-devices-udev-rules";
11+ version = "0.24";
1213 src = fetchFromGitea {
14 domain = "codeberg.org";
15 owner = "fabiscafe";
16 repo = "game-devices-udev";
17+ tag = finalAttrs.version;
18+ hash = "sha256-b2NBgGpRQ2pQZYQgiRSAt0loAxq1NEByRHVkQQRDOj0=";
19 };
2021 nativeBuildInputs = [
···30 --replace-fail "/bin/sh" "${bash}/bin/bash"
31 '';
3233+ meta = {
34 description = "Udev rules to make supported controllers available with user-grade permissions";
35 homepage = "https://codeberg.org/fabiscafe/game-devices-udev";
36+ license = lib.licenses.mit;
37 longDescription = ''
38 These udev rules are intended to be used as a package under 'services.udev.packages'.
39 They will not be activated if installed as 'environment.systemPackages' or 'users.user.<user>.packages'.
4041 Additionally, you may need to enable 'hardware.uinput'.
42 '';
43+ platforms = lib.platforms.linux;
44+ maintainers = with lib.maintainers; [ keenanweaver ];
45 };
46})
···910buildGoModule rec {
11 pname = "gokapi";
12- version = "1.9.6";
1314 src = fetchFromGitHub {
15 owner = "Forceu";
16 repo = "Gokapi";
17 tag = "v${version}";
18- hash = "sha256-RDEvKh3tUun7wt1nhtCim95wEN9V9RlztZ9zcw9nS1o=";
19 };
2021- vendorHash = "sha256-9GRAlgng+yq7q0VQz374jIOCjeDIIDD631BglM/FsQQ=";
2223- patches = [
24- ./go-1.24.patch
25- ];
2627 # This is the go generate is ran in the upstream builder, but we have to run the components separately for things to work.
28 preBuild = ''
00029 cd ./cmd/gokapi/
30 go run ../../build/go-generate/updateVersionNumbers.go
31- # Tries to download "golang.org/x/exp/slices"
32 # go run ../../build/go-generate/updateProtectedUrls.go
33 go run ../../build/go-generate/buildWasm.go
34- # Must be specify go root to import wasm_exec.js
35- GOROOT="$(go env GOROOT)" go run "../../build/go-generate/copyStaticFiles.go"
0036 cd ../..
37 '';
38
···910buildGoModule rec {
11 pname = "gokapi";
12+ version = "2.0.0";
1314 src = fetchFromGitHub {
15 owner = "Forceu";
16 repo = "Gokapi";
17 tag = "v${version}";
18+ hash = "sha256-YhUHi1tR2bCFskBbAlFekuFzfZ2ER9G+TNCcfh5loS4=";
19 };
2021+ vendorHash = "sha256-GeS+lfFw7jUuXX1qQPiu9eKjz6nswpRtbZXjqu4DnHg=";
2223+ patches = [ ];
002425 # This is the go generate is ran in the upstream builder, but we have to run the components separately for things to work.
26 preBuild = ''
27+ # Some steps expect GOROOT to be set.
28+ export GOROOT="$(go env GOROOT)"
29+ # Go generate runs from this working dir upstream
30 cd ./cmd/gokapi/
31 go run ../../build/go-generate/updateVersionNumbers.go
32+ # Tries to download "golang.org/x/exp/slices", and fails
33 # go run ../../build/go-generate/updateProtectedUrls.go
34 go run ../../build/go-generate/buildWasm.go
35+ go run ../../build/go-generate/copyStaticFiles.go
36+ # Attempts to download program to minify content, and fails
37+ # go run ../../build/go-generate/minifyStaticContent.go
38+ go run ../../build/go-generate/updateApiRouting.go
39 cd ../..
40 '';
41
···1{
2 lib,
3+ # gopls breaks if it is compiled with a lower version than the one it is running against.
4+ # This will affect users especially when project they work on bump go minor version before
5+ # the update went through nixpkgs staging. Further, gopls is a central ecosystem component.
6+ buildGoLatestModule,
7 fetchFromGitHub,
8 nix-update-script,
9 versionCheckHook,
10}:
1112+buildGoLatestModule (finalAttrs: {
13 pname = "gopls";
14 version = "0.18.1";
15
···1+diff --git a/CMakeLists.txt b/CMakeLists.txt
2+index d0e35b6..fc19477 100644
3+--- a/CMakeLists.txt
4++++ b/CMakeLists.txt
5+@@ -96,20 +96,6 @@ endif()
6+ # set the path where we can find the findXXX.cmake
7+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
8+9+-if(APPLE)
10+-
11+- # avoid the cmake policy warning about @rpath in MacOSX
12+- cmake_policy(SET CMP0042 NEW)
13+-
14+- SET(CMAKE_MACOSX_RPATH TRUE) # initialize the MACOSX_RPATH property on all targets
15+- SET(CMAKE_SKIP_BUILD_RPATH FALSE) # don't skip the full RPATH for the build tree
16+- # SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) # when building, don't use the install RPATH already
17+- SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) # when building, use the install RPATH already
18+- # probably not needed
19+- # SET(CMAKE_INSTALL_RPATH "") # the RPATH to be used when installing
20+- SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # LC_RPATH for CUDA and OpenCV etc written into executable
21+-endif(APPLE)
22+-
23+ # FIND BOOST
24+ set(BOOST_REQUIRED_COMPONENTS "atomic;chrono;date_time;filesystem;program_options;serialization;system;thread;timer;math_c99")
25+ if(WIN32)
26+