diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/filesystems/dwarfs')
-rw-r--r-- | nixpkgs/pkgs/tools/filesystems/dwarfs/default.nix | 101 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/filesystems/dwarfs/version_info.patch | 58 |
2 files changed, 159 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/filesystems/dwarfs/default.nix b/nixpkgs/pkgs/tools/filesystems/dwarfs/default.nix new file mode 100644 index 000000000000..e5804f378529 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/dwarfs/default.nix @@ -0,0 +1,101 @@ +{ lib +, fetchFromGitHub +, stdenv +, substituteAll + +, bison +, boost +, cmake +, double-conversion +, fmt +, fuse3 +, glog +, gtest +, jemalloc +, libarchive +, libevent +, libunwind +, lz4 +, openssl +, pkg-config +, ronn +, xxHash +, utf8cpp +, zstd +}: + +stdenv.mkDerivation rec { + pname = "dwarfs"; + version = "0.7.2"; + + src = fetchFromGitHub { + owner = "mhx"; + repo = "dwarfs"; + rev = "v${version}"; + fetchSubmodules = true; + hash = "sha256-DcPRrATI2cpLZWAL+sSCoXvJ1R0O3yHqhlJW1aEpDpA="; + }; + + patches = [ + (with lib.versions; substituteAll { + src = ./version_info.patch; + + versionFull = version; # displayed as version number (with v prepended) + versionMajor = major version; + versionMinor = minor version; + versionPatch = patch version; + }) + ]; + + cmakeFlags = [ + "-DPREFER_SYSTEM_ZSTD=ON" + "-DPREFER_SYSTEM_XXHASH=ON" + "-DPREFER_SYSTEM_GTEST=ON" + "-DPREFER_SYSTEM_LIBFMT=ON" + + # may be added under an option in the future + # "-DWITH_LEGACY_FUSE=ON" + "-DWITH_TESTS=ON" + ]; + + nativeBuildInputs = [ + bison + cmake + pkg-config + ronn + ]; + + buildInputs = [ + # dwarfs + boost + fmt + fuse3 + jemalloc + libarchive + lz4 + xxHash + utf8cpp + zstd + + # folly + double-conversion + glog + libevent + libunwind + openssl + ]; + + doCheck = true; + nativeCheckInputs = [ gtest ]; + # these fail inside of the sandbox due to missing access + # to the FUSE device + GTEST_FILTER = "-dwarfs/tools_test.end_to_end/*:dwarfs/tools_test.mutating_ops/*"; + + meta = with lib; { + description = "A fast high compression read-only file system"; + homepage = "https://github.com/mhx/dwarfs"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ keksbg ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/dwarfs/version_info.patch b/nixpkgs/pkgs/tools/filesystems/dwarfs/version_info.patch new file mode 100644 index 000000000000..8d62bd8d2295 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/dwarfs/version_info.patch @@ -0,0 +1,58 @@ +diff --git a/cmake/package_version.cmake b/cmake/package_version.cmake +new file mode 100644 +index 0000000..d4fdb9c +--- /dev/null ++++ b/cmake/package_version.cmake +@@ -0,0 +1,12 @@ ++# autogenerated code, do not modify ++ ++set(PRJ_GIT_REV "v@versionFull@") ++set(PRJ_GIT_DESC "v@versionFull@") ++set(PRJ_GIT_BRANCH "HEAD") ++set(PRJ_GIT_ID "v@versionFull@") ++set(PRJ_GIT_RELEASE_TAG "v@versionFull@") ++set(PRJ_VERSION_FULL "@versionFull@") ++set(PRJ_VERSION_SHORT "@versionFull@") ++set(PRJ_VERSION_MAJOR "@versionMajor@") ++set(PRJ_VERSION_MINOR "@versionMinor@") ++set(PRJ_VERSION_PATCH "@versionPatch@") +diff --git a/include/dwarfs/version.h b/include/dwarfs/version.h +new file mode 100644 +index 0000000..54cf86a +--- /dev/null ++++ b/include/dwarfs/version.h +@@ -0,0 +1,16 @@ ++// autogenerated code, do not modify ++ ++#pragma once ++ ++#define PRJ_VERSION_MAJOR @versionMajor@ ++#define PRJ_VERSION_MINOR @versionMinor@ ++#define PRJ_VERSION_PATCH @versionPatch@ ++ ++namespace dwarfs { ++ ++extern char const* PRJ_GIT_REV; ++extern char const* PRJ_GIT_DESC; ++extern char const* PRJ_GIT_BRANCH; ++extern char const* PRJ_GIT_ID; ++ ++} // namespace dwarfs +diff --git a/src/dwarfs/version.cpp b/src/dwarfs/version.cpp +new file mode 100644 +index 0000000..5759120 +--- /dev/null ++++ b/src/dwarfs/version.cpp +@@ -0,0 +1,12 @@ ++// autogenerated code, do not modify ++ ++#include "dwarfs/version.h" ++ ++namespace dwarfs { ++ ++char const* PRJ_GIT_REV = "@versionFull@"; ++char const* PRJ_GIT_DESC = "v@versionFull@"; ++char const* PRJ_GIT_BRANCH = "HEAD"; ++char const* PRJ_GIT_ID = "v@versionFull@"; ++ ++} // namespace dwarfs |