File tree 2 files changed +16
-12
lines changed
2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 31
31
, libtool
32
32
, liburing
33
33
, libuuid
34
- , llvmPackages
35
34
, meson
36
35
, nasm
37
36
, ncurses
69
68
else
70
69
"--without-fio" ;
71
70
71
+ # Only set crossPrefix if we're actually cross-compiling
72
+ # (which we aren't, but let's keep the logic).
72
73
crossPrefix =
73
74
if targetPlatform . config != buildPlatform . config then
74
75
"--crossPrefix=${ targetPlatform . config } "
90
91
version = "24.05-${ lib . substring 0 7 rev } " ;
91
92
name = "${ pname } -${ version } " ;
92
93
} ;
94
+
93
95
drvAttrs = rec {
94
96
pname = spdk . pname ;
95
97
version = spdk . version ;
96
98
97
99
src = [
98
100
( fetchFromGitHub {
99
- # Note that this would only rebuild if the first 7 chars differ, but in practice should be fine
100
101
name = spdk . name ;
101
102
owner = "openebs" ;
102
103
repo = "spdk" ;
@@ -113,16 +114,13 @@ let
113
114
cmake
114
115
gcc
115
116
help2man
116
- llvmPackages . bintools
117
- llvmPackages . clang
118
- llvmPackages . libclang
119
117
meson
120
118
ninja
121
119
pkg-config
122
120
procps
123
121
udev
124
122
utillinux
125
- ( python3 . withPackages ( ps : with ps ; [ pyelftools ] ) )
123
+ pkgs . python3Packages . pyelftools
126
124
] ++ extraBuildInputs ;
127
125
128
126
buildInputs = [
158
156
enableParallelBuilding = true ;
159
157
hardeningDisable = [ "all" ] ;
160
158
161
- #
162
- # Phases.
163
- #
159
+ # Our phases
164
160
prePatch = ''
165
161
pushd ..
166
162
chmod -R u+w build_scripts
181
177
'' ;
182
178
} ;
183
179
in
184
- llvmPackages . stdenv . mkDerivation drvAttrs
180
+ pkgs . stdenv . mkDerivation drvAttrs
Original file line number Diff line number Diff line change 18
18
echo "FIO path : $FIO"
19
19
'' ;
20
20
21
+ # Determine the system architecture
22
+ system = builtins . currentSystem ;
23
+
24
+ # Define CFLAGS based on the architecture
25
+ cflagsValue = if system == "aarch64-linux"
26
+ then "-march=armv8-a"
27
+ else "-msse4" ;
28
+
21
29
# spdk-path argument overrides spdk argument.
22
30
spdkCfg = if spdk-path != null then "none" else spdk ;
23
31
63
71
} ;
64
72
65
73
# Do not use Nix libspdk. User must provide SPDK.
66
- # Build environment for development libspdk packahe is provided.
74
+ # Build environment for development libspdk package is provided.
67
75
none = {
68
76
drv = null ;
69
77
70
78
buildInputs = with pkgs ; libspdk-dev . nativeBuildInputs ++ libspdk-dev . buildInputs ;
71
79
72
80
shellEnv = {
73
- CFLAGS = "-msse4" ;
81
+ CFLAGS = cflagsValue ;
74
82
SPDK_RS_BUILD_USE_LOGS = "yes" ; # Tells spdk-rs build.rs script to rerun when build_logs dir is updated.
75
83
} ;
76
84
You can’t perform that action at this time.
0 commit comments