What is missing from my build environment when trying to compile emacs-25.1? - emacs

I'm trying to build emacs-25.1 from source on OSx. Everything goes fine until make install. When Emacs is trying to compile xml.c I get:
xml.c:23:10: fatal error: 'libxml/tree.h' file not found
#include <libxml/tree.h>
What is happening?

I'm not sure what your exact error is. However, there is an easier way to build emacs25 on OSX and macOS. Install homebrew is easy and once you have it, all you need to do is run
brew install emacs --with-cocoa --with-rsvg --with-ns
and then
brew linkapps emacs
and your done. Even if you want to do it by hand, you can get the recipe homebrew users to see how it does the build and install, which might help track down your error.
NOTE Check what the actual args are you can pass to the build environment. the ones I've listed are from memory and there are some others you may want to include.

A colleague was having the same problem and posted in the GNU emacs devel list right here. Daniel Suton provided the answer. Xcode is missing:
xcode-select --install
MacOS provides a libxml implementation (and headers) by default when you install xcode. Note that I had installed xcode already. But I've also upgraded from EL Captain to Sierra so my xcode installation must have been erased in the process.
Anyway, after installing xcode like described above and then after git clean -fxd I was able to rebuild emacs again.

Related

Cannot use Swift on Ubuntu 18.04

After conscientiously following the install instructions on Linux from swift.org, I encounter an issue where it is not possible to compile anything on a Ubuntu 18.04 machine. The REPL seems to work but during compilation (when calling swift build) the following error appears:
/usr/bin/ld: cannot find -lstdc++
There are more details in the full bug report [SR-9093]. I don't know at all what to do to solve this issue, there are similar problems already mentioned in other bug reports, for instance on this really old one [SR-35].
What should I do?
Thank you
I am assuming that you had already installed the libstdc++ successfully and you have set the permissions properly. But I really doubt that it was installed correctly but it was installed with corruption of some sort. The corruption occurred because you didn't install libstdc++ via a package manager. Result was some form of weirdness in the package manager database which effected the overall functioning system. Exactly why adding something to a folder should change anything at all. I don't know why this happens, unless the folder is hot i.e symbolically linked to a program which doesn't have any tolerance for hacks like simply copying a file into the folder. So for now try to install the libstdc++ again. Below is the link to the file to again download the correct program and this is compatible with amd64.
http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.10_amd64.deb
And below are some link to help
https://ubuntuforums.org/showthread.php?t=1425470
https://ubuntuforums.org/showthread.php?t=808045
https://ubuntuforums.org/showthread.php?t=808045
https://packages.ubuntu.com/search?keywords=libstdc%2B%2B
https://packages.ubuntu.com/xenial/amd64/libstdc++6
Install libstdc++
sudo apt install libstdc++6
It seems possible that the apt install did not run the ldconfig program, which should be run to add the library to the list of those which ld.so knows about.
It looks like you can do it manually:
sudo ldconfig
IMPORTANT CAVEAT: I don't have Ubuntu and haven't been able to test this. And it's a sudo command. Run at your own risk, YMMV, etc.
If this does not work, it's possible that a file called /etc/ld.so.conf is not set up to search the directory where libstdc++ ended up. I wouldn't dare try to describe how to fix that.
sudo apt install -f
The command above should install any missing dependencies.

How do I install the hg-git plugin on Debian Stretch?

Debian Jessie, as well as sid, have a mercurial-git package which contains the hg-git plugin. However, this package was (auto-)removed from Debian Stretch to to a release-critical bug.
But - I need it installed and running. Surely this should be possible, right?
Well, I followed the installation instructions on the plugin page:
I ran apt-get install python-setuptools python-setuptools-git python4-setuptools python3-setuptools-git
I ran easy_install hg-git and it seemed to work
But still, when I run various mercurial operations I get, as the first line, the error message:
*** failed to import extension hgext.git: No module named git
(regardless of whether I'm doing anything git-related or not.)
My questions:
Why is this happening?
What do I need to do in order to make the error message go away while having hggit working?
Now,
How do I correctly install dulwich to get hg-git working on Windows?
Apparently, that critical bug doesn't manifest always (and perhaps only under very specific circumstances), so you can try installing the Debian sid version of the mercurial-git package (that is, version 0.8.11-1 at the time of writing). There's a SuperUser question about how to do this:
https://linuxaria.com/howto/how-to-install-a-single-package-from-debian-sid-or-debian-testing
my personal opinion in this case is to simply install the .deb file, which you can get from here (it's not platform-specific; at the link you'll need to choose a mirror.) That makes the error message go away, at least assuming you have:
[extensions]
hgext.bookmarks =
hggit =
in your ~/.hgrc file.

Installing Vapor on macOS without needing Homebrew

I am trying to get a Swift Vapor project started. Following the guide here, it seems that Homebrew is the only option. I already have MacPorts and prefer it in many ways to Homebrew. Unfortunately there is no port for Vapor, so I went for the SPM installation that Vapor people describe here. I had previous success with Kitura, so I thought why not with Vapor. Well, when you go and build your project, you get
$ swift build
[... build stuff ...]
note: you may be able to install ctls using your system-packager:
brew install ctls
[... more build stuff ...]
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "shim.h"
^
[... more like that ...]
/Users/morpheu5/web/vizex/api/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Cipher/Cipher+Method.swift:1:8: error: could not build Objective-C module 'CTLS'
import CTLS
^
<unknown>:0: error: build had 1 command failures
error: exit(1):/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/morpheu5/web/vizex/api/.build/debug.yaml
Apparently you really need this ctls package, and the only way of getting it appears to be through Homebrew/Tap.
I really don't want or need Homebrew, so how do I get to the bottom of this? I'd really like to give Vapor a try.
Obligatory 1: installing Homebrew is the easiest way. If you then decide you don't want Homebrew, it uninstalls quite neatly.
Obligatory 2: using a Linux VM is the second easiest way.
But to answer your question and manually install CTLS:
Make sure you have the libraries for LibreSSL or OpenSSL installed (using MacPorts, presumably)
Download the latest release of CTLS.
From the release archive, rename macos.pc to ctls.pc and then edit it using a text editor. Change the paths to point to your LibreSSL/OpenSSL installation.
Move the edited ctls.pc into your $PKG_CONFIG_PATH.
I have tested this and it works for me, with the caveat that I installed LibreSSL using Homebrew so I don't know where MacPorts will put it.

CoreServices.h file not found in portaudio build on macOS 10.11 Xcode 8.0

This is called though cocoa.h and foundation.h, then NSURLError.h. Not sure why this compiler error just came up when I added portaudio and some other needed frameworks. The error first comes from some existing code. Indeed, there is no CoreServices/CoreServices.h anywhere on the whole system. Do I need to update Xcode?
I found an Apple help answer that said "Those are not makefile directives. How are you trying to build it? Most projects like this come with "configure" scripts that you just need to run from the command line. The only thing you need from Xcode are the Command Line Tools." I don't know what this means or how to do this.
I did run the port audio/configure terminal script, but saw nothing about CoreServices.h being generated. Where does this need to come from?
Thanks.
I further note that in the CoreServices frameworks directory associated with the Xcode project, there is a terminal file called "CoreServices" that when run, generates the error "CoreServices.framework/Versions/A/CoreServices: cannot execute binary file" . What could it be missing?
It's hard to answer your question in this specific case but:
I believe that CoreServices.h can be found at /System/Library/Frameworks/CoreServices.framework/Versions/A/Headers/CoreServices.h, is it not the case on your machine? If not, you might have to re-install Xcode
To install PortAudio, you can also use brew with the command brew install portaudio and then link your project with its headers and libs (/usr/local/Cellar/portaudio/19.6.0/include and /usr/local/Cellar/portaudio/19.6.0/lib) in your Xcode project (under the tab Build Phases > Link Binary with Libraries). That might be the easiest option.

How do I fix JavaHL (JNI) Not available after I have changed the logon password on my Mac?

I have installed Eclipse 3.5.2 and the plugin Subversion JavaHL Native Library Adapter 1.6.9.2 and this worked without any problems. However, this morning I was forced to change the password to logon to my Mac and since then I get the message that "Subversion native library not available" when I try to save any changes. Can anyone help? I have tried to add this line (-Djava.library.path=/usr/lib/jni) to the eclipse.ini file but this didnĀ“t seem to make any difference.
Can anyone help?
Install MacPorts or HomeBrew, then run the following command:
For MacPorts, the commands to run are:
sudo port install subversion-javahlbindings +no_bdb +universal
For HomeBrew, the command is:
brew install --universal --java subversion
I was having a similar problem on Mac OS X Snow Leopard. I suspect your libraries are there but just need permissions changed, whereas I didn't have the libs at all.
The directory to check is /opt/subversion/lib, see if it has any libsvnjavahl files. In your case they may be there and just need new permissions.
To get the files I followed the the instructions they give for installing JavaHL on OS X, which is to download and install Open CollabNet. (login required, although it's free)
Then you just need to update your environment variable in .profile, something like:
export PATH=.:/opt/subversion/bin:$HOME/bin:$PATH
Then ran:
. .profile
Then I tested with javahltests.jar as mentioned here.
The easiest thing to do is download and install the OSX package that is provided on openCollabNet.
MacPorts also provides an easy Subversion and JavaHL package, however on Snow Leopard ?MacPorts is still compiling these packages as simple 32-bit binaries. If you use the default Snow Leopard JVM which is 64-bit you will get an error...
Failed to load JavaHL Library.
These are the errors that were encountered:
no libsvnjavahl-1 in java.library.path
no svnjavahl-1 in java.library.path
/opt/local/lib/libsvnjavahl-1.0.0.0.dylib: no suitable image found. Did find: /opt/local/lib/libsvnjavahl-1.0.0.0.dylib: mach-o, but wrong architecture
Note the error about wrong architecture. This is because the 64-bit JVM cannot load a 32-bit native library. The ?CollabNet binaries for OSX do not have this problem because they include both 32-bit and 64-bit versions.
Source: subclipse.tigris.org
Here is a blog entry that gives a solution:
http://blog.mattwoodward.com/getting-rid-of-subversion-native-library-not
I don't know whether this will work in your particular situation, but it's worth a try.
(Edited to fix link that became broken after I posted. The link became broken sometime between May 3 and June 1.)
In case you already have subversion installed I'd recommend performing first a brew uninstall and then the install again. And follow the steps to create the links indicated after the install concludes. This worked for me. Regards
I fixed it installing the SVNKit Client Adapter (not required) package.