diff --git a/pkgs/development/libraries/elfio/default.nix b/pkgs/development/libraries/elfio/default.nix new file mode 100644 index 000000000000..98e9ee3f59ed --- /dev/null +++ b/pkgs/development/libraries/elfio/default.nix @@ -0,0 +1,34 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, boost +}: + +stdenv.mkDerivation rec { + pname = "elfio"; + version = "3.9"; + + src = fetchFromGitHub { + owner = "serge1"; + repo = "elfio"; + rev = "Release_${version}"; + sha256 = "sha256-5O9KnHZXzepp3O1PGenJarrHElWLHgyBvvDig1Hkmo4="; + }; + + nativeBuildInputs = [ cmake ]; + + checkInputs = [ boost ]; + + cmakeFlags = [ "-DELFIO_BUILD_TESTS=ON" ]; + + doCheck = true; + + meta = with lib; { + description = "Header-only C++ library for reading and generating files in the ELF binary format"; + homepage = "https://github.com/serge1/ELFIO"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ prusnak ]; + }; +} diff --git a/pkgs/development/libraries/termcolor/default.nix b/pkgs/development/libraries/termcolor/default.nix new file mode 100644 index 000000000000..3d9458341211 --- /dev/null +++ b/pkgs/development/libraries/termcolor/default.nix @@ -0,0 +1,37 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +}: + +stdenv.mkDerivation rec { + pname = "termcolor"; + version = "2.0.0"; + + src = fetchFromGitHub { + owner = "ikalnytskyi"; + repo = "termcolor"; + rev = "v${version}"; + sha256 = "sha256-W0hB+lFJ2sm7DsbOzITOtjJuntSM55BfwUunOOS4RcA="; + }; + + nativeBuildInputs = [ cmake ]; + + cmakeFlags = [ "-DTERMCOLOR_TESTS=ON" ]; + + doCheck = true; + + checkPhase = '' + runHook preCheck + ./test_termcolor + runHook postCheck + ''; + + meta = with lib; { + description = "Header-only C++ library for printing colored messages"; + homepage = "https://github.com/ikalnytskyi/termcolor"; + license = licenses.bsd3; + platforms = platforms.unix; + maintainers = with maintainers; [ prusnak ]; + }; +} diff --git a/pkgs/development/tools/misc/libtree/default.nix b/pkgs/development/tools/misc/libtree/default.nix new file mode 100644 index 000000000000..f852b7ea7adf --- /dev/null +++ b/pkgs/development/tools/misc/libtree/default.nix @@ -0,0 +1,57 @@ +{ lib +, stdenv +, fetchFromGitHub +, fetchpatch +, binutils +, chrpath +, cmake +, cxxopts +, elfio +, termcolor +, gtest +}: + +stdenv.mkDerivation rec { + pname = "libtree"; + version = "2.0.0"; + + src = fetchFromGitHub { + owner = "haampie"; + repo = "libtree"; + rev = "v${version}"; + sha256 = "sha256-j54fUwMkX4x4MwL8gMraguK9GqQRBjCC+W6ojFnQdHQ="; + }; + + patches = [ + # add missing include + # https://github.com/haampie/libtree/pull/42 + (fetchpatch { + url = "https://github.com/haampie/libtree/commit/219643ff6edcae42c9546b8ba38cfec9d19b034e.patch"; + sha256 = "sha256-vdFmmBdBiOT3QBcwd3SuiolcaFTFAb88kU1KN8229K0="; + }) + ]; + + postPatch = '' + substituteInPlace src/main.cpp \ + --replace "std::string strip = \"strip\";" "std::string strip = \"${binutils}/bin/strip\";" \ + --replace "std::string chrpath = \"chrpath\";" "std::string chrpath = \"${chrpath}/bin/chrpath\";" + ''; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ cxxopts elfio termcolor ]; + + doCheck = true; + + checkInputs = [ gtest ]; + + cmakeFlags = [ "-DLIBTREE_BUILD_TESTS=ON" ]; + + meta = with lib; { + description = "Tree ldd with an option to bundle dependencies into a single folder"; + homepage = "https://github.com/haampie/libtree"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ prusnak rardiol ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c78cc966d243..b91eac47b72a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7343,6 +7343,8 @@ with pkgs; libtins = callPackage ../development/libraries/libtins { }; + libtree = callPackage ../development/tools/misc/libtree { }; + libshout = callPackage ../development/libraries/libshout { }; libqb = callPackage ../development/libraries/libqb { }; @@ -10015,6 +10017,8 @@ with pkgs; telescope = callPackage ../applications/networking/browsers/telescope { }; + termcolor = callPackage ../development/libraries/termcolor { }; + termscp = callPackage ../tools/networking/termscp { inherit (darwin.apple_sdk.frameworks) Foundation Security; }; @@ -16136,6 +16140,8 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Cocoa; }; + elfio = callPackage ../development/libraries/elfio { }; + enchant1 = callPackage ../development/libraries/enchant/1.x.nix { }; enchant2 = callPackage ../development/libraries/enchant/2.x.nix { };