diff --git a/.gitignore b/.gitignore index d6d47929120f8f..10dcdd23cb7eb4 100644 --- a/.gitignore +++ b/.gitignore @@ -284,6 +284,7 @@ __pycache__/ *.code-workspace /buildtrees/ /build*/ +/bt/ /downloads/ /installed*/ /vcpkg_installed*/ diff --git a/InstallPackagesForLinux.py b/InstallPackagesForLinux.py new file mode 100644 index 00000000000000..ea62144dfc1de7 --- /dev/null +++ b/InstallPackagesForLinux.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python + +import os +import subprocess + +packageList = [ + ([ + 'boost-asio[core,ssl]', + 'boost-locale[core,icu]', + 'boost-mpi[core]', + 'boost-odeint[core,mpi]', + 'boost-regex[core,icu]', + 'boost[core,mpi]', + 'icu[core,tools]', + 'mp3lame', + 'mpi', + 'sqlite3[core,json1,tool,zlib]', + 'sqlitecpp', + 'strtk' + ], False), +] + +def InstallPackagesWorker(packages, triplet, recurse): + args = [] + args.append("./vcpkg") + args.append("install") + args.extend(packages) + args.append("--triplet") + args.append(triplet) + if (recurse): + args.append("--recurse") + try: + seperator = ' ' + print("Calling '%s'." % seperator.join(args)) + subprocess.check_call(args) + return True + except subprocess.CalledProcessError as err: + return False + except OSError as err: + return False + +def InstallPackages(packages, recurse): + print() + print("################################################################################") + print("Installing packages: %s" % packages) + print("################################################################################") + print() + ret = InstallPackagesWorker(packages, "x64-linux", recurse) + print() + return ret + +def InstallPackagesInPackageList(): + for package in packageList: + ret = InstallPackages(package[0], package[1]) + if ret == False: + return False + return True + +InstallPackagesInPackageList() diff --git a/InstallPackagesForMSYS2.py b/InstallPackagesForMSYS2.py new file mode 100644 index 00000000000000..ef760344df56f0 --- /dev/null +++ b/InstallPackagesForMSYS2.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +import os +import subprocess +import sys + +packageList = [ + ([ + 'wil' + ], False), +] + +def GetScriptFile() -> str: + """Obtains the full path and file name of the Python script.""" + if (hasattr(GetScriptFile, "file")): + return GetScriptFile.file + ret: str = "" + try: + # The easy way. Just use __file__. + # Unfortunately, __file__ is not available when cx_freeze is used or in IDLE. + ret = os.path.realpath(__file__) + except NameError: + # The hard way. + if (len(sys.argv) > 0 and len(sys.argv[0]) > 0 and os.path.isabs(sys.argv[0])): + ret = os.path.realpath(sys.argv[0]) + else: + ret = os.path.realpath(inspect.getfile(GetScriptFile)) + if (not os.path.exists(ret)): + # If cx_freeze is used the value of the ret variable at this point is in + # the following format: {PathToExeFile}\{NameOfPythonSourceFile}. This + # makes it necessary to strip off the file name to get the correct path. + ret = os.path.dirname(ret) + GetScriptFile.file: str = ret + return GetScriptFile.file + +def GetScriptDirectory() -> str: + """Obtains the path to the directory containing the script.""" + if (hasattr(GetScriptDirectory, "dir")): + return GetScriptDirectory.dir + module_path: str = GetScriptFile() + GetScriptDirectory.dir: str = os.path.dirname(module_path) + return GetScriptDirectory.dir + +def InstallPackagesWorker(packages, triplet, recurse): + args = [] + args.append("vcpkg") + args.append("install") + args.extend(packages) + args.append("--triplet") + args.append(triplet) + args.append("--x-buildtrees-root=%s/bt" % GetScriptDirectory()) + if (recurse): + args.append("--recurse") + try: + seperator = ' ' + print("Calling '%s'." % seperator.join(args)) + subprocess.check_call(args) + return True + except subprocess.CalledProcessError as err: + return False + except OSError as err: + return False + +def GetTriplet(): + system = os.environ.get('MSYSTEM', "") + if (system == "MINGW64"): + return "x64-mingw-dynamic" + if (system == "MINGW32"): + return "x86-mingw-dynamic" + return "" + +def InstallPackages(packages, recurse): + triplet = GetTriplet() + if (len(triplet) == 0): + return False + print() + print("################################################################################") + print("Installing packages: %s" % packages) + print("################################################################################") + print() + ret = InstallPackagesWorker(packages, "x64-windows", recurse) + return ret + +def InstallPackagesInPackageList(): + for package in packageList: + ret = InstallPackages(package[0], package[1]) + if ret == False: + return False + return True + +InstallPackagesInPackageList() diff --git a/InstallPackagesForWindows.py b/InstallPackagesForWindows.py new file mode 100644 index 00000000000000..41c4400b8efe13 --- /dev/null +++ b/InstallPackagesForWindows.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python + +import inspect +import os +import subprocess +import sys + +x64OnlyPackageList = [ + 'crashpad', 'eathread', 'folly[bzip2,zlib,zstd]', 'foonathan-lexy', 'qt[default-features]', 'qtspeech', 'qwt', 'yasm-tool', 'yasm-tool-helper' +] + +x86OnlyPackageList = [ +] + +packageList = [ + ([ + 'boost-asio[core,ssl]', + 'boost-locale[core,icu]', + 'boost-mpi[core,python3]', + 'boost-odeint[core,mpi]', + 'boost-regex[core,icu]', + 'boost[core,mpi]', + 'icu[core,tools]', + 'imgui[core,win32-binding]', + 'mp3lame', + 'mpi', + 'ms-gsl', + 'openal-soft', + 'portaudio', + 'python3', + 'sdl2-gfx', + 'sdl2-image[core,libjpeg-turbo,libwebp,tiff]', + 'sdl2-mixer[core,mpg123]', + 'sdl2-net', + 'sdl2-ttf', + 'sdl2', + 'sdl2pp', + 'sqlite3[core,json1,tool,zlib]', + 'sqlitecpp', + 'strtk', + 'tiff[core,cxx,jpeg,lzma,tools,zip]', + 'wil', + 'wtl', + 'wxwidgets[core,example,fonts,media,sound,webview]' + ], False) +] + +def GetScriptFile() -> str: + """Obtains the full path and file name of the Python script.""" + if (hasattr(GetScriptFile, "file")): + return GetScriptFile.file + ret: str = "" + try: + # The easy way. Just use __file__. + # Unfortunately, __file__ is not available when cx_freeze is used or in IDLE. + ret = os.path.realpath(__file__) + except NameError: + # The hard way. + if (len(sys.argv) > 0 and len(sys.argv[0]) > 0 and os.path.isabs(sys.argv[0])): + ret = os.path.realpath(sys.argv[0]) + else: + ret = os.path.realpath(inspect.getfile(GetScriptFile)) + if (not os.path.exists(ret)): + # If cx_freeze is used the value of the ret variable at this point is in + # the following format: {PathToExeFile}\{NameOfPythonSourceFile}. This + # makes it necessary to strip off the file name to get the correct path. + ret = os.path.dirname(ret) + GetScriptFile.file: str = ret + return GetScriptFile.file + +def GetScriptDirectory() -> str: + """Obtains the path to the directory containing the script.""" + if (hasattr(GetScriptDirectory, "dir")): + return GetScriptDirectory.dir + module_path: str = GetScriptFile() + GetScriptDirectory.dir: str = os.path.dirname(module_path) + return GetScriptDirectory.dir + +def common_member(a, b): + a_set = set(a) + b_set = set(b) + if len(a_set.intersection(b_set)) > 0: + return(True) + return(False) + +def InstallPackagesWorker(packages, triplet, recurse): + args = [] + args.append("vcpkg") + args.append("install") + args.extend(packages) + args.append("--triplet") + args.append(triplet) + args.append("--x-buildtrees-root=%s/bt" % GetScriptDirectory()) + if (recurse): + args.append("--recurse") + try: + separator = ' ' + print("Calling '%s'." % separator.join(args)) + subprocess.check_call(args) + return True + except subprocess.CalledProcessError: + return False + except OSError: + return False + +def InstallPackages(packages, recurse): + print() + print("################################################################################") + print("Installing packages: %s" % packages) + print("################################################################################") + print() + if (not common_member(x86OnlyPackageList, packages)): + print("+++++++++++++++++") + print("++ x64-windows ++") + print("+++++++++++++++++") + print() + ret = InstallPackagesWorker(packages, "x64-windows", recurse) + if (not ret): + return False + if (common_member(x64OnlyPackageList, packages)): + return ret + print() + print("+++++++++++++++++") + print("++ x86-windows ++") + print("+++++++++++++++++") + print() + ret = InstallPackagesWorker(packages, "x86-windows", recurse) + print() + return ret + +def InstallPackagesInPackageList(): + for package in packageList: + ret = InstallPackages(package[0], package[1]) + if ret == False: + return False + return True + +InstallPackagesInPackageList() diff --git a/clean.bat b/clean.bat new file mode 100644 index 00000000000000..428992b26b066c --- /dev/null +++ b/clean.bat @@ -0,0 +1,45 @@ +@echo off +setlocal enableextensions + +call :GetBatchFileDirectory _MyDir + +for %%a in ( +"bt" +"buildtrees" +"downloads" +"installed" +"packages" +) do ( + if exist "%_MyDir%\%%~a\." ( + echo Deleting %%~a directory. + rmdir /q /s "%_MyDir%\%%~a" + ) +) + +if exist "%_MyDir%\vcpkg.exe" ( + del /q "%_MyDir%\vcpkg.exe" +) + +endlocal +goto :EOF + +:: +:: GetBatchFileDirectory +:: +:: Gets the name of the directory in which the batch file is located. The directory name will not +:: have a final trailing \ character. +:: +:: The directory name is stored in the environment variable specified by the first parameter of the +:: function. +:: +:GetBatchFileDirectory + set _dir=%~dp0 + set _dir=%_dir:~0,-1% + if "%_dir%" EQU "" ( + set _dir= + exit /b 1 + ) + set %1=%_dir% + set _dir= + exit /b 0 +goto :EOF diff --git a/ports/arabica/CONTROL b/ports/arabica/CONTROL new file mode 100644 index 00000000000000..6fc8a1e612efb1 --- /dev/null +++ b/ports/arabica/CONTROL @@ -0,0 +1,7 @@ +Source: arabica +Version: 2020-April +Homepage: https://github.com/jezhiggins/arabica +Description: Arabica is an XML and HTML processing toolkit, providing SAX2, DOM, XPath, and XSLT implementations, written in Standard C++. +Build-Depends: boost-mpl, boost-type-traits, boost-spirit, boost-function, boost-bind, boost-smart-ptr, boost-lexical-cast, winsock2 (windows) + + diff --git a/ports/arabica/portfile.cmake b/ports/arabica/portfile.cmake new file mode 100644 index 00000000000000..bb0528b6c1d62a --- /dev/null +++ b/ports/arabica/portfile.cmake @@ -0,0 +1,40 @@ +include(vcpkg_common_functions) + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jezhiggins/arabica + REF 2020-April + SHA512 6397b4ba140acb528ae9cca4a29752363fbe694ecb53b00f7301de108cb0792f961239df2aede00ab95b0d06ac2a220071b8cec3c71b3c14ee562b3af7968c82 + HEAD_REF master +) + +set(ARABICA_ROOT ${SOURCE_PATH}) +set(ARABICA_INCLUDE_PATH ${ARABICA_ROOT}/include) + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_ARABICA_EXAMPLES=OFF + -DBUILD_WITH_BOOST=ON + "-DCMAKE_CXX_FLAGS=-DARABICA_NO_CODECVT_SPECIALISATIONS=1 -DARABICA_USE_WINSOCK=1 -DARABICA_WINDOWS=1" + -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON + ) +else() + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_ARABICA_EXAMPLES=OFF + -DBUILD_WITH_BOOST=ON + ) +endif() + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/arabica RENAME copyright) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") diff --git a/ports/uberswitch/portfile.cmake b/ports/uberswitch/portfile.cmake new file mode 100644 index 00000000000000..b09c5a99bdc604 --- /dev/null +++ b/ports/uberswitch/portfile.cmake @@ -0,0 +1,15 @@ +# header-only library + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO falemagn/uberswitch + REF 104cb49ac00212140c6304f84057b0502690957b + SHA512 fcfee10d2eced184e45bcaab55a3bf0f4e888bf5c90f1e57aae6171f58ce039e0eff75cb2edde3d57118050efff5fae2aed0c19f91292f190ba0cc6f330f70d7 + HEAD_REF master +) + +file(INSTALL ${SOURCE_PATH}/include/uberswitch/uberswitch.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include/uberswitch) +file(INSTALL ${SOURCE_PATH}/include/uberswitch/fameta/counter.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include/uberswitch/fameta) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ports/uberswitch/vcpkg.json b/ports/uberswitch/vcpkg.json new file mode 100644 index 00000000000000..45580dee10e6bd --- /dev/null +++ b/ports/uberswitch/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "uberswitch", + "description": "A header-only, unobtrusive, almighty alternative to the C++ switch statement that looks just like the original.", + "homepage": "https://github.com/falemagn/uberswitch", + "port-version": 1, + "version-string": "2022-05-17" +} diff --git a/update-env.bat b/update-env.bat new file mode 100644 index 00000000000000..19e8a5789927ff --- /dev/null +++ b/update-env.bat @@ -0,0 +1,129 @@ +@echo off +set _ShowDebugMessages=%~1 +if "%_ShowDebugMessages%" equ "" set _ShowDebugMessages=no + +set _IncludeMSYS64=%~2 +if "%_IncludeMSYS64%" equ "" set _IncludeMSYS64=no + + +call :GetBatchFileDirectory _MyDir +call :SetOPT +if not defined OPT goto :EOF + +set DOTNET_VERSION=8.0.202 +set HOME=%LOCALAPPDATA%\Home +set JDK_HOME=C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot +set JDK_HOME_X64=C:\Program Files\Eclipse Adoptium\jdk-21.0.2.13-hotspot +set JDK_HOME_X86=C:\Program Files (x86)\Eclipse Adoptium\jdk-19.0.2.7-hotspot +set PANDOC_EXE=%LOCALAPPDATA%\Pandoc\pandoc.exe +set VCPKG_FEATURE_FLAGS=-binarycaching +set VCPKG_ROOT=%_MyDir% +set CMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems.vcpkg.cmake + +for %%a in ( +"%_MyDir%\installed\%Platform%-windows\tools\icu\bin" +"%_MyDir%\downloads\tools\7zip-23.01-windows\x64" +"%_MyDir%\downloads\tools\cmake-3.29.0-windows\cmake-3.29.0-windows-i386\bin" +"%_MyDir%\downloads\tools\jom\jom-1_1_4" +"%_MyDir%\downloads\tools\nasm\nasm-2.16.01" +"%_MyDir%\downloads\tools\perl\5.38.0.1\c\bin" +"%_MyDir%\downloads\tools\perl\5.38.0.1\c\i686-w64-mingw32\bin" +"%_MyDir%\downloads\tools\perl\5.38.0.1\perl\site\bin" +"%_MyDir%\downloads\tools\perl\5.38.0.1\perl\bin" +"%_MyDir%\downloads\tools\python\python-3.11.8-%Platform%" +"%ProgramW6432%\Beyond Compare 4" +"%ProgramW6432%\Git\cmd" +"%SystemDrive%\Perl64\c\bin" +"%SystemDrive%\Perl64\perl\site\bin" +"%SystemDrive%\Perl64\perl\bin" +"%JDK_HOME%\bin" +"%JDK_HOME%\bin\server" +"%ProgramW6432%\dotnet" +"%ProgramW6432%\dotnet\sdk\%DOTNET_VERSION%" +"%USERPROFILE%\.dotnet\tools" +"%ProgramW6432%\LLVM\bin" +"%ProgramW6432%\LLVM\share\clang" +"%ProgramW6432%\nodejs" +"%ProgramW6432%\Perforce" +"%ProgramW6432%\PowerShell\7" +"%ProgramW6432%\Python312" +"%ProgramW6432%\TortoiseSVN\bin" +"%LOCALAPPDATA%\Pandoc" +"%ProgramFiles(x86)%\Poedit" +"%ProgramFiles(x86)%\Poedit\GettextTools\bin" +"%LOCALAPPDATA%\Programs\Microsoft VS Code" +"%OPT%\Apache-Subversion-1.14.2\bin" +"%OPT%\bin\X64" +"%OPT%\bin\X86" +"%OPT%\ExamDiff" +"%OPT%\Scripts" +) do ( + call :AppendToPathIfExists "%%~a" +) + +call :AddMSYS64 + +goto :EOF + +:: +:: GetBatchFileDirectory +:: +:: Gets the name of the directory in which the batch file is located. The directory name will not +:: have a final trailing \ character. +:: +:: The directory name is stored in the environment variable specified by the first parameter of the +:: function. +:: +:GetBatchFileDirectory + set _dir=%~dp0 + set _dir=%_dir:~0,-1% + if "%_dir%" EQU "" ( + set _dir= + exit /b 1 + ) + set %1=%_dir% + set _dir= + exit /b 0 +goto :EOF + +:: +:: Searches for the OPT directory and sets the OPT environment variable to the +:: found directory. +:: +:: The OPT directory will be in the root directory of the hard drive but it may +:: be installed on any hard drive. +:: +:SetOPT + if defined OPT exit /b 0 + for %%a in (c d e f g h i j k l m n o p q r s t u v w x y z) do ( + if exist "%%a:\opt\." ( + set OPT=%%a:\opt + exit /b 0 + ) + ) + exit /b 1 +goto :EOF + +:AppendToPathIfExists + if exist "%~1\." call :ShowDebugMessage "Adding '%~1' to the path." + if not exist "%~1\." call :ShowDebugMessage "'%~1' does not exist." + if exist "%~1\." set PATH=%PATH%;%~1 +goto :EOF + +:ShowDebugMessage + if "%_ShowDebugMessages%" neq "yes" exit /b 1 + echo %~1 +goto :EOF + +:AddMSYS64 + if "%_IncludeMSYS64%" neq "yes" exit /b 1 + for %%a in ( + "%SystemDrive%\msys64\mingw64\local\bin" + "%SystemDrive%\msys64\mingw64\opt\bin" + "%SystemDrive%\msys64\mingw64\bin" + "%SystemDrive%\msys64\usr\local\bin" + "%SystemDrive%\msys64\usr\bin" + ) do ( + call :AppendToPathIfExists "%%~a" + ) +goto :EOF diff --git a/vcpkg-env.el b/vcpkg-env.el new file mode 100644 index 00000000000000..a4c2a51814a38c --- /dev/null +++ b/vcpkg-env.el @@ -0,0 +1,150 @@ +(require 'cl-lib) +(require 'yekneb-constants) +(require 'yekneb-debug) +(require 'yekneb-env) +(require 'yekneb-path-manip) + +(defconst vcpkg--add-to-path-windows + '( + "${VCPKG_ROOT}/downloads/tools/cmake-3.29.0-windows/cmake-3.29.0-windows-i386/bin" + "${VCPKG_ROOT}/downloads/tools/jom/jom-1_1_4" + "${VCPKG_ROOT}/downloads/tools/nasm/nasm-2.16.01" + "${VCPKG_ROOT}/downloads/tools/perl/5.38.0.1/c/bin" + "${VCPKG_ROOT}/downloads/tools/perl/5.38.0.1/c/i686-w64-mingw32/bin" + "${VCPKG_ROOT}/downloads/tools/perl/5.38.0.1/perl/site/bin" + "${VCPKG_ROOT}/downloads/tools/perl/5.38.0.1/perl/bin" + "${VCPKG_ROOT}/downloads/tools/python/python-3.11.8-${Platform}" + "${VCPKG_ROOT}/installed/${Platform}-windows/bin" + "${VCPKG_ROOT}/installed/${Platform}-windows/tools" + ) + "Directories to add to the path for Windows." + ) + +(defconst vcpkg--add-to-path-linux + '( + "${VCPKG_ROOT}/downloads/tools/cmake-3.29.0-linux/cmake-3.29.0-linux-x86_64/bin" + "${VCPKG_ROOT}/downloads/tools/ninja/1.10.2-linux" + "${VCPKG_ROOT}/installed/${Platform}-linux/tools" + ) + "Directories to add to the path for Linux." + ) + +(defun update-environment-for-vcpkg-windows () + "Updates the environment for VCPKG on Windows." + (let + ( + (yekneb-debug-level (if init-file-debug yekneb-log-debug yekneb-log-entry)) + (load-file-dir (file-name-directory load-file-name)) + (platform nil) + (tool-dirs nil) + (tools-dir "${VCPKG_ROOT}/installed/${Platform}-windows/tools") + (poedit-dirs + '( + "${ProgramFiles(x86)}/Poedit" + "${ProgramFiles(x86)}/Poedit/GettextTools/bin" + ) + ) + ) + (setq + platform + (cond + (yekneb-32-bit-system-p + "x86" + ) + (yekneb-64-bit-system-p + "x64" + ) + (t + nil) + ) + ) + (when platform + (yekneb-log yekneb-log-info "Setting Platform to '%s'." platform) + (yekneb-setenv "Platform" platform) + ) + (setq tools-dir (substitute-env-vars tools-dir)) + (yekneb-log yekneb-log-info "tools-dir is '%s'." tools-dir) + (yekneb-log yekneb-log-info "Adding the directories in vcpkg--add-to-path-windows to the path.") + (yekneb-add-dirs-to-path vcpkg--add-to-path-windows t t load-file-dir) + (yekneb-log yekneb-log-info "Adding the directories in tool-dirs to the path.") + (when (file-directory-p tools-dir) + (setq tool-dirs (directory-files tools-dir)) + (dolist (tool-dir tool-dirs) + (when (and (not (string= tool-dir ".")) (not (string= tool-dir ".."))) + (setq tool-dir (expand-file-name tool-dir tools-dir)) + (when (file-directory-p tool-dir) + (yekneb-add-to-path tool-dir t) + ) + (setq tool-dir (expand-file-name "bin" tool-dir)) + (when (file-directory-p tool-dir) + (yekneb-add-to-path tool-dir t) + ) + ) + ) + ) + (yekneb-log yekneb-log-info "Adding the directories in poedit-dirs to the path.") + (yekneb-add-dirs-to-path poedit-dirs t t load-file-dir) + ) + ) + +(defun update-environment-for-vcpkg-linux () + "Updates the environment for VCPKG on Linux." + (let + ( + (yekneb-debug-level (if init-file-debug yekneb-log-debug yekneb-log-entry)) + (load-file-dir (file-name-directory load-file-name)) + (platform nil) + (tool-dirs nil) + (tools-dir "${VCPKG_ROOT}/installed/${Platform}-linux/tools") + ) + (setq + platform + (cond + (yekneb-32-bit-system-p + "x86" + ) + (yekneb-64-bit-system-p + "x64" + ) + (t + nil) + ) + ) + (when platform + (yekneb-log yekneb-log-info "Setting Platform to '%s'." platform) + (yekneb-setenv "Platform" platform) + ) + (setq tools-dir (substitute-env-vars tools-dir)) + (yekneb-log yekneb-log-info "tools-dir is '%s'." tools-dir) + (yekneb-log yekneb-log-info "Adding the directories in vcpkg--add-to-path-linux to the path.") + (yekneb-add-dirs-to-path vcpkg--add-to-path-linux t t load-file-dir) + (yekneb-log yekneb-log-info "Adding the directories in tool-dirs to the path.") + (when (file-directory-p tools-dir) + (setq tool-dirs (directory-files tools-dir)) + (dolist (tool-dir tool-dirs) + (when (and (not (string= tool-dir ".")) (not (string= tool-dir ".."))) + (setq tool-dir (expand-file-name tool-dir tools-dir)) + (when (file-directory-p tool-dir) + (yekneb-add-to-path tool-dir t) + ) + (setq tool-dir (expand-file-name "bin" tool-dir)) + (when (file-directory-p tool-dir) + (yekneb-add-to-path tool-dir t) + ) + ) + ) + ) + ) + ) + +(defun update-environment-for-vcpkg () + "Updates the environment for VCPKG." + (when (eq system-type 'windows-nt) + (update-environment-for-vcpkg-windows) + ) + (when (eq system-type 'gnu/linux) + (update-environment-for-vcpkg-linux) + ) + ) + +(update-environment-for-vcpkg)