VirtualBox

Changeset 3345 in kBuild for trunk


Ignore:
Timestamp:
May 22, 2020 2:23:56 PM (5 years ago)
Author:
bird
Message:

tools/7ZIP.kmk: Adding 7-Zip unpacker tool.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/tools/7ZIP.kmk

    r3332 r3345  
    11# $Id$
    22## @file
    3 # kBuild Tool Config - tar unpacker.
     3# kBuild Tool Config - 7-Zip unpacker.
    44#
    55
    66#
    7 # Copyright (c) 2006-2017 knut st. osmundsen <[email protected]>
     7# Copyright (c) 2006-2020 knut st. osmundsen <[email protected]>
    88#
    99# This file is part of kBuild.
     
    3232#
    3333
    34 TOOL_TAR := tar unpacker.
     34TOOL_7ZIP := 7-Zip unpacker.
    3535
    3636# Tool Specific Properties
    37 ifndef TOOL_TAR_TAR
    38  TOOL_TAR_TAR := $(wildcard $(KBUILD_DEVTOOLS_HST)/tar/v*/tar$(HOSTSUFF_EXE))
    39  ifeq ($(TOOL_TAR_TAR),)
    40   TOOL_TAR_TAR := $(wildcard $(KBUILD_DEVTOOLS_HST)/bin/tar$(HOSTSUFF_EXE))
     37ifndef TOOL_7ZIP_7Z
     38 TOOL_7ZIP_7Z := $(wildcard $(KBUILD_DEVTOOLS_HST)/7zip/v*/7z$(HOSTSUFF_EXE))
     39 ifeq ($(TOOL_7ZIP_7Z),)
     40  TOOL_7ZIP_7Z := $(wildcard $(KBUILD_DEVTOOLS_HST)/bin/7z$(HOSTSUFF_EXE))
    4141 endif
    42  ifneq ($(TOOL_TAR_TAR),)
    43   TOOL_TAR_TAR := $(lastword $(sort $(TOOL_TAR_TAR)))
     42 ifneq ($(TOOL_7ZIP_7Z),)
     43  TOOL_7ZIP_7Z := $(lastword $(sort $(TOOL_7ZIP_7Z)))
    4444 else
    45   TOOL_TAR_TAR := tar$(HOSTSUFF_EXE)
     45  TOOL_7ZIP_7Z := 7z$(HOSTSUFF_EXE)
    4646 endif
    4747else
    48  TOOL_TAR_TAR := $(TOOL_TAR_TAR)
     48 TOOL_7ZIP_7Z := $(TOOL_7ZIP_7Z)
    4949endif
    50 TOOL_TAR_UNPACK ?= $(TOOL_TAR_TAR)
     50TOOL_7ZIP_UNPACK ?= $(TOOL_7ZIP_7Z)
    5151
    5252# General Properties used by kBuild
    53 TOOL_TAR_UNPACKFLAGS ?=
     53TOOL_7ZIP_UNPACKFLAGS ?=
    5454
    5555## UNPACK one file.
     
    5959# @param        $(inst)         Where to unpack it.
    6060# @param        $(out)          Where to write the file list.
    61 TOOL_TAR_UNPACK_OUTPUT =
    62 TOOL_TAR_UNPACK_DEPEND =
    63 TOOL_TAR_UNPACK_DEPORD =
    64 ifeq ($(KBUILD_HOST),win) # hacking with buggy unxutils on windows. it doesn't like driver letters.
    65 define TOOL_TAR_UNPACK_CMDS
    66         $(QUIET)$(TOOL_TAR_UNPACK) -x $(flags) -C $(subst G:,,$(inst)) -f $(archive)
    67         $(QUIET)$(TOOL_TAR_UNPACK) -t $(filter-out -v --verbose,$(flags)) -f $(archive) > $(out)
     61TOOL_7ZIP_UNPACK_OUTPUT =
     62TOOL_7ZIP_UNPACK_DEPEND =
     63TOOL_7ZIP_UNPACK_DEPORD =
     64define TOOL_7ZIP_UNPACK_CMDS
     65        $(QUIET)$(TOOL_7ZIP_UNPACK) x $(flags) -o"$(inst)" "$(archive)"
     66        $(QUIET)$(TOOL_7ZIP_UNPACK) l $(filter-out -bb%,$(flags)) "$(archive)" \
     67        | $(SED) \
     68                -e '1,/-------------------/d' \
     69                -e '/-------------------/,$$(DOLLAR)d' \
     70                -e '/^[^ ]* [^ ]* D/d' \
     71                -e 's/^.................................................... *//'  \
     72                -e 's,\\,/,g' \
     73                --output $(out)
    6874endef
    69 else
    70 define TOOL_TAR_UNPACK_CMDS
    71         $(QUIET)$(TOOL_TAR_UNPACK) -x $(flags) -C $(inst) -f $(archive)
    72         $(QUIET)$(TOOL_TAR_UNPACK) -t $(filter-out -v --verbose,$(flags)) -f $(archive) > $(out)
    73 endef
    74 endif
    7575
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette