From abd767dce92b543b4a3ce979a36331897f0f457a Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Sat, 9 Jan 2021 16:42:10 +0100 Subject: [PATCH] target-isns: init at 0.6.8 --- .../os-specific/linux/target-isns/default.nix | 36 +++++++++++++++++++ .../target-isns/install_prefix_path.patch | 17 +++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 55 insertions(+) create mode 100644 pkgs/os-specific/linux/target-isns/default.nix create mode 100644 pkgs/os-specific/linux/target-isns/install_prefix_path.patch diff --git a/pkgs/os-specific/linux/target-isns/default.nix b/pkgs/os-specific/linux/target-isns/default.nix new file mode 100644 index 000000000000..32e0669ed543 --- /dev/null +++ b/pkgs/os-specific/linux/target-isns/default.nix @@ -0,0 +1,36 @@ +{ stdenv, cmake, fetchFromGitHub, fetchpatch } : + +stdenv.mkDerivation rec { + pname = "target-isns"; + version = "0.6.8"; + + src = fetchFromGitHub { + owner = "open-iscsi"; + repo = pname; + rev = "v${version}"; + sha256 = "1b6jjalvvkkjyjbg1pcgk8vmvc6xzzksyjnh2pfi45bbpya4zxim"; + }; + + patches = [ + # fix absoulute paths + ./install_prefix_path.patch + + # fix gcc 10 compiler warning, remove with next update + (fetchpatch { + url = "https://github.com/open-iscsi/target-isns/commit/3d0c47dd89bcf83d828bcc22ecaaa5f58d78b58e.patch"; + sha256 = "1x2bkc1ff15621svhpq1r11m0q4ajv0j4fng6hm7wkkbr2s6d1vx"; + }) + ]; + + cmakeFlags = [ "-DSUPPORT_SYSTEMD=ON" ]; + + nativeBuildInputs = [ cmake ]; + + meta = with stdenv.lib; { + description = "iSNS client for the Linux LIO iSCSI target"; + homepage = "https://github.com/open-iscsi/target-isns"; + maintainers = [ maintainers.markuskowa ]; + license = licenses.gpl2Only; + platforms = platforms.linux; + }; +} diff --git a/pkgs/os-specific/linux/target-isns/install_prefix_path.patch b/pkgs/os-specific/linux/target-isns/install_prefix_path.patch new file mode 100644 index 000000000000..f98fc21b7a24 --- /dev/null +++ b/pkgs/os-specific/linux/target-isns/install_prefix_path.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f46144d..aeac3e4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,10 +14,10 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") + option(SUPPORT_SYSTEMD "Support service control via systemd" OFF) + + add_subdirectory(src) +-install(FILES target-isns.conf DESTINATION /etc/) ++install(FILES target-isns.conf DESTINATION ${CMAKE_INSTALL_PREFIX}/etc/) + install(FILES target-isns.8 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man8/) + if (SUPPORT_SYSTEMD) +- install(FILES target-isns.service DESTINATION /usr/lib/systemd/system/) ++ install(FILES target-isns.service DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/system/) + endif (SUPPORT_SYSTEMD) + + add_subdirectory(tests) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 19d5b9260f6c..9ccd67a25dc3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7786,6 +7786,8 @@ in targetcli = callPackage ../os-specific/linux/targetcli { }; + target-isns = callPackage ../os-specific/linux/target-isns { }; + tarsnap = callPackage ../tools/backup/tarsnap { }; tarsnapper = callPackage ../tools/backup/tarsnapper { };