diff scripts/pkg/pkg.m @ 21518:2ee20a290d61

pkg build: complete rewrite of the logic behind binary packages. * pkg/private/build.m: this functions prepares a "binary" package. This rewrite is triggered to fix bug #45369 (do not move installed PKG_ADD and PKG_DEL files into root of the binary package) but changes the whole underlying logic of binary packages. Previously, "pkg build" would install a package into a specific directory and then created a package by making a tarball of it. This worked because the build files would go into a arch dependent directory inside inst/ which is just copied. Anyway, this is a complex process and sometimes almost impossible because all files besides the .m and .oct files need to be moved back to their original place. The main current problem is with PKG_ADD and PKG_DEL files (see bugs #45362, #45091, and #45369). In addition, it can also lead to duplication of PKG_ADD commands (because the process of installing a package parses .m files for PKG_ADD directives so they will appear on a PKG_ADD file. During installation of the binary package, the PKG_ADD directives would be readded to the file). Another issue is that it only works because the arch dependent directory is nested within the arch independent directory. Since that should not be, it will stop work once that gets fixed. Anyway, the whole reason for a "binary" package is to avoid a build which may require mkoctfile and C++ compilers (in theory it could also avoid generating doc-cache but in practice that is currently not done). So all we have to do is: do the build, remove the configure and Makefile, repackage everything with the oct and mex files. * pkg/private/repackage.m: remove unused function (it was used by build()) to create a binary package from an installed package. * pkg/private/configure_make.m: split into two parts. The first (which remains configure_make()) only really calls configure and make (and is used by build()). The rest is moved to the new function copy_built_files(). The split allows this function to be used by build. * pkg/private/copy_built_files.m: new function with the code moved from configure_make (it is used in install() only). * pkg/private/install.m: add call to copy_built_files which was previously part of configure_make. * pkg.m: adjust call to build(). * pkg/module.mk: remove repackage.m; add copy_built_files.m.
author Carnë Draug <carandraug@octave.org>
date Mon, 21 Mar 2016 00:02:43 +0000
parents 1da428cbf401
children f7f97d7e9294
line wrap: on
line diff
--- a/scripts/pkg/pkg.m	Mon Mar 21 22:37:34 2016 -0400
+++ b/scripts/pkg/pkg.m	Mon Mar 21 00:02:43 2016 +0000
@@ -527,7 +527,7 @@
       if (numel (files) < 2)
         error ("pkg: build action requires build directory and at least one filename");
       endif
-      build (files, deps, auto, verbose);
+      build (files{1}, files(2:end), verbose);
 
     case "describe"
       if (isempty (files))