2022-02-16 14:55:43 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2019-12-19 16:26:54 +00:00
|
|
|
, fetchgit
|
|
|
|
, libbsd
|
|
|
|
, readline
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rosie";
|
2023-04-29 17:34:21 +01:00
|
|
|
version = "1.3.0";
|
2022-02-16 14:55:43 +00:00
|
|
|
|
2019-12-19 16:26:54 +00:00
|
|
|
src = fetchgit {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "https://gitlab.com/rosie-pattern-language/rosie";
|
2023-04-29 17:34:21 +01:00
|
|
|
rev = "9303e04ae2cffabdda6ccc4e2a351a47218615ff";
|
|
|
|
sha256 = "1smh760baf43hr56p6rh4khz3shyzda5lqva4ffxwchl7yy7r82j";
|
2019-12-19 16:26:54 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
# The Makefile calls git to update submodules, unless this file exists
|
|
|
|
touch ${src.name}/submodules/~~present~~
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs src/build_info.sh
|
2023-04-29 17:34:21 +01:00
|
|
|
# rosie is ran as part of `make check`,
|
|
|
|
# and so needs to be patched in preConfigure.
|
|
|
|
patchShebangs rosie
|
2019-12-19 16:26:54 +00:00
|
|
|
# Part of the same Makefile target which calls git to update submodules
|
|
|
|
ln -s src submodules/lua/include
|
2023-04-29 17:34:21 +01:00
|
|
|
# ldconfig is irrelevant, disable it inside `make installforce`.
|
|
|
|
sed -iE 's/ldconfig/echo skippin ldconfig/' Makefile
|
|
|
|
sed -iE '/ld.so.conf.d/d' Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = lib.optionalString stdenv.isDarwin ''
|
|
|
|
install_name_tool -add_rpath $out/lib build/bin/rosie
|
|
|
|
install_name_tool -id $out/lib/librosie.dylib build/lib/librosie.dylib
|
2019-12-19 16:26:54 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/emacs/site-lisp $out/share/vim-plugins $out/share/nvim
|
2023-04-29 17:34:21 +01:00
|
|
|
mv $out/lib/rosie/extra/emacs/* $out/share/emacs/site-lisp/
|
|
|
|
mv $out/lib/rosie/extra/vim $out/share/vim-plugins/rosie
|
2019-12-19 16:26:54 +00:00
|
|
|
ln -s $out/share/vim-plugins/rosie $out/share/nvim/site
|
|
|
|
'';
|
|
|
|
|
2023-04-29 17:34:21 +01:00
|
|
|
# librosie.so is dlopen'ed , so we disable ELF patching to preserve RUNPATH .
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2019-12-19 16:26:54 +00:00
|
|
|
makeFlags = [ "DESTDIR=${placeholder "out"}" ];
|
|
|
|
|
|
|
|
buildInputs = [ libbsd readline ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://rosie-lang.org";
|
2019-12-19 16:26:54 +00:00
|
|
|
description = "Tools for searching using parsing expression grammars";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ kovirobi ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
|
|
|
};
|
|
|
|
}
|