guile-lsp-server: init at 0.4.7 + deps (#400634)

This commit is contained in:
Ben Siraphob
2025-05-11 23:18:42 -04:00
committed by GitHub
5 changed files with 309 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
{
stdenv,
fetchzip,
mitscheme,
guile,
lib,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "guile-irregex";
version = "0.9.11";
src = fetchzip {
url = "https://synthcode.com/scheme/irregex/irregex-${finalAttrs.version}.tar.gz";
hash = "sha256-abBCMNsr6GTBOm+eQWuOX8JYx/qMA/V6TwGdYRjznWU=";
};
strictDeps = true;
nativeBuildInputs = [
guile
mitscheme
];
buildInputs = [
guile
];
env.GUILE_AUTO_COMPILE = "0";
buildPhase = ''
runHook preBuild
site_dir="$out/share/guile/site/3.0"
lib_dir="$out/lib/guile/3.0/site-ccache"
mkdir -p $site_dir/rx/source
mkdir -p $lib_dir/rx/source
cp $src/irregex-guile.scm $site_dir/rx/irregex.scm
cp $src/irregex.scm $site_dir/rx/source/irregex.scm
cp $src/irregex-utils.scm $site_dir/rx/source/irregex-utils.scm
guild compile --r7rs $site_dir/rx/irregex.scm -o $lib_dir/rx/irregex.go
guild compile --r7rs $site_dir/rx/source/irregex.scm -o $lib_dir/rx/source/irregex.go
runHook postBuild
'';
dontInstall = true;
meta = {
description = "IrRegular Expressions";
longDescription = ''
A fully portable and efficient R[4567]RS implementation of regular expressions, supporting
both POSIX syntax with various (irregular) PCRE extensions, as well as SCSH's SRE syntax, with
various aliases for commonly used patterns. DFA matching is used when possible, otherwise a
closure-compiled NFA approach is used. The library makes no assumptions about the encoding of
strings or range of characters and can thus be used in Unicode-aware Scheme implementations.
Matching may be performed over standard Scheme strings, or over arbitrarily chunked streams of
strings.
'';
homepage = "https://synthcode.com/scheme/irregex";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ knightpp ];
platforms = guile.meta.platforms;
};
})
@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitea,
guile,
pkg-config,
guile-srfi-145,
guile-srfi-180,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "guile-json-rpc";
version = "0.4.5a";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "rgherdt";
repo = "scheme-json-rpc";
tag = finalAttrs.version;
hash = "sha256-sTJxPxHKovMOxfu5jM/6EpB9RFpG+9E3388xeE2Fpgw=";
};
strictDeps = true;
propagatedBuildInputs = [
guile-srfi-145
guile-srfi-180
];
nativeBuildInputs = [
pkg-config
guile
];
buildInputs = [
guile
];
env.GUILE_AUTO_COMPILE = "0";
preConfigure = ''
cd guile
'';
meta = {
description = "A JSON-RPC implementation for Scheme";
homepage = "https://codeberg.org/rgherdt/scheme-json-rpc";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ knightpp ];
platforms = guile.meta.platforms;
};
})
@@ -0,0 +1,67 @@
{
lib,
guile,
stdenv,
fetchFromGitea,
pkg-config,
bash,
makeWrapper,
guile-json-rpc,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "guile-lsp-server";
version = "0.4.7";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "rgherdt";
repo = "scheme-lsp-server";
tag = finalAttrs.version;
hash = "sha256-XNzon1l6CnCd4RasNrHHxWEBNhyaHXgdNLsvjvRLbfk=";
};
strictDeps = true;
nativeBuildInputs = [
pkg-config
makeWrapper
guile
];
buildInputs = [
guile
];
propagatedBuildInputs = [
guile-json-rpc
];
makeFlags = [ "GUILE_AUTO_COMPILE=0" ];
preConfigure = ''
cd guile
'';
postInstall = ''
wrapProgram $out/bin/guile-lsp-server \
--prefix PATH : ${
lib.makeBinPath [
guile
bash
]
} \
--set GUILE_AUTO_COMPILE 0 \
--prefix GUILE_LOAD_PATH : "$out/${guile.siteDir}:$GUILE_LOAD_PATH" \
--prefix GUILE_LOAD_COMPILED_PATH : "$out/${guile.siteCcacheDir}:$GUILE_LOAD_COMPILED_PATH" \
--argv0 $out/bin/guile-lsp-server
'';
meta = {
homepage = "https://codeberg.org/rgherdt/scheme-lsp-server";
description = "An LSP server for Guile";
mainProgram = "guile-lsp-server";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ knightpp ];
platforms = guile.meta.platforms;
};
})
@@ -0,0 +1,61 @@
{
lib,
stdenv,
fetchFromGitea,
guile,
guile-irregex,
}:
stdenv.mkDerivation {
pname = "guile-srfi-145";
version = "0-unstable-2023-06-04";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "rgherdt";
repo = "srfi";
rev = "e598c28eb78e9c3e44f5c3c3d997ef28abb6f32e";
hash = "sha256-kvM2v/nDou0zee4+qcO5yN2vXt2y3RUnmKA5S9iKFE0=";
};
strictDeps = true;
nativeBuildInputs = [
guile
];
buildInputs = [
guile
];
propagatedBuildInputs = [
guile-irregex
];
preConfigure = ''
export GUILE_AUTO_COMPILE=0
'';
buildPhase = ''
runHook preBuild
site_dir="$out/share/guile/site/3.0"
lib_dir="$out/lib/guile/3.0/site-ccache"
export GUILE_LOAD_PATH=.:$site_dir:...:$GUILE_LOAD_PATH
export GUILE_LOAD_COMPILED_PATH=.:$lib_dir:...:$GUILE_LOAD_COMPILED_PATH
mkdir -p $site_dir/srfi
cp $src/srfi/srfi-145.scm $site_dir/srfi/
guild compile --r7rs $site_dir/srfi/srfi-145.scm -o $lib_dir/srfi/srfi-145.go
runHook postBuild
'';
meta = {
description = "Scheme SRFI-145 implementations in portable R7RS scheme";
homepage = "https://codeberg.org/rgherdt/srfi";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ knightpp ];
platforms = guile.meta.platforms;
};
}
@@ -0,0 +1,64 @@
{
lib,
stdenv,
fetchFromGitea,
guile,
guile-irregex,
}:
stdenv.mkDerivation {
pname = "guile-srfi-180";
version = "0-unstable-2023-06-04";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "rgherdt";
repo = "srfi";
rev = "e598c28eb78e9c3e44f5c3c3d997ef28abb6f32e";
hash = "sha256-kvM2v/nDou0zee4+qcO5yN2vXt2y3RUnmKA5S9iKFE0=";
};
strictDeps = true;
nativeBuildInputs = [
guile
];
buildInputs = [
guile
];
propagatedBuildInputs = [
guile-irregex
];
preConfigure = ''
export GUILE_AUTO_COMPILE=0
'';
buildPhase = ''
runHook preBuild
site_dir="$out/share/guile/site/3.0"
lib_dir="$out/lib/guile/3.0/site-ccache"
export GUILE_LOAD_PATH=.:$site_dir:...:$GUILE_LOAD_PATH
export GUILE_LOAD_COMPILED_PATH=.:$lib_dir:...:$GUILE_LOAD_COMPILED_PATH
mkdir -p $site_dir/srfi
cp $src/srfi/srfi-180.scm $site_dir/srfi
cp -R $src/srfi/srfi-180/ $site_dir/srfi
cp -R $src/srfi/180/ $site_dir/srfi
guild compile -x "sld" --r7rs $site_dir/srfi/srfi-180/helpers.sld -o $lib_dir/srfi/srfi-180/helpers.go
guild compile --r7rs $site_dir/srfi/srfi-180.scm -o $lib_dir/srfi/srfi-180.go
runHook postBuild
'';
meta = {
description = "Scheme SRFI-180 implementations in portable R7RS scheme";
homepage = "https://codeberg.org/rgherdt/srfi";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ knightpp ];
platforms = guile.meta.platforms;
};
}