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

tcmu-runner: init at unstable-2022-02-21 #189734

Closed
wants to merge 1 commit into from
Closed
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
73 changes: 73 additions & 0 deletions pkgs/os-specific/linux/tcmu-runner/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{ lib
, stdenv
, ceph
, cmake
, fetchFromGitHub
, glib
, glusterfs
, gperftools
, kmod
, libnl
, pcre
, pkg-config
, util-linuxMinimal
, zlib
, cephSupport ? true
, glusterSupport ? true
, systemdSupport ? true
}:

stdenv.mkDerivation rec {
pname = "tcmu-runner";
version = "unstable-2022-02-21";

src = fetchFromGitHub {
owner = "open-iscsi";
repo = "tcmu-runner";
rev = "364ae611ffdd7c8fb3d1e733563b636bf3b44ba6";
hash = "sha256-SxAkpOzNB7/csEVfC6ptyyxJ8lu3YnRGiZhk4DsJnBA=";
};

postPatch = ''
# fix install paths, as they are currently hardcoded
# see also: https://github.com/open-iscsi/tcmu-runner/issues/683
substituteInPlace CMakeLists.txt \
--replace " /etc" " \''${CMAKE_INSTALL_PREFIX}/etc" \
--replace " /usr/" " \''${CMAKE_INSTALL_PREFIX}/"
for i in *.conf_install.cmake.in; do
substituteInPlace "$i" \
--replace " \"/etc" " \"\''${CMAKE_INSTALL_PREFIX}/etc"
done
for i in *.service; do
substituteInPlace "$i" \
--replace "=/usr/bin/" "=/$out/bin/"
AndersonTorres marked this conversation as resolved.
Show resolved Hide resolved
done
unset i
'';

nativeBuildInputs = [
cmake
pkg-config
];

buildInputs = [
glib
gperftools # for tcmalloc
kmod
libnl
pcre
util-linuxMinimal # for libmount
zlib
] ++ lib.optional cephSupport ceph
++ lib.optional glusterSupport glusterfs;

cmakeFlags = lib.optionals systemdSupport [ "-DSUPPORT_SYSTEMD=ON" ];

meta = with lib; {
description = "A daemon that handles the userspace side of the LIO TCM-User backstore";
homepage = "https://github.com/open-iscsi/tcmu-runner";
maintainers = with maintainers; [ zseri ];
license = with licenses; [ asl20 lgpl21 ];
platforms = platforms.linux;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4715,6 +4715,8 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Security;
};

tcmu-runner = callPackage ../os-specific/linux/tcmu-runner { };

xlogo = callPackage ../tools/X11/xlogo { };

xmlbeans = callPackage ../tools/misc/xmlbeans { };
Expand Down