package init
This commit is contained in:
parent
c86065cb09
commit
a32a8d9333
39
erlang-lfe-0001-Remove-support-for-erlang-packages.patch
Normal file
39
erlang-lfe-0001-Remove-support-for-erlang-packages.patch
Normal file
@ -0,0 +1,39 @@
|
||||
From: Peter Lemenkov <lemenkov@gmail.com>
|
||||
Date: Thu, 31 Mar 2016 08:49:49 +0300
|
||||
Subject: [PATCH] Remove support for erlang packages.
|
||||
|
||||
Erlang "packages" were abandoned long time ago. Remaining support was
|
||||
dropped in erlang/otp@8e32c07940d9cd1c325d052bded3729333920f81.
|
||||
|
||||
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
||||
|
||||
diff --git a/src/lfe_trans.erl b/src/lfe_trans.erl
|
||||
index d2d21b2..628e4eb 100644
|
||||
--- a/src/lfe_trans.erl
|
||||
+++ b/src/lfe_trans.erl
|
||||
@@ -139,8 +139,6 @@ from_expr({record_field,_,E,R,{atom,_,F}}, Vt0, St0) -> %We KNOW!
|
||||
RF = list_to_atom(atom_to_list(R) ++ "-" ++ atom_to_list(F)),
|
||||
{Le,Vt1,St1} = from_expr(E, Vt0, St0),
|
||||
{[RF,Le],Vt1,St1};
|
||||
-from_expr({record_field,_,_,_}=M, Vt, St) -> %Pre R16 packages
|
||||
- from_package_module(M, Vt, St);
|
||||
%% Function calls.
|
||||
from_expr({call,_,{remote,_,M,F},As}, Vt0, St0) -> %Remote function call
|
||||
{Lm,Vt1,St1} = from_expr(M, Vt0, St0),
|
||||
@@ -367,16 +365,6 @@ from_rec_fields([{record_field,_,{var,_,F},E}|Fs], Vt0, St0) -> %special case!!
|
||||
{[F,Le|Lfs],Vt2,St2};
|
||||
from_rec_fields([], Vt, St) -> {[],Vt,St}.
|
||||
|
||||
-%% from_package_module(Module, VarTable, State) -> {Module,VarTable,State}.
|
||||
-%% We must handle the special case where in pre-R16 you could have
|
||||
-%% packages with a dotted module path. It used a special record_field
|
||||
-%% tuple. This does not work in R16 and later!
|
||||
-
|
||||
-from_package_module({record_field,_,_,_}=M, Vt, St) ->
|
||||
- Segs = erl_parse:package_segments(M),
|
||||
- A = list_to_atom(packages:concat(Segs)),
|
||||
- {?Q(A),Vt,St}.
|
||||
-
|
||||
from_maybe(_, []) -> [];
|
||||
from_maybe(Tag, Es) -> [[Tag|Es]].
|
||||
|
||||
19
erlang-lfe-0002-Convert-to-proper-UTF-8.patch
Normal file
19
erlang-lfe-0002-Convert-to-proper-UTF-8.patch
Normal file
@ -0,0 +1,19 @@
|
||||
From: Peter Lemenkov <lemenkov@gmail.com>
|
||||
Date: Tue, 20 Jun 2017 18:24:11 +0300
|
||||
Subject: [PATCH] Convert to proper UTF-8
|
||||
|
||||
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
||||
|
||||
diff --git a/examples/core-macros.lfe b/examples/core-macros.lfe
|
||||
index e76148a..3cac342 100644
|
||||
--- a/examples/core-macros.lfe
|
||||
+++ b/examples/core-macros.lfe
|
||||
@@ -96,7 +96,7 @@
|
||||
(() `'false)))
|
||||
|
||||
;; This version of backquote is almost an exact copy of a quasiquote
|
||||
-;; expander for Scheme by André van Tonder. It is very compact and
|
||||
+;; expander for Scheme by André van Tonder. It is very compact and
|
||||
;; with some cons/append optimisations we have added produces quite
|
||||
;; reasonable code.
|
||||
|
||||
92
erlang-lfe.spec
Normal file
92
erlang-lfe.spec
Normal file
@ -0,0 +1,92 @@
|
||||
%global realname lfe
|
||||
%global upstream rvirding
|
||||
%global need_bootstrap 0
|
||||
%if 0%{?need_bootstrap}
|
||||
%global _erllibdir %{_libdir}/erlang/lib
|
||||
%global debug_package %{nil}
|
||||
%endif
|
||||
Name: erlang-%{realname}
|
||||
Version: 1.3
|
||||
Release: 1
|
||||
Summary: Lisp Flavoured Erlang
|
||||
License: BSD
|
||||
URL: https://github.com/%{upstream}/%{realname}
|
||||
VCS: scm:git:https://github.com/%{upstream}/%{realname}.git
|
||||
Source0: https://github.com/%{upstream}/%{realname}/archive/%{version}/%{realname}-%{version}.tar.gz
|
||||
Patch1: erlang-lfe-0001-Remove-support-for-erlang-packages.patch
|
||||
Patch2: erlang-lfe-0002-Convert-to-proper-UTF-8.patch
|
||||
%if 0%{?need_bootstrap}
|
||||
BuildRequires: erlang-erts erlang-rpm-macros
|
||||
%else
|
||||
BuildRequires: erlang-rebar
|
||||
%endif
|
||||
BuildRequires: pkgconfig emacs emacs-el gcc
|
||||
Requires: emacs-filesystem
|
||||
Obsoletes: emacs-erlang-lfe
|
||||
Obsoletes: emacs-erlang-lfe-el
|
||||
%{?__erlang_drv_version:Requires: %{__erlang_drv_version}}
|
||||
%description
|
||||
Lisp Flavoured Erlang, is a lisp syntax front-end to the Erlang
|
||||
compiler. Code produced with it is compatible with "normal" Erlang
|
||||
code. An LFE evaluator and shell is also included.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{realname}-%{version}
|
||||
%patch1 -p1 -b .no_erl_packages
|
||||
%patch2 -p1 -b .proper_utf8
|
||||
|
||||
%build
|
||||
%if 0%{?need_bootstrap}
|
||||
mkdir -p ./ebin/
|
||||
/usr/bin/erlc -o ./ebin/ src/*.erl
|
||||
%else
|
||||
mkdir -p ./ebin/
|
||||
%{erlang_compile}
|
||||
%endif
|
||||
emacs -L emacs/ -batch -f batch-byte-compile emacs/inferior-lfe.el emacs/lfe-mode.el emacs/lfe-indent.el
|
||||
|
||||
%install
|
||||
install -m 0755 -d %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/{bin,ebin,priv}
|
||||
install -p -m 0755 -D ebin/* %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/ebin/
|
||||
install -p -m 0755 -D bin/* %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/bin/
|
||||
%if 0%{?need_bootstrap}
|
||||
echo "we are going to install only bare minimum of LFE - just for rebar bootstrapping"
|
||||
%else
|
||||
install -p -m 0755 priv/%{realname}_drv.so %{buildroot}%{_libdir}/erlang/lib/%{realname}-%{version}/priv/
|
||||
%endif
|
||||
install -m 0755 -d %{buildroot}/%{_bindir}
|
||||
ln -s %{_libdir}/erlang/lib/%{realname}-%{version}/bin/{lfe,lfec,lfescript} %{buildroot}%{_bindir}/
|
||||
mkdir -p %{buildroot}%{_emacs_sitelispdir}
|
||||
mkdir -p %{buildroot}%{_emacs_sitestartdir}
|
||||
install -p -m 0644 emacs/inferior-lfe.el %{buildroot}%{_emacs_sitelispdir}
|
||||
install -p -m 0644 emacs/inferior-lfe.elc %{buildroot}%{_emacs_sitelispdir}
|
||||
install -p -m 0644 emacs/lfe-mode.el %{buildroot}%{_emacs_sitelispdir}
|
||||
install -p -m 0644 emacs/lfe-mode.elc %{buildroot}%{_emacs_sitelispdir}
|
||||
install -p -m 0644 emacs/lfe-indent.el %{buildroot}%{_emacs_sitelispdir}
|
||||
install -p -m 0644 emacs/lfe-indent.elc %{buildroot}%{_emacs_sitelispdir}
|
||||
install -p -m 0644 emacs/lfe-start.el %{buildroot}%{_emacs_sitestartdir}
|
||||
|
||||
%check
|
||||
%if 0%{?need_bootstrap}
|
||||
echo "No tests during bootstrapping"
|
||||
%else
|
||||
%endif
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%doc README.md doc/ examples/
|
||||
%{_bindir}/lfe
|
||||
%{_bindir}/lfec
|
||||
%{_bindir}/lfescript
|
||||
%{erlang_appdir}/
|
||||
%{_emacs_sitelispdir}/inferior-lfe.el
|
||||
%{_emacs_sitelispdir}/inferior-lfe.elc
|
||||
%{_emacs_sitelispdir}/lfe-indent.el
|
||||
%{_emacs_sitelispdir}/lfe-indent.elc
|
||||
%{_emacs_sitelispdir}/lfe-mode.el
|
||||
%{_emacs_sitelispdir}/lfe-mode.elc
|
||||
%{_emacs_sitestartdir}/lfe-start.el
|
||||
|
||||
%changelog
|
||||
* Sat Aug 29 2020 wangyue <wangyue92@huawei.com> - 1.3-1
|
||||
- package init
|
||||
5
erlang-lfe.yaml
Normal file
5
erlang-lfe.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
git_url: https://github.com/rvirding/lfe
|
||||
version_control: github
|
||||
src_repo: rvirding/lfe
|
||||
tag_prefix: "^"
|
||||
seperator: "."
|
||||
BIN
lfe-1.3.tar.gz
Normal file
BIN
lfe-1.3.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user