Building ledger including Emacs support from git clone

45 views
Skip to first unread message

Colin Hall

unread,
May 16, 2013, 5:46:25 PM5/16/13
to ledge...@googlegroups.com

Hi,

First, thanks for the great software. It is very much appreciated.

Building and installing the ledger binary, docs and C interface files
from my git clone on branch master is working great. Ledger executes ok.

On my system, byte-compile of the Emacs ledger mode software fails for
target ldg-context.elc due to an undefined function line-regex. See the
tail of the log below.

I noticed a lot of recent commits related to regex so I wondered if
there has been a recent design change which has changed the system
requirements for the build-time host?

I haven't attempted to debug the problem but I'm happy to do so if
that's what is required.

Cheers,
Colin.


Tail of the build stdout leading up to the byte-compilation failure:

-------------
[ 5%] Creating byte-compiled Emacs lisp /var/tmp/builds/ledger/lisp/ldg-context.elc
Loading 00debian-vars...
Loading /etc/emacs/site-start.d/50asymptote.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50bbdb.el (source)...
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50emacs-intl-fonts.el (source)...
Loading /etc/emacs/site-start.d/50ess.el (source)...
Loading /etc/emacs/site-start.d/50lbdb.el (source)...

In toplevel form:
ldg-context.el:69:1:Error: Symbol's function definition is void: line-regex
make[2]: *** [ldg-context.elc] Error 1
make[1]: *** [CMakeFiles/emacs_lisp_byte_compile.dir/all] Error 2
make: *** [all] Error 2
--------------


I'm running Emacs 24.3.1, emacs-version produces this output:

---------------
GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2013-04-14 on chindi10, modified by Debian
---------------


Finally, here are the commands I use to build ledger:

-----------------
#!/bin/sh

# Directories:
gitroot="/var/tmp/builds"

# Remove any existing repo
rm -rf "$gitroot/ledger"

# Clone the repo:
cd "$gitroot"
git clone git://github.com/ledger/ledger.git

# My system was not recognised by the dependencies command. If it was,
# here is the command that would pull in the deps.
#
# cd "$gitroot/ledger"
# ./acprep depdendencies

# Configuration and build
cd "$gitroot/ledger"
mkdir build
./acprep --prefix="$HOME" opt make

# Make the docs and install everything
cd "$gitroot/ledger/build/ledger/opt"
make doc install

# Build ledger mode
cd "$gitroot/ledger/lisp"
cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME .
make install
-----------------


--
Colin Hall

Craig Earls

unread,
May 16, 2013, 5:52:09 PM5/16/13
to ledge...@googlegroups.com
line-regex is a macro that needs to be evaluated at run time. Do not
compile ldg-context. The other files should be fine.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "Ledger" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

John Wiegley

unread,
May 16, 2013, 7:05:00 PM5/16/13
to ledge...@googlegroups.com
>>>>> Craig Earls <ende...@gmail.com> writes:

> line-regex is a macro that needs to be evaluated at run time. Do not
> compile ldg-context. The other files should be fine.

Craig,

I believe you can use (eval-when (load eval) ...) to ensure that a given form
is never compiled, but is only evaluated when the file is being loaded or the
form evaluated...

John

Colin Hall

unread,
May 17, 2013, 5:22:16 AM5/17/13
to ledge...@googlegroups.com

John Wiegley writes:

>>>>>> Craig Earls <ende...@gmail.com> writes:
>
>> line-regex is a macro that needs to be evaluated at run time. Do not
>> compile ldg-context. The other files should be fine.

Does this look like a suitable design change? I'm just about to try a
build with it.

Cheers,
Colin.

commit dbf970321f21970ee9e0876a3df922e5b3217e1b
Author: Colin Hall <colin...@gmail.com>
Date: Fri May 17 10:03:17 2013 +0100

Avoid byte-compilation of ldg-context.el

The elisp source ldg-context.el contains a definition for a
macro, line-regex. Byte-compilation of ldg-context.el results
in an error due to line-regex being undefined.

diff --git a/lisp/CMakeLists.txt b/lisp/CMakeLists.txt
index 2258fd5..4e10410 100644
--- a/lisp/CMakeLists.txt
+++ b/lisp/CMakeLists.txt
@@ -16,9 +16,11 @@ set(EMACS_LISP_SOURCES
ldg-test.el
ldg-texi.el
ldg-xact.el
- ldg-context.el
ldg-schedule.el)

+set(EMACS_LISP_SOURCES_NOTCOMPILED
+ ldg-context.el)
+
# find emacs and complain if not found
find_program(EMACS_EXECUTABLE emacs)

@@ -47,7 +49,7 @@ if(EMACS_EXECUTABLE)
add_custom_target(emacs_lisp_byte_compile ALL DEPENDS ${EMACS_LISP_BINARIES})

# install the byte-compiled emacs-lisp sources
- install(FILES ${EMACS_LISP_SOURCES} ${EMACS_LISP_BINARIES}
+ install(FILES ${EMACS_LISP_SOURCES} ${EMACS_LISP_BINARIES} ${EMACS_LISP_SOURCES_NOTCOMPILED}
DESTINATION share/emacs/site-lisp)
endif()

> I believe you can use (eval-when (load eval) ...) to ensure that a given form
> is never compiled, but is only evaluated when the file is being loaded or the
> form evaluated...

I researched that briefly, John, but the only Emacs features I found
were related to enforcing byte-compilation, rather than avoiding it.

If you could expand your point, or send references, I'll investigate
making a change to ldg-context.el

Cheers,
Colin.

--
Colin Hall

Craig Earls

unread,
May 17, 2013, 10:07:25 AM5/17/13
to ledge...@googlegroups.com
Thanks, I will look at that. I think I was being too clever using a
macro calling a macro inside a defconst...
Reply all
Reply to author
Forward
0 new messages