rems-project / lem

Lem semantic definition language
Other
130 stars 15 forks source link

Cannot install to custom destdir #10

Closed emersion closed 6 years ago

emersion commented 6 years ago

The installation is hardcoded to / in ocaml-libs/ocamlbuild.mk. This makes it impossible to build packages for Linux distributions.

emersion commented 6 years ago

More information: calling make install INSTALL_DIR="/tmp" INSTALLDIR="/tmp/usr/lib/ocaml" still tries to install stuff in /usr/lib/ocaml:

==> Starting package()...
make -C ocaml-lib install
make[1]: Entering directory '/home/simon/src/aur-lem-git/src/lem/ocaml-lib'
Makefile:10: warning: overriding recipe for target 'clean'
ocamlbuild.mk:21: warning: ignoring old recipe for target 'clean'
ocamlbuild -build-dir _build_zarith -X local -X dependencies -I num_impl_zarith -use-ocamlfind -pkg zarith extract.cma extract.cmxa
Finished, 142 targets (142 cached) in 00:00:00.
make /usr/lib/ocaml/lem_zarith/META
make[2]: Entering directory '/home/simon/src/aur-lem-git/src/lem/ocaml-lib'
Makefile:10: warning: overriding recipe for target 'clean'
ocamlbuild.mk:21: warning: ignoring old recipe for target 'clean'
ocamlfind remove -destdir /usr/lib/ocaml lem_zarith
ocamlfind: [WARNING] No such file: /usr/lib/ocaml/lem_zarith/META
ocamlfind install -destdir /usr/lib/ocaml -patch-version "86ff2f7" lem_zarith num_impl_zarith/META _build_zarith/extract.cma _build_zarith/extract.cmxa _build_zarith/extract.a `find _build_zarith -name '*.cmi' -o -name '*.cmx' -o -name '*.mli'`
ocamlfind: Cannot mkdir /usr/lib/ocaml/lem_zarith: Permission denied
make[2]: *** [ocamlbuild.mk:43: /usr/lib/ocaml/lem_zarith/META] Error 2
make[2]: Leaving directory '/home/simon/src/aur-lem-git/src/lem/ocaml-lib'
make[1]: *** [ocamlbuild.mk:34: install_zarith] Error 2
make[1]: Leaving directory '/home/simon/src/aur-lem-git/src/lem/ocaml-lib'
make: *** [Makefile:14: install] Error 2
==> ERROR: A failure occurred in package().
    Aborting...
emersion commented 6 years ago

So the error above happened before https://github.com/rems-project/lem/commit/5921b6f54c4fd978ab5a89a96468c18e70d9f6ac

Now that the new branch is merged, the trick works. Here is the package: https://aur.archlinux.org/packages/lem-git/