Skip to content
Merged
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
12 changes: 11 additions & 1 deletion build_scripts/build_spdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Options:
--with-fio <FIO> Use given FIO path
--without-fio Build without FIO
--with-fio-dst <PATH> FIO install destination
--with-unit-tests Enables the unit tests
--log <no|tee*|silent> Output logging options
--no-log Same as "--log no"
-n, --dry-run Dry run
Expand Down Expand Up @@ -247,6 +248,11 @@ function detect_fio() {
#fi
}

function rm_configure_arg() {
arg="$1"
CONFIGURE_ARGS=($(printf "%s\n" "${CONFIGURE_ARGS[@]}" | grep -v "^$arg$"))
}

function cmd_configure() {
#
# Making configure options.
Expand Down Expand Up @@ -513,6 +519,10 @@ do
msg_info "With FIO install destination: $WITH_FIO_DST"
shift
;;
"--with-unit-tests")
rm_configure_arg "--disable-unit-tests"
msg_info "With unit-tests"
;;
"--log")
LOG_MODE=$1
LOG_MODE_EXPLICIT="yes"
Expand All @@ -522,7 +532,7 @@ do
LOG_MODE="no"
LOG_MODE_EXPLICIT="yes"
;;
"-n" | "--dry-run")
"-n" | "-d" | "--dry-run")
DRY_RUN="yes"
msg_info "Dry run is enabled"
;;
Expand Down
1 change: 1 addition & 0 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{}:
final: prev: rec {
fio = prev.callPackage ./pkgs/fio { };
astyle = prev.callPackage ./pkgs/astyle { };
libnvme = prev.callPackage ./pkgs/libnvme { };
nvme-cli = prev.callPackage ./pkgs/nvme-cli { };
libspdk = prev.callPackage ./pkgs/libspdk { with-fio = false; build-type = "release"; };
Expand Down
32 changes: 32 additions & 0 deletions nix/pkgs/astyle/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ stdenv, fetchurl }:

let
name = "astyle";
version = "3.1";
in
stdenv.mkDerivation {
name = "${name}-${version}";

src = fetchurl {
url = "mirror://sourceforge/${name}/${name}_${version}_linux.tar.gz";
sha256 = "1ms54wcs7hg1bsywqwf2lhdfizgbk7qxc9ghasxk8i99jvwlrk6b";
};

sourceRoot =
if stdenv.cc.isClang
then "astyle/build/clang"
else "astyle/build/gcc";

# -s option is obsolete on Darwin and breaks build
postPatch =
if stdenv.isDarwin then ''
substituteInPlace Makefile --replace "LDFLAGSr = -s" "LDFLAGSr ="
'' else null;

installFlags = "INSTALL=install prefix=$$out";

meta = {
homepage = http://astyle.sourceforge.net/;
description = "Source code indenter, formatter, and beautifier for C, C++, C# and Java";
};
}
3 changes: 3 additions & 0 deletions nix/pkgs/libspdk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
, zlib
, rdma-core
, keyutils
, astyle
}:
let
# Suffix for debug build name.
Expand Down Expand Up @@ -111,6 +112,8 @@ let

sourceRoot = spdk.name;

devBuildInputs = [ astyle pkgs.python3Packages.tabulate pkgs.python3Packages.jinja2 ];

nativeBuildInputs = [
cmake
gcc
Expand Down
2 changes: 1 addition & 1 deletion nix/shell/spdk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ let
none = {
drv = null;

buildInputs = with pkgs; libspdk-dev.nativeBuildInputs ++ libspdk-dev.buildInputs;
buildInputs = with pkgs; libspdk-dev.nativeBuildInputs ++ libspdk-dev.buildInputs ++ libspdk-dev.devBuildInputs;

shellEnv = {
CFLAGS = cflagsValue;
Expand Down