Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 271007 - dev-libs/protobuf should have flag for emacs which installs included protobuf-mode
Summary: dev-libs/protobuf should have flag for emacs which installs included protobuf...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Michal Januszewski (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-24 00:38 UTC by Christopher Smith
Modified: 2009-05-24 22:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
protobuf-2.1.0.ebuild-emacs.patch (protobuf-2.1.0.ebuild-emacs.patch,1.77 KB, patch)
2009-05-24 10:45 UTC, Krzysztof Pawlik (RETIRED)
Details | Diff
files/70protobuf-gentoo.el (70protobuf-gentoo.el,208 bytes, text/plain)
2009-05-24 10:46 UTC, Krzysztof Pawlik (RETIRED)
Details
protobuf-2.1.0.ebuild-emacs.patch (protobuf-2.1.0.ebuild-emacs.patch,1.82 KB, patch)
2009-05-24 11:38 UTC, Krzysztof Pawlik (RETIRED)
Details | Diff
Fix error with byte-compilation in Emacs (protobuf-2.1.0-fix-emacs-byte-compile.patch,653 bytes, patch)
2009-05-24 11:46 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Smith 2009-05-24 00:38:32 UTC
The protocol buffers package from Google includes protobuf-mode, a basic Emacs mode for editing protocol buffers. If the "emacs" user flag has been set, this mode should be installed as per your typical emacs package. Somehow the vim syntax support is there, but the emacs support isn't.

Reproducible: Always

Steps to Reproduce:
1. USE="emacs" emerge protobuf
2. Start emacs.
3. M-x load-lib "protobuf-mode"
Actual Results:  
"Library not found"

Expected Results:  
"Loading protobuf-mode...done"

Workaround is to download and install protobuf-mode yourself.
Comment 1 Krzysztof Pawlik (RETIRED) gentoo-dev 2009-05-24 10:42:51 UTC
Adding emacs team for some help with this.
Comment 2 Krzysztof Pawlik (RETIRED) gentoo-dev 2009-05-24 10:45:49 UTC
Created attachment 192281 [details, diff]
protobuf-2.1.0.ebuild-emacs.patch

This is a patch agains protobuf-2.1.0 ebuild which adds support for emacs.
Comment 3 Krzysztof Pawlik (RETIRED) gentoo-dev 2009-05-24 10:46:40 UTC
Created attachment 192283 [details]
files/70protobuf-gentoo.el

This is site file for protobuf-mode.
Comment 4 Krzysztof Pawlik (RETIRED) gentoo-dev 2009-05-24 10:47:18 UTC
I'm getting following error:

 * Compiling GNU Emacs Elisp files ...

In toplevel form:
protobuf-mode.el:157:1:Error: Unknown language "protobuf" since it got no `c-mode-prefix' property
 * elisp-compile: batch-byte-compile failed                                                                                                                                    [ !! ]
 *
 * ERROR: dev-libs/protobuf-2.1.0 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 4457:  Called die
 * The specific snippet of code:
 *           elisp-compile protobuf-mode.el || die "elisp-compile failed!";
 *  The die message:
 *   elisp-compile failed!
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/dev-libs/protobuf-2.1.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-libs/protobuf-2.1.0/temp/environment'.
 *
!!! When you file a bug report, please include the following information:
GENTOO_VM=sun-jdk-1.6  CLASSPATH="" JAVA_HOME="/opt/sun-jdk-1.6.0.13"
JAVACFLAGS="-source 1.5 -target 1.5" COMPILER="javac"
and of course, the output of emerge --info


emacs team: could you help with this?
Comment 5 Ulrich Müller gentoo-dev 2009-05-24 11:31:53 UTC
(In reply to comment #2)
> Created an attachment (id=192281) [edit]
> protobuf-2.1.0.ebuild-emacs.patch

Patch looks good. Two little things:

- "emacs? ( virtual/emacs )" should also be added to DEPEND because Emacs is
  needed at build time for byte compilation.

+	if use emacs; then
+		cd "${S}/editors/"
+		elisp-compile protobuf-mode.el || die "elisp-compile failed!"
+	fi

- The "cd" is not necessary, elisp-compile with the full path should work.

(In reply to comment #4)
> protobuf-mode.el:157:1:Error: Unknown language "protobuf" since it got no
> `c-mode-prefix' property

Same error here, both with Emacs 22.3 and 23.0.93. I'll look into it.
Comment 6 Krzysztof Pawlik (RETIRED) gentoo-dev 2009-05-24 11:38:03 UTC
Created attachment 192287 [details, diff]
protobuf-2.1.0.ebuild-emacs.patch

Thank you Ulrich, this is updated patch.
Comment 7 Ulrich Müller gentoo-dev 2009-05-24 11:46:04 UTC
Created attachment 192289 [details, diff]
Fix error with byte-compilation in Emacs

Attached patch should fix the byte-compile problem. 

And I just noticed another little thing in the site-init file: you should either change "csv-mode" to "protobuf", or omit the header comment altogether (elisp-site-file-install will then add an appropriate header itself).
Comment 8 Christopher Smith 2009-05-24 20:56:22 UTC
Wow. That was quick! Nice work guys. Should I mark this as FIXED or wait for it to be rolled out to the portage tree?
Comment 9 Ulrich Müller gentoo-dev 2009-05-24 22:01:39 UTC
(In reply to comment #8)
> Should I mark this as FIXED or wait for it to be rolled out to the
> portage tree?

"FIXED" = A fix for this bug is checked into the tree and tested.

Typically the package's maintainer will mark the bug as fixed after committing the fix to the Portage tree.
Comment 10 Krzysztof Pawlik (RETIRED) gentoo-dev 2009-05-24 22:33:42 UTC
Committed, thank you Ulrich for helping with this.