From 10c8d2b894abc42443fd1afdbfdd2a3d24a6d938 Mon Sep 17 00:00:00 2001 From: Daniel Nagy Date: Sat, 21 Sep 2024 13:45:00 +0200 Subject: [PATCH] emacsPackages.zstd: init at 0-unstable-2020-06-03 --- .../emacs/elisp-packages/manual-packages.nix | 2 + .../manual-packages/zstd/default.nix | 37 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 pkgs/applications/editors/emacs/elisp-packages/manual-packages/zstd/default.nix diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix index 77365da2b596..5981faab2d1c 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix @@ -29,6 +29,8 @@ lib.packagesFromDirectoryRecursive { tree-sitter-langs = callPackage ./manual-packages/tree-sitter-langs { final = self; }; + zstd = callPackage ./manual-packages/zstd { inherit (pkgs) zstd; }; + # From old emacsPackages (pre emacsPackagesNg) cedille = callPackage ./manual-packages/cedille { inherit (pkgs) cedille; }; diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/zstd/default.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/zstd/default.nix new file mode 100644 index 000000000000..4dfe2484dbfd --- /dev/null +++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/zstd/default.nix @@ -0,0 +1,37 @@ +{ + lib, + melpaBuild, + stdenv, + fetchFromGitHub, + zstd, +}: + +let + libExt = stdenv.hostPlatform.extensions.sharedLibrary; +in +melpaBuild { + pname = "zstd"; + version = "0-unstable-2020-06-03"; + + src = fetchFromGitHub { + owner = "syohex"; + repo = "emacs-zstd"; + rev = "072b264e2cbd5c05be06a1208ebccc2dab44be39"; + hash = "sha256-p8bxefytTOSV6vIG8PAPBXfVKA2rfmWdRtVwjE42mAw="; + }; + + buildInputs = [ zstd ]; + + preBuild = '' + $CC -std=gnu99 -shared -o zstd-core${libExt} zstd-core.c -lzstd + ''; + + files = ''(:defaults "zstd-core${libExt}")''; + + meta = { + homepage = "https://github.com/syohex/emacs-zstd"; + description = "Zstd binding for Emacs Lisp"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ nagy ]; + }; +}