Compare commits

..

No commits in common. "38ae507a708aa490d6f63e30206da96bc3ae3b52" and "6766576bbc281b095105cb26112e3dac419f9970" have entirely different histories.

View File

@ -1,30 +1,12 @@
# Copyright 2020-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: windows-helper.eclass
# @MAINTAINER:
# moog621@gmail.com
# @AUTHOR:
# moog621@gmail.com
# @SUPPORTED_EAPIS: 7
# @BLURB: Helper functions for dealing with Windows.
# @DESCRIPTION:
# This class will provide functions and build dependencies which will help with problems typical when dealing with Windows in the context of ebuilds.
BDEPEND+=" BDEPEND+="
sys-apps/sed sys-apps/sed
sys-apps/coreutils sys-apps/coreutils
" "
# @FUNCTION: windowshelper_convert_normal_path_to_windows_path
# @USAGE: <path>
# @DESCRIPTION:
# This function expects a single argument - a path, nevermind if absolute or relative, because it will be implicitly converted to an absolute path.
# This function will produce a standard output comprised of the above path converted to a Windows path. Since the path is an absolute one, it will point to an analogous path in the Z: drive, which makes this path readily usable by Wine.
windowshelper_convert_normal_path_to_windows_path() { windowshelper_convert_normal_path_to_windows_path() {
local abs_path="${1}" local abs_path="$1"
if ! [[ "${1}" =~ '^\/' ]]; then if ! [[ "$1" =~ '^\/' ]]; then
abs_path=$(readlink -f "${1}") abs_path=$(readlink -f "$1")
fi fi
echo "${abs_path}" | sed 's_^_Z:_;s_/_\\_g' echo "${abs_path}" | sed 's_^_Z:_;s_/_\\_g'
} }