garrigue / lablgtk

LablGTK 2 and 3: an interface to the GIMP Tool Kit
https://garrigue.github.io/lablgtk
Other
89 stars 40 forks source link

"make install" should create missing directories #18

Closed treinen closed 5 years ago

treinen commented 5 years ago

"make install: should create missing directories (usr/lib etc.). This is important when using a nonempty value for DESTDIR since then one cannot assume any already existing directories. Packagers from software distributions use this to install into an empty staging directory.

For instance :

% DESTDIR=/home/treinen make install
make -C src install
make[1]: Entering directory '/home/treinen/projects/lablgtk/src'
mkdir -p "/home/treinen/usr/local/bin"
mkdir -p "/home/treinen/usr/local/lib/ocaml/4.05.0"
touch: cannot touch '/home/treinen/usr/lib/ocaml/ld.conf': No such file or directory
make[1]: *** [Makefile:382: findlib-install] Error 1
make[1]: Leaving directory '/home/treinen/projects/lablgtk/src'
make: *** [Makefile:5: install] Error 2

Here the problem is that /home/treinen/usr/lib does not exist (not the missing "local")

ejgallego commented 5 years ago

Note that using Dune for the Debian build would solve that.

treinen commented 5 years ago

Do you mean that src/Makefile could be replaced by one that just calls dune? That would probably be an improvement for lablgtk in general since the Makefile is quite complex.

ejgallego commented 5 years ago

I think so, of course OMMV, but using a more uniform build system for Debian Ocaml could help; I'll try to finish the Dune port this week [just missing a few extra packages] and we can see.

ejgallego commented 5 years ago

In fact you don't need to replace the makefile, you could just call dune build from the Dunerized Debian setup, and skip the makefile altogether which could be useful for some other platforms. [As I don't have the means to test them]

treinen commented 5 years ago

I dont want to use for debian a completely different build-system than upstream. if the current makefile can be replaced by dune then it is up to upstream to take that decision.

ejgallego commented 5 years ago

I think the plan is to have both systems upstream, so Debian would be free to choose.

garrigue commented 5 years ago

This error came from a wrong use of the --libdir option. Useful directories are created by the Makefile.

treinen commented 5 years ago

There was no --libdir option in the example invocation in the initial bug report.

The Makefile does not always create all useful directories. The problem is that the touch command does not create missing path components. This patch fixes that: lablgtk3-makefile-patch.txt

garrigue commented 5 years ago

OK, I will apply your patch, but it's still confusing: there is only one ld.conf file, which should be in stublibs, and you're not supposed to overwrite it... Maybe it's just that I don't understand well how findlib works.

garrigue commented 5 years ago

Note that your error is still strange: I don't see why your ld.conf would reside is /usr/lib/ocaml, whereas the real ocaml is in /usr/local/lib. There is supposed to be one ocaml ld.conf file by version of ocaml.

garrigue commented 5 years ago

patch applied to master and lablgtk3, commits cc0e08ef and 5c9341d

treinen commented 5 years ago

Thanks.

In fact it is your makefile that directly touches ocaml.ld.conf, and that could fail when DESTDIR is set. I was just fixing this. Besides I don't know either whether that file is useful when installing stuff using findlib.

Concerning /usr/local: When ocaml is installed by the operating system (this includes in particular installation via some distribution, like debian) then it goes into /usr/{lib,bin,...} and not into /usr/local. The operating system is not supposed to install stuff in /usr/local, as stated by the File Hierarchy Standard. /usr/local is for the sysadmin to install additional stuff.