Takes the environment variable DESTDIR in rake install

If the environment variable `DESTDIR` is set, the writing destination is `<DESTDIR>/<PREFIX>/...`.
It is assumed to be used for package work.
This commit is contained in:
dearblue
2023-02-12 21:02:31 +09:00
parent 0e9a71e50a
commit 3d996a84cc
3 changed files with 6 additions and 1 deletions
+4
View File
@@ -595,6 +595,9 @@ The `PREFIX` environment variable affects all build targets and changes the `/us
The `MRuby::Build#install_prefix` can be set for each individual build target.
In this case, the environment variable `PREFIX` is ignored.
Also, if the environment variable `DESTDIR` is set, it will prepend to the path obtained by `install_prefix` to determine the final write directory.
This is intended for temporary file expansion by the user's package work.
---
To summarize:
@@ -602,6 +605,7 @@ To summarize:
- The default value of the environment variable `PREFIX` is `/usr/local`.
- For the "host" build target, the default value of `MRuby::Build#install_prefix` is `<PREFIX>`.
- For a build target other than "host", the default value of `MRuby::Build#install_prefix` is `<PREFIX>/mruby/<build-name>`.
- If the environment variable `DESTDIR` is set, the actual write directory is `<DESTDIR>/<MRuby::Build#install_prefix>`.
## Tips
+1
View File
@@ -9,6 +9,7 @@ module MRuby
autoload :Presym, "mruby/presym"
INSTALL_PREFIX = ENV['PREFIX'] || ENV['INSTALL_PREFIX'] || '/usr/local'
INSTALL_DESTDIR = ENV['DESTDIR'] || ''
class << self
def targets
+1 -1
View File
@@ -13,7 +13,7 @@ task "install:bin"
MRuby.each_target do |build|
next if build.internal?
prefix = build.install_prefix
prefix = File.join(MRuby::INSTALL_DESTDIR, build.install_prefix)
task "install:full" => "install:full:#{build.name}"