From 104d3f214c1ccb128af746150474464dadeef588 Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Sun, 18 Aug 2024 04:49:48 +0800 Subject: [PATCH] emacsPackages.lspce: simplify module renaming Actually, there is only one module on darwin systems. So the loop is removed. In addition, the bash magic is replaced with nix's stdenv.hostPlatform.extensions.sharedLibrary. --- .../elisp-packages/manual-packages/lspce/module.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lspce/module.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lspce/module.nix index 1a1f8612f64e..198f1d9b69af 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lspce/module.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lspce/module.nix @@ -2,8 +2,12 @@ lib, fetchFromGitHub, rustPlatform, + stdenv, }: +let + libExt = stdenv.hostPlatform.extensions.sharedLibrary; +in rustPlatform.buildRustPackage { pname = "lspce-module"; version = "1.1.0-unstable-2024-07-14"; @@ -22,13 +26,8 @@ rustPlatform.buildRustPackage { "--skip=msg::tests::serialize_request_with_null_params" ]; - # rename module without changing either suffix or location - # use for loop because there seems to be two modules on darwin systems - # https://github.com/zbelial/lspce/issues/7#issue-1783708570 postInstall = '' - for f in $out/lib/*; do - mv --verbose $f $out/lib/lspce-module.''${f##*.} - done + mv --verbose $out/lib/liblspce_module${libExt} $out/lib/lspce-module${libExt} ''; meta = {