Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix #12

Closed
wants to merge 1 commit into from
Closed

nix #12

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
description = "provides the libvfn package for NixOS and Nix environments";

Check failure on line 3 in flake.nix

View workflow job for this annotation

GitHub Actions / check-patch

trailing whitespace
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";

};

outputs = { self, nixpkgs }:
let
# lists supported systems
allSystems = [
"x86_64-linux"
"aarch64-linux"
];

forAllSystems = fn:
nixpkgs.lib.genAttrs allSystems
(system: fn { pkgs = import nixpkgs { inherit system; };});

Check failure on line 20 in flake.nix

View workflow job for this annotation

GitHub Actions / check-patch

trailing whitespace
in {
packages = forAllSystems ({ pkgs }: {
libvfn = pkgs.callPackage ./nix/packages/libvfn { };
});
};
}
23 changes: 23 additions & 0 deletions nix/packages/libvfn/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ stdenv, fetchFromGitHub, pkg-config, meson, ninja, perl }:

stdenv.mkDerivation rec {
pname = "libvfn";
version = "4.0.1";

src = fetchFromGitHub {
owner = "SamsungDS";
repo = "libvfn";
rev = "v${version}";
hash = "sha256-/XOSD4S/Jr8ohltahMTiFF18njt341Uq2ZZjgV+y9Pg=";
};

patches = [ ./trace_pl_pathfix.patch ];

mesonFlags = [
"-Ddocs=disabled"
"-Dlibnvme=disabled"
"-Dprofiling=false"
];

nativeBuildInputs = [ meson ninja pkg-config perl ];
}
39 changes: 39 additions & 0 deletions nix/packages/libvfn/trace_pl_pathfix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/include/vfn/trace/meson.build b/include/vfn/trace/meson.build
index 738a099..614383c 100644
--- a/include/vfn/trace/meson.build
+++ b/include/vfn/trace/meson.build
@@ -2,7 +2,7 @@ trace_events_h = custom_target('trace events header',
input: meson.project_source_root() / get_option('trace-events-file'),
output: 'events.h',
capture: true,
- command: [trace_pl, '--mode', 'header', '@INPUT@'],
+ command: [perl, trace_pl, '--mode', 'header', '@INPUT@'],
install: true,
install_dir: get_option('includedir') / 'vfn/trace',
)
diff --git a/meson.build b/meson.build
index 7ead082..a622253 100644
--- a/meson.build
+++ b/meson.build
@@ -34,7 +34,7 @@ endif
##

Check failure on line 20 in nix/packages/libvfn/trace_pl_pathfix.patch

View workflow job for this annotation

GitHub Actions / check-patch

trailing whitespace
perl = find_program('perl')
-trace_pl = find_program('scripts/trace.pl')
+trace_pl = meson.current_source_dir() / 'scripts' / 'trace.pl'

Check failure on line 24 in nix/packages/libvfn/trace_pl_pathfix.patch

View workflow job for this annotation

GitHub Actions / check-patch

trailing whitespace
##
## Compiler Configuration
diff --git a/src/trace/meson.build b/src/trace/meson.build
index 3569cf8..7c3f093 100644
--- a/src/trace/meson.build
+++ b/src/trace/meson.build
@@ -2,7 +2,7 @@ trace_events_c = custom_target('trace events source',
input: meson.project_source_root() / get_option('trace-events-file'),
output: 'events.c',
capture: true,
- command: [trace_pl, '--mode', 'source', '@INPUT@'],
+ command: [perl, trace_pl, '--mode', 'source', '@INPUT@'],
)

Check failure on line 38 in nix/packages/libvfn/trace_pl_pathfix.patch

View workflow job for this annotation

GitHub Actions / check-patch

trailing whitespace
trace_sources += trace_events_c
Loading