diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 3f2a0fe8246..8eac070f26c 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -6697,6 +6697,15 @@ githubId = 37185887; name = "Calvin Kim"; }; + keksbg = { + email = "keksbg@riseup.net"; + name = "Stella"; + github = "keksbg"; + githubId = 10682187; + keys = [{ + fingerprint = "AB42 1F18 5A19 A160 AD77 9885 3D6D CA5B 6F2C 2A7A"; + }]; + }; keldu = { email = "mail@keldu.de"; github = "keldu"; diff --git a/pkgs/tools/filesystems/dwarfs/default.nix b/pkgs/tools/filesystems/dwarfs/default.nix new file mode 100644 index 00000000000..22b29b5ed27 --- /dev/null +++ b/pkgs/tools/filesystems/dwarfs/default.nix @@ -0,0 +1,103 @@ +{ lib +, fetchFromGitHub +, stdenv +, substituteAll + +, bison +, boost +, cmake +, double-conversion +, fmt_8 +, fuse3 +, gflags +, glog +, gtest +, jemalloc +, libarchive +, libevent +, libunwind +, lz4 +, openssl +, pkg-config +, ronn +, xxHash +, zstd +}: + +stdenv.mkDerivation rec { + pname = "dwarfs"; + version = "0.6.1"; + + src = fetchFromGitHub { + owner = "mhx"; + repo = "dwarfs"; + rev = "v${version}"; + fetchSubmodules = true; + sha256 = "sha256-bGJkgcq8JxueRTX08QpJv1A0O5wXbiIgUY7BrY0Ln/M="; + }; + + patches = with lib.versions; [ + (substituteAll { + src = ./version_info.patch; + + gitRev = "v${version}"; + gitDesc = "v${version}"; + gitBranch = "v${version}"; + gitId = "v${version}"; # displayed as version number + + versionMajor = major version; + versionMinor = minor version; + versionPatch = patch version; + }) + ]; + + cmakeFlags = [ + "-DPREFER_SYSTEM_ZSTD=ON" + "-DPREFER_SYSTEM_XXHASH=ON" + "-DPREFER_SYSTEM_GTEST=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_8 + fuse3 + jemalloc + libarchive + lz4 + xxHash + zstd + + # folly + double-conversion + glog + libevent + libunwind + openssl + ]; + + doCheck = true; + checkInputs = [ gtest ]; + # this fails inside of the sandbox due to missing access + # to the FUSE device + GTEST_FILTER = "-tools.everything"; + + 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/pkgs/tools/filesystems/dwarfs/version_info.patch b/pkgs/tools/filesystems/dwarfs/version_info.patch new file mode 100644 index 00000000000..59936302ace --- /dev/null +++ b/pkgs/tools/filesystems/dwarfs/version_info.patch @@ -0,0 +1,40 @@ +diff --git a/include/dwarfs/version.h b/include/dwarfs/version.h +new file mode 100755 +index 0000000..9b12c59 +--- /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 100755 +index 0000000..3af0215 +--- /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 = "@gitRev@"; ++char const* PRJ_GIT_DESC = "@gitDesc@"; ++char const* PRJ_GIT_BRANCH = "@gitBranch@"; ++char const* PRJ_GIT_ID = "@gitId@"; ++ ++} // namespace dwarfs diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 799ef35003b..9653332e904 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1195,6 +1195,8 @@ with pkgs; davinci-resolve = callPackage ../applications/video/davinci-resolve { }; + dwarfs = callPackage ../tools/filesystems/dwarfs { }; + gamemode = callPackage ../tools/games/gamemode { libgamemode32 = pkgsi686Linux.gamemode.lib; };