diff mbox

erlang: Add new package.

Message ID CAFbHwiTCXTT23fGLnz_w8kr+6NmNzV9kK+=nHYpXOY5NOMt1dg@mail.gmail.com
State Changes Requested
Headers show

Commit Message

Will Newton April 4, 2012, 4:49 p.m. UTC
---
 package/Config.in                     |    1 +
 package/erlang/Config.in              |    9 +++++++++
 package/erlang/erlang-build-fix.patch |   13 +++++++++++++
 package/erlang/erlang.mk              |   26 ++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 0 deletions(-)
 create mode 100644 package/erlang/Config.in
 create mode 100644 package/erlang/erlang-build-fix.patch
 create mode 100644 package/erlang/erlang.mk

Comments

Thomas Petazzoni Aug. 17, 2012, 5:33 p.m. UTC | #1
Hello Will,

Le Wed, 4 Apr 2012 17:49:07 +0100,
Will Newton <will.newton@gmail.com> a écrit :

> ---
>  package/Config.in                     |    1 +
>  package/erlang/Config.in              |    9 +++++++++
>  package/erlang/erlang-build-fix.patch |   13 +++++++++++++
>  package/erlang/erlang.mk              |   26 ++++++++++++++++++++++++++
>  4 files changed, 49 insertions(+), 0 deletions(-)
>  create mode 100644 package/erlang/Config.in
>  create mode 100644 package/erlang/erlang-build-fix.patch
>  create mode 100644 package/erlang/erlang.mk

Thanks for this.

A couple of questions/comments:

 *) Could you update the patch to use autotools-package and
 host-autotools-package in accordance with the latest package
 infrastructure changes?

 *) Could you add your Signed-off by line?

 *) The complete Erlang stuff gets installed in /usr/lib/erlang, even
 the binaries (compiler, interpreter?) in /usr/lib/erlang/bin/. Is this
 the normal installation location? If so, then we should at least
 probably provide a few symlinks from /usr/bin/.

 *) By default the /usr/lib/erlang/ size is 55 MB on ARM. Is this the
 minimal size of the standard library?

 *) From the configure.in script, I see options like shared-zlib, or
 ssl path or things like that, but your erlang package does not depend
 on zlib nor OpenSSL. Can you give a few comments about this?

Thanks!

Thomas
Will Newton Aug. 22, 2012, 1 p.m. UTC | #2
On Fri, Aug 17, 2012 at 6:33 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello Will,
>
> Le Wed, 4 Apr 2012 17:49:07 +0100,
> Will Newton <will.newton@gmail.com> a écrit :
>
>> ---
>>  package/Config.in                     |    1 +
>>  package/erlang/Config.in              |    9 +++++++++
>>  package/erlang/erlang-build-fix.patch |   13 +++++++++++++
>>  package/erlang/erlang.mk              |   26 ++++++++++++++++++++++++++
>>  4 files changed, 49 insertions(+), 0 deletions(-)
>>  create mode 100644 package/erlang/Config.in
>>  create mode 100644 package/erlang/erlang-build-fix.patch
>>  create mode 100644 package/erlang/erlang.mk
>
> Thanks for this.
>
> A couple of questions/comments:
>
>  *) Could you update the patch to use autotools-package and
>  host-autotools-package in accordance with the latest package
>  infrastructure changes?

Ok, done.

>  *) Could you add your Signed-off by line?

Sure.

>  *) The complete Erlang stuff gets installed in /usr/lib/erlang, even
>  the binaries (compiler, interpreter?) in /usr/lib/erlang/bin/. Is this
>  the normal installation location? If so, then we should at least
>  probably provide a few symlinks from /usr/bin/.

I get these symlinks in my build, e.g.:

[wnewton@wnewton-linux buildroot]$ ls -l output/target/usr/bin/erl*
lrwxrwxrwx. 1 wnewton ldapusers 21 Aug 22 11:18
output/target/usr/bin/erl -> ../lib/erlang/bin/erl
lrwxrwxrwx. 1 wnewton ldapusers 22 Aug 22 11:18
output/target/usr/bin/erlc -> ../lib/erlang/bin/erlc

>  *) By default the /usr/lib/erlang/ size is 55 MB on ARM. Is this the
>  minimal size of the standard library?

It is quite large unfortunately. At least part of this seems to be
that the bytecode files (.beam) are not very compact. It is possible
to delete packages (just delete
/usr/lib/erlang/lib/<package>-<version>) but it is not clear exactly
what a good minimal set is. I remove gs (tk based UI) and wx
(wxWidgets based UI) libs as they are not supported by buildroot.

I'll add a config option for the megaco application which is the
largest by some distance.

>  *) From the configure.in script, I see options like shared-zlib, or
>  ssl path or things like that, but your erlang package does not depend
>  on zlib nor OpenSSL. Can you give a few comments about this?

I've added support for enabling openssl, zlib and ncurses dependencies.

I'll repost the patch with these changes.
Thomas Petazzoni Aug. 22, 2012, 1:41 p.m. UTC | #3
Le Wed, 22 Aug 2012 14:00:04 +0100,
Will Newton <will.newton@gmail.com> a écrit :

> >  *) The complete Erlang stuff gets installed in /usr/lib/erlang, even
> >  the binaries (compiler, interpreter?) in /usr/lib/erlang/bin/. Is this
> >  the normal installation location? If so, then we should at least
> >  probably provide a few symlinks from /usr/bin/.
> 
> I get these symlinks in my build, e.g.:
> 
> [wnewton@wnewton-linux buildroot]$ ls -l output/target/usr/bin/erl*
> lrwxrwxrwx. 1 wnewton ldapusers 21 Aug 22 11:18
> output/target/usr/bin/erl -> ../lib/erlang/bin/erl
> lrwxrwxrwx. 1 wnewton ldapusers 22 Aug 22 11:18
> output/target/usr/bin/erlc -> ../lib/erlang/bin/erlc

Hum, ok, I might have looked improperly. I'll check again with your
updated patch.

> It is quite large unfortunately. At least part of this seems to be
> that the bytecode files (.beam) are not very compact. It is possible
> to delete packages (just delete
> /usr/lib/erlang/lib/<package>-<version>) but it is not clear exactly
> what a good minimal set is. I remove gs (tk based UI) and wx
> (wxWidgets based UI) libs as they are not supported by buildroot.
> 
> I'll add a config option for the megaco application which is the
> largest by some distance.

Ok.

> I've added support for enabling openssl, zlib and ncurses dependencies.
> 
> I'll repost the patch with these changes.

Excellent, thanks!

Thomas
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index b84d7f1..8c36952 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -227,6 +227,7 @@  source "package/xfsprogs/Config.in"
 endmenu

 menu "Interpreter languages and scripting"
+source "package/erlang/Config.in"
 source "package/haserl/Config.in"
 source "package/lua/Config.in"
 if BR2_PACKAGE_LUA
diff --git a/package/erlang/Config.in b/package/erlang/Config.in
new file mode 100644
index 0000000..78f34ac
--- /dev/null
+++ b/package/erlang/Config.in
@@ -0,0 +1,9 @@ 
+config BR2_PACKAGE_ERLANG
+	bool "erlang"
+	select BR2_PACKAGE_NCURSES
+	help
+	  Erlang is a programming language used to build massively scalable
+	  soft real-time systems with requirements on high availability.
+	  Some of its uses are in telecoms, banking, e-commerce, computer
+	  telephony and instant messaging. Erlang's runtime system has
+	  built-in support for concurrency, distribution and fault tolerance.
diff --git a/package/erlang/erlang-build-fix.patch
b/package/erlang/erlang-build-fix.patch
new file mode 100644
index 0000000..d2938a5
--- /dev/null
+++ b/package/erlang/erlang-build-fix.patch
@@ -0,0 +1,13 @@ 
+apply-patches.sh deletes this file from the source directory.
+
+--- erlang-R15B01.old/lib/tools/emacs/Makefile	2012-04-04
15:54:29.271832192 +0100
++++ erlang-R15B01/lib/tools/emacs/Makefile	2012-04-04 15:55:16.978957307 +0100
+@@ -51,7 +51,7 @@
+
+ ELC_FILES = $(EMACS_FILES:%=%.elc)
+
+-TEST_FILES = test.erl.indented test.erl.orig
++TEST_FILES = test.erl.indented
+
+ # ----------------------------------------------------
+ # Targets
diff --git a/package/erlang/erlang.mk b/package/erlang/erlang.mk
new file mode 100644
index 0000000..e8ce8bc
--- /dev/null
+++ b/package/erlang/erlang.mk
@@ -0,0 +1,26 @@ 
+#############################################################
+#
+# erlang
+#
+#############################################################
+
+ERLANG_VERSION = R15B01
+ERLANG_SITE = http://www.erlang.org/download
+ERLANG_SOURCE = otp_src_$(ERLANG_VERSION).tar.gz
+ERLANG_DEPENDENCIES = ncurses host-erlang
+
+# The configure checks for these functions fail incorrectly
+ERLANG_CONF_ENV = ac_cv_func_isnan=yes ac_cv_func_isinf=yes
+
+# Remove source, example, gs and wx files from the target
+define ERLANG_REMOVE_UNUSED
+	find $(TARGET_DIR)/usr/lib/erlang -type d -name src -prune -exec rm -rf {} \;
+	find $(TARGET_DIR)/usr/lib/erlang -type d -name examples -prune
-exec rm -rf {} \;
+	rm -rf $(TARGET_DIR)/usr/lib/erlang/lib/gs-*
+	rm -rf $(TARGET_DIR)/usr/lib/erlang/lib/wx-*
+endef
+
+ERLANG_POST_INSTALL_TARGET_HOOKS += ERLANG_REMOVE_UNUSED
+
+$(eval $(call AUTOTARGETS))
+$(eval $(call AUTOTARGETS,host))