text:
#[===[.md:
# vcpkg_find_acquire_program

Download or find a well-known tool.

## Usage
```cmake
vcpkg_find_acquire_program(<program>)
```
## Parameters
### program
This variable specifies both the program to be acquired as well as the out parameter that will be set to the path of the program executable.

## Notes
The current list of programs includes:

* 7Z
* ARIA2 (Downloader)
* BISON
* CLANG
* DARK
* DOXYGEN
* FLEX
* GASPREPROCESSOR
* GPERF
* PERL
* PYTHON2
* PYTHON3
* GIT
* GN
* GO
* JOM
* MESON
* NASM
* NINJA
* NUGET
* SCONS
* SWIG
* YASM

Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md).

## Examples

* [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake)
* [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake)
* [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake)
#]===]

function(z_vcpkg_find_acquire_program_version_check out_var)
    cmake_parse_arguments(PARSE_ARGV 1 arg
        "EXACT_VERSION_MATCH"
        "MIN_VERSION;PROGRAM_NAME"
        "COMMAND"
    )
    vcpkg_execute_in_download_mode(
        COMMAND ${arg_COMMAND}
        WORKING_DIRECTORY "${VCPKG_ROOT_DIR}"
        OUTPUT_VARIABLE program_version_output
    )
    string(STRIP "${program_version_output}" program_version_output)
    #TODO: REGEX MATCH case for more complex cases!
    set(version_compare VERSION_GREATER_EQUAL)
    set(version_compare_msg "at least")
    if(arg_EXACT_VERSION_MATCH)
        set(version_compare VERSION_EQUAL)
        set(version_compare_msg "exact")
    endif()
    if(NOT "${program_version_output}" ${version_compare} "${arg_MIN_VERSION}")
        message(STATUS "Found ${arg_PROGRAM_NAME}('${program_version_output}') but ${version_compare_msg} version ${arg_MIN_VERSION} is required! Trying to use internal version if possible!")
        set("${out_var}" OFF PARENT_SCOPE)
    else()
        message(STATUS "Found external ${arg_PROGRAM_NAME}('${program_version_output}').")
        set("${out_var}" ON PARENT_SCOPE)
    endif()
endfunction()

function(z_vcpkg_find_acquire_program_find_external program)
    cmake_parse_arguments(PARSE_ARGV 1 arg
        "EXACT_VERSION_MATCH"
        "INTERPRETER;MIN_VERSION;PROGRAM_NAME"
        "NAMES;VERSION_COMMAND"
    )
    if(arg_EXACT_VERSION_MATCH)
        set(arg_EXACT_VERSION_MATCH EXACT_VERSION_MATCH)
    endif()

    if("${arg_INTERPRETER}" STREQUAL "")
        find_program("${program}" NAMES ${arg_NAMES})
    else()
        find_file(SCRIPT_${arg_PROGRAM_NAME} NAMES ${arg_NAMES})
        if(SCRIPT_${arg_PROGRAM_NAME})
            vcpkg_list(SET program_tmp ${${interpreter}} ${SCRIPT_${arg_PROGRAM_NAME}})
            set("${program}" "${program_tmp}" CACHE INTERNAL "")
        else()
            set("${program}" "" CACHE INTERNAL "")
        endif()
        unset(SCRIPT_${arg_PROGRAM_NAME} CACHE)
    endif()

    if("${version_command}" STREQUAL "")
        set(version_is_good ON) # can't check for the version being good, so assume it is
    elseif(${program}) # only do a version check if ${program} has a value
        z_vcpkg_find_acquire_program_version_check(version_is_good
            ${arg_EXACT_VERSION_MATCH}
            COMMAND ${${program}} ${arg_VERSION_COMMAND}
            MIN_VERSION "${arg_MIN_VERSION}"
            PROGRAM_NAME "${arg_PROGRAM_NAME}"
        )
    endif()

    if(NOT version_is_good)
        unset("${program}" PARENT_SCOPE)
        unset("${program}" CACHE)
    endif()
endfunction()

function(z_vcpkg_find_acquire_program_find_internal program)
    cmake_parse_arguments(PARSE_ARGV 1 arg
        ""
        "INTERPRETER"
        "NAMES;PATHS"
    )
    if("${arg_INTERPRETER}" STREQUAL "")
        find_program(${program}
            NAMES ${arg_NAMES}
            PATHS ${arg_PATHS}
            NO_DEFAULT_PATH)
    else()
        vcpkg_find_acquire_program("${arg_INTERPRETER}")
        find_file(SCRIPT_${program}
            NAMES ${arg_NAMES}
            PATHS ${arg_PATHS}
            NO_DEFAULT_PATH)
        if(SCRIPT_${program})
            set("${program}" ${${arg_INTERPRETER}} ${SCRIPT_${program}} CACHE INTERNAL "")
        endif()
        unset(SCRIPT_${program} CACHE)
    endif()
endfunction()

function(vcpkg_find_acquire_program program)
    if(${program})
        return()
    endif()

    set(raw_executable "OFF")
    set(program_name "")
    set(program_version "")
    set(search_names "")
    set(download_urls "")
    set(download_filename "")
    set(download_sha512 "")
    set(rename_binary_to "")
    set(tool_subdirectory "")
    set(interpreter "")
    set(supported_on_unix "")
    set(post_install_command "")
    set(paths_to_search "")
    set(version_command "")
    vcpkg_list(SET sourceforge_args)
    set(brew_package_name "")
    set(apt_package_name "")

    if(program STREQUAL "PERL")
        set(program_name perl)
        set(program_version 5.32.1.1)
        set(tool_subdirectory ${program_version})
        set(paths_to_search ${DOWNLOADS}/tools/perl/${tool_subdirectory}/perl/bin)
        set(brew_package_name "perl")
        set(apt_package_name "perl")
        set(download_urls
            "https://strawberryperl.com/download/${program_version}/strawberry-perl-${program_version}-32bit.zip"
        )
        set(download_filename "strawberry-perl-${program_version}-32bit.zip")
        set(download_sha512 936381254fea2e596db6a16c23b08ced25c4081fda484e1b8c4356755016e4b956bd00f3d2ee651d5f41a7695e9998f6c1ac3f4a237212b9c55aca8c5fea14e9)
    elseif(program STREQUAL "NASM")
        set(program_name nasm)
        set(program_version 2.15.05)
        set(paths_to_search "${DOWNLOADS}/tools/nasm/nasm-${program_version}")
        set(brew_package_name "nasm")
        set(apt_package_name "nasm")
        set(download_urls
            "https://www.nasm.us/pub/nasm/releasebuilds/${program_version}/win32/nasm-${program_version}-win32.zip"
            "https://fossies.org/windows/misc/nasm-${program_version}-win32.zip"
        )
        set(download_filename "nasm-${program_version}-win32.zip")
        set(download_sha512 9412b8caa07e15eac8f500f6f8fab9f038d95dc25e0124b08a80645607cf5761225f98546b52eac7b894420d64f26c3cbf22c19cd286bbe583f7c964256c97ed)
    elseif(program STREQUAL "YASM")
        set(program_name yasm)
        set(program_version 1.3.0.6.g1962)
        set(tool_subdirectory 1.3.0.6)
        set(brew_package_name "yasm")
        set(apt_package_name "yasm")
        set(download_urls "https://www.tortall.net/projects/yasm/snapshots/v${program_version}/yasm-${program_version}.exe")
        set(download_filename "yasm-${program_version}.exe")
        set(rename_binary_to "yasm.exe")
        set(raw_executable ON)
        set(download_sha512 c1945669d983b632a10c5ff31e86d6ecbff143c3d8b2c433c0d3d18f84356d2b351f71ac05fd44e5403651b00c31db0d14615d7f9a6ecce5750438d37105c55b)
    elseif(program STREQUAL "GIT")
        set(program_name git)
        if(CMAKE_HOST_WIN32)
            set(base_version 2.32.0)
            set(program_version 2.32.0.2)
            set(tool_subdirectory "git-${program_version}-2-windows")
            set(download_urls "https://github.com/git-for-windows/git/releases/download/v${base_version}.windows.2/PortableGit-${program_version}-32-bit.7z.exe")
            set(download_filename "PortableGit-${program_version}-32-bit.7z.exe")
            set(download_sha512 867d8534972cbaf7a4224e25a14d484f8d17ef186f8d79e9a758afb90cf69541375cb7615a39702311f4809cb8371ef85c2b1a15bfffe9e48f0e597ac011b348)
            set(paths_to_search
                "${DOWNLOADS}/tools/${tool_subdirectory}/mingw32/bin"
                "${DOWNLOADS}/tools/git/${tool_subdirectory}/mingw32/bin")
        else()
            set(brew_package_name "git")
            set(apt_package_name "git")
        endif()
    elseif(program STREQUAL "GN")
        set(program_name gn)
        set(rename_binary_to "gn")
        set(cipd_download_gn "https://chrome-infra-packages.appspot.com/dl/gn/gn")
        if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
            set(supported_on_unix ON)
            set(program_version "xus7xtaPhpv5vCmKFOnsBVoB-PKmhZvRsSTjbQAuF0MC")
            set(gn_platform "linux-amd64")
            set(download_sha512 "871e75d7f3597b74fb99e36bb41fe5a9f8ce8a4d9f167f4729fc6e444807a59f35ec8aca70c2274a99c79d70a1108272be1ad991678a8ceb39e30f77abb13135")
        elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
            set(supported_on_unix ON)
            set(program_version "qhxILDNcJ2H44HfHmfiU-XIY3E_SIXvFqLd2wvbIgOoC")
            set(gn_platform "mac-amd64")
            set(download_sha512 "03ee64cb15bae7fceb412900d470601090bce147cfd45eb9b46683ac1a5dca848465a5d74c55a47df7f0e334d708151249a6d37bb021de74dd48b97ed4a07937")
        else()
            set(program_version "qUkAhy9J0P7c5racy-9wB6AHNK_btS18im8S06_ehhwC")
            set(gn_platform "windows-amd64")
            set(download_sha512 "263e02bd79eee0cb7b664831b7898565c5656a046328d8f187ef7ae2a4d766991d477b190c9b425fcc960ab76f381cd3e396afb85cba7408ca9e74eb32c175db")
        endif()
        set(tool_subdirectory "${program_version}")
        set(download_urls "${cipd_download_gn}/${gn_platform}/+/${program_version}")
        set(download_filename "gn-${gn_platform}.zip")
    elseif(program STREQUAL "GO")
        set(program_name go)
        set(tool_subdirectory 1.16.6.windows-386)
        set(paths_to_search ${DOWNLOADS}/tools/go/${tool_subdirectory}/go/bin)
        set(brew_package_name "go")
        set(apt_package_name "golang-go")
        set(download_urls "https://dl.google.com/go/go${tool_subdirectory}.zip")
        set(download_filename "go${tool_subdirectory}.zip")
        set(download_sha512 2a1e539ed628c0cca5935d24d22cf3a7165f5c80e12a4003ac184deae6a6d0aa31f582f3e8257b0730adfc09aeec3a0e62f4732e658c312d5382170bcd8c94d8)
    elseif(program STREQUAL "PYTHON3")
        if(CMAKE_HOST_WIN32)
            set(program_name python)
            set(program_version 3.10.0)
            if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
                set(tool_subdirectory "python-${program_version}-x86")
                set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-win32.zip")
                set(download_filename "python-${program_version}-embed-win32.zip")
                set(download_sha512 0b007bfa02cdd48b3c260986493fa124a6b9d794da6eba2b4fad0d779fd655e9ae4e16daf5f02ff5b30a17abcfc1499bc6bee394c0f8abe933f2d4fe702af3cd)
            else()
                set(tool_subdirectory "python-${program_version}-x64")
                set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-amd64.zip")
                set(download_filename "python-${program_version}-embed-amd64.zip")
                set(download_sha512 23d81d007698383d8dc088da532dcb86c6ceca7eb78ba5688fc2e18ee7f33f53a5632282873762293b8164556dfb15870f8ffb7abd368faba0a3d8d5d5bc6297)
            endif()
            set(paths_to_search "${DOWNLOADS}/tools/python/${tool_subdirectory}")
            vcpkg_list(SET post_install_command "${CMAKE_COMMAND}" -E rm python310._pth)
        else()
            set(program_name python3)
            set(brew_package_name "python")
            set(apt_package_name "python3")
        endif()
    elseif(program STREQUAL "PYTHON2")
        if(CMAKE_HOST_WIN32)
            set(program_name python)
            set(program_version 2.7.18)
            if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
                set(tool_subdirectory "python-${program_version}-x86")
                set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}.msi")
                set(download_filename "python-${program_version}.msi")
                set(download_sha512 2c112733c777ddbf189b0a54047a9d5851ebce0564cc38b9687d79ce6c7a09006109dbad8627fb1a60c3ad55e261db850d9dfa454af0533b460b2afc316fe115)
            else()
                set(tool_subdirectory "python-${program_version}-x64")
                set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}.amd64.msi")
                set(download_filename "python-${program_version}.amd64.msi")
                set(download_sha512 6a81a413b80fd39893e7444fd47efa455d240cbb77a456c9d12f7cf64962b38c08cfa244cd9c50a65947c40f936c6c8c5782f7236d7b92445ab3dd01e82af23e)
            endif()
            set(paths_to_search "${DOWNLOADS}/tools/python/${tool_subdirectory}")
        elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
            # macOS includes Python 2.7 built-in as `python`
            set(program_name python)
            set(brew_package_name "python2")
        else()
            set(program_name python2)
            set(apt_package_name "python")
        endif()
    elseif(program STREQUAL "RUBY")
        set(program_name "ruby")
        set(program_version 2.7.4-1)
        set(paths_to_search "${DOWNLOADS}/tools/ruby/rubyinstaller-${program_version}-x86/bin")
        set(download_urls "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-${program_version}/rubyinstaller-${program_version}-x86.7z")
        set(download_filename "rubyinstaller-${program_version}-x86.7z")
        set(download_sha512 4bf459c987b407bdda328c52d95060bf6ad48fc3e5ed5f64d4b205c5b4153c7a00cb6f9da6c0bcd5f2e001e9dc3dda0b72269ec4afdeffd658b93c085cd1d859)
    elseif(program STREQUAL "JOM")
        set(program_name jom)
        set(tool_subdirectory "jom-1.1.3")
        set(paths_to_search "${DOWNLOADS}/tools/jom/${tool_subdirectory}")
        set(download_urls
            "https://download.qt.io/official_releases/jom/jom_1_1_3.zip"
            "https://mirrors.ocf.berkeley.edu/qt/official_releases/jom/jom_1_1_3.zip"
        )
        set(download_filename "jom_1_1_3.zip")
        set(download_sha512 5b158ead86be4eb3a6780928d9163f8562372f30bde051d8c281d81027b766119a6e9241166b91de0aa6146836cea77e5121290e62e31b7a959407840fc57b33)
    elseif(program STREQUAL "7Z")
        set(program_name 7z)
        set(paths_to_search "${DOWNLOADS}/tools/7z/Files/7-Zip")
        set(download_urls "https://7-zip.org/a/7z1900.msi")
        set(download_filename "7z1900.msi")
        set(download_sha512 f73b04e2d9f29d4393fde572dcf3c3f0f6fa27e747e5df292294ab7536ae24c239bf917689d71eb10cc49f6b9a4ace26d7c122ee887d93cc935f268c404e9067)
    elseif(program STREQUAL "NINJA")
        set(program_name ninja)
        set(program_version 1.10.2)
        set(supported_on_unix ON)
        if(CMAKE_HOST_WIN32)
            set(download_filename "ninja-win-${program_version}.zip")
            set(tool_subdirectory "${program_version}-windows")
            set(download_urls "https://github.com/ninja-build/ninja/releases/download/v${program_version}/ninja-win.zip")
            set(download_sha512 6004140d92e86afbb17b49c49037ccd0786ce238f340f7d0e62b4b0c29ed0d6ad0bab11feda2094ae849c387d70d63504393714ed0a1f4d3a1f155af7a4f1ba3)
        elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
            set(download_filename "ninja-mac-${program_version}.zip")
            set(download_urls "https://github.com/ninja-build/ninja/releases/download/v${program_version}/ninja-mac.zip")
            set(tool_subdirectory "${program_version}-osx")
            set(paths_to_search "${DOWNLOADS}/tools/ninja-${program_version}-osx")
            set(download_sha512 bcd12f6a3337591306d1b99a7a25a6933779ba68db79f17c1d3087d7b6308d245daac08df99087ff6be8dc7dd0dcdbb3a50839a144745fa719502b3a7a07260b)
        elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
            set(paths_to_search "${DOWNLOADS}/tools/${tool_subdirectory}-freebsd")
            set(supported_on_unix OFF)
        else()
            set(download_filename "ninja-linux-${program_version}.zip")
            set(download_urls "https://github.com/ninja-build/ninja/releases/download/v${program_version}/ninja-linux.zip")
            set(tool_subdirectory "${program_version}-linux")
            set(paths_to_search "${DOWNLOADS}/tools/ninja-${program_version}-linux")
            set(download_sha512 93e802e9c17fb59636cddde4bad1ddaadad624f4ecfee00d5c78790330a4e9d433180e795718cda27da57215ce643c3929cf72c85337ee019d868c56f2deeef3)
        endif()
        set(version_command --version)
    elseif(program STREQUAL "NUGET")
        set(program_name nuget)
        set(tool_subdirectory "5.11.0")
        set(paths_to_search "${DOWNLOADS}/tools/nuget-${tool_subdirectory}-windows")
        set(brew_package_name "nuget")
        set(download_urls "https://dist.nuget.org/win-x86-commandline/v5.11.0/nuget.exe")
        set(rename_binary_to "nuget.exe")
        set(download_filename "nuget.5.11.0.exe")
        set(raw_executable ON)
        set(download_sha512 06a337c9404dec392709834ef2cdbdce611e104b510ef40201849595d46d242151749aef65bc2d7ce5ade9ebfda83b64c03ce14c8f35ca9957a17a8c02b8c4b7)
    elseif(program STREQUAL "MESON") # Should always be found!
        set(program_name meson)
        set(search_names meson meson.py)
        set(interpreter PYTHON3)
        set(apt_package_name "meson")
        set(brew_package_name "meson")
        set(version_command --version)
        set(extra_search_args EXACT_VERSION_MATCH)
        if(EXISTS "${CURRENT_HOST_INSTALLED_DIR}/share/meson/version.txt")
            file(READ "${CURRENT_HOST_INSTALLED_DIR}/share/meson/version.txt" program_version)
            set(paths_to_search "${CURRENT_HOST_INSTALLED_DIR}/tools/meson")
        else() # Old behavior
            set(program_version 0.58.1)
            set(ref aeda7f249c4a5dbbecc52e44f382246a2377b5b0)
            set(paths_to_search "${DOWNLOADS}/tools/meson/meson-${ref}")
            set(download_urls "https://github.com/mesonbuild/meson/archive/${ref}.tar.gz")
            set(download_filename "meson-${ref}.tar.gz")
            set(download_sha512 18a012a45274dbb4582e99fd69d920f38831e788d9860f9553c64847bedb1c2010ae0b5c0ef4a4350c03f5e0f95aaa0395378e1208109b59640c1a70b1e202d2)
            set(supported_on_unix ON)
        endif()
    elseif(program STREQUAL "FLEX" OR program STREQUAL "BISON")
        if(CMAKE_HOST_WIN32)
            vcpkg_list(SET sourceforge_args
                REPO winflexbison
                FILENAME winflexbison-2.5.16.zip
                SHA512 0a14154bff5d998feb23903c46961528f8ccb4464375d5384db8c4a7d230c0c599da9b68e7a32f3217a0a0735742242eaf3769cb4f03e00931af8640250e9123
                NO_REMOVE_ONE_LEVEL
                WORKING_DIRECTORY "${DOWNLOADS}/tools/winflexbison"
            )
            if(program STREQUAL "FLEX")
                set(program_name win_flex)
            else()
                set(program_name win_bison)
            endif()
            set(paths_to_search ${DOWNLOADS}/tools/winflexbison/0a14154bff-a8cf65db07)
            if(NOT EXISTS "${paths_to_search}/data/m4sugar/m4sugar.m4")
                file(REMOVE_RECURSE "${paths_to_search}")
            endif()
        elseif(program STREQUAL "FLEX")
            set(program_name flex)
            set(apt_package_name flex)
            set(brew_package_name flex)
        else()
            set(program_name bison)
            set(apt_package_name bison)
            set(brew_package_name bison)
            if (APPLE)
                set(paths_to_search /usr/local/opt/bison/bin)
            endif()
        endif()
    elseif(program STREQUAL "CLANG")
        set(program_name clang)
        set(tool_subdirectory "clang-12.0.0")
        set(program_version 12.0.0)
        if(CMAKE_HOST_WIN32)
            set(paths_to_search
                # Support LLVM in Visual Studio 2019
                "$ENV{LLVMInstallDir}/x64/bin"
                "$ENV{LLVMInstallDir}/bin"
                "$ENV{VCINSTALLDIR}/Tools/Llvm/x64/bin"
                "$ENV{VCINSTALLDIR}/Tools/Llvm/bin"
                "${DOWNLOADS}/tools/${tool_subdirectory}-windows/bin"
                "${DOWNLOADS}/tools/clang/${tool_subdirectory}/bin")

            if(DEFINED ENV{PROCESSOR_ARCHITEW6432})
                set(host_arch "$ENV{PROCESSOR_ARCHITEW6432}")
            else()
                set(host_arch "$ENV{PROCESSOR_ARCHITECTURE}")
            endif()

            if(host_arch MATCHES "64")
                set(download_urls "https://github.com/llvm/llvm-project/releases/download/llvmorg-${program_version}/LLVM-${program_version}-win64.exe")
                set(download_filename "LLVM-${program_version}-win64.7z.exe")
                set(download_sha512 67a9b54abad5143fa5f79f0cfc184be1394c9fc894fa9cee709943cb6ccbde8f0ea6003d8fcc20eccf035631abe4009cc0f694ac84e7879331cebba8125e4c7f)
            else()
                set(download_urls "https://github.com/llvm/llvm-project/releases/download/llvmorg-${program_version}/LLVM-${program_version}-win32.exe")
                set(download_filename "LLVM-${program_version}-win32.7z.exe")
                set(download_sha512 92fa5252fd08c1414ee6d71e2544cd2c44872124c47225f8d98b3af711d20e699f2888bc30642dfd00e005013da1607a593674fb4878951cc434694f9a119199)
            endif()
        endif()
        set(brew_package_name "llvm")
        set(apt_package_name "clang")
    elseif(program STREQUAL "GPERF")
        set(program_name gperf)
        set(program_version 3.0.1)
        set(paths_to_search "${DOWNLOADS}/tools/gperf/bin")
        set(download_urls "https://sourceforge.net/projects/gnuwin32/files/gperf/${program_version}/gperf-${program_version}-bin.zip/download")
        set(download_filename "gperf-${program_version}-bin.zip")
        set(download_sha512 3f2d3418304390ecd729b85f65240a9e4d204b218345f82ea466ca3d7467789f43d0d2129fcffc18eaad3513f49963e79775b10cc223979540fa2e502fe7d4d9)
    elseif(program STREQUAL "GASPREPROCESSOR")
        set(raw_executable true)
        set(program_name gas-preprocessor)
        set(tool_subdirectory "4daa6115")
        set(interpreter PERL)
        set(search_names "gas-preprocessor.pl")
        set(paths_to_search "${DOWNLOADS}/tools/gas-preprocessor/${tool_subdirectory}")
        set(rename_binary_to "gas-preprocessor.pl")
        set(download_urls "https://raw.githubusercontent.com/FFmpeg/gas-preprocessor/4daa611556a0558dfe537b4f7ad80f7e50a079c1/gas-preprocessor.pl")
        set(download_filename "gas-preprocessor-${tool_subdirectory}.pl")
        set(download_sha512 2737ba3c1cf85faeb1fbfe015f7bad170f43a857a50a1b3d81fa93ba325d481f73f271c5a886ff8b7eef206662e19f0e9ef24861dfc608b67b8ea8a2062dc061)
    elseif(program STREQUAL "DARK")
        set(program_name dark)
        set(tool_subdirectory "wix311-binaries")
        set(paths_to_search "${DOWNLOADS}/tools/dark/${tool_subdirectory}")
        set(download_urls "https://github.com/wixtoolset/wix3/releases/download/wix311rtm/wix311-binaries.zip")
        set(download_filename "wix311-binaries.zip")
        set(download_sha512 74f0fa29b5991ca655e34a9d1000d47d4272e071113fada86727ee943d913177ae96dc3d435eaf494d2158f37560cd4c2c5274176946ebdb17bf2354ced1c516)
    elseif(program STREQUAL "SCONS")
        set(program_name scons)
        set(program_version 4.1.0)
        set(tool_subdirectory "${program_version}")
        set(interpreter PYTHON2)
        set(search_names "scons.py")
        set(download_urls "https://sourceforge.net/projects/scons/files/scons-local-${program_version}.zip/download")
        set(download_filename "scons-local-${program_version}.zip")
        set(download_sha512 b173176ce8aca25039c64fcc68ec1b9ad31e03a926fd545e7631b3f9b374d914adffc593f505e3e7e2867b0ffe85e8deb0b39afe314edf05d02974ce5db1badb)
    elseif(program STREQUAL "SWIG")
        set(program_version 4.0.2)
        set(program_name swig)
        if(CMAKE_HOST_WIN32)
            vcpkg_list(SET sourceforge_args
                REPO swig/swigwin
                REF "swigwin-${program_version}"
                FILENAME "swigwin-${program_version}.zip"
                SHA512 b8f105f9b9db6acc1f6e3741990915b533cd1bc206eb9645fd6836457fd30789b7229d2e3219d8e35f2390605ade0fbca493ae162ec3b4bc4e428b57155db03d
                NO_REMOVE_ONE_LEVEL
                WORKING_DIRECTORY "${DOWNLOADS}/tools/swig"
            )
            set(tool_subdirectory "b8f105f9b9-f0518bc3b7/swigwin-${program_version}")
        else()
            set(apt_package_name "swig")
            set(brew_package_name "swig")
        endif()

    elseif(program STREQUAL "DOXYGEN")
        set(program_name doxygen)
        set(program_version 1.9.1)
        vcpkg_list(SET sourceforge_args
            REPO doxygen
            REF "rel-${program_version}"
            FILENAME "doxygen-${program_version}.windows.bin.zip"
            SHA512 c3eeb6b9fa4eab70fb6b0864fbbf94fb8050f3fee38d117cf470921a80e3569cc1c8b0272604d6731e05f01790cfaa70e159bec5d0882fc4f2d8ae4a5d52a21b
            NO_REMOVE_ONE_LEVEL
            WORKING_DIRECTORY "${DOWNLOADS}/tools/doxygen"
         )
        set(tool_subdirectory c3eeb6b9fa-76d69c6db5)
    elseif(program STREQUAL "BAZEL")
        set(program_name bazel)
        set(program_version 4.1.0)
        set(rename_binary_to "bazel")
        if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
            set(supported_on_unix ON)
            set(tool_subdirectory "${program_version}-linux")
            set(download_urls "https://github.com/bazelbuild/bazel/releases/download/${program_version}/bazel-${tool_subdirectory}-x86_64")
            set(download_filename "bazel-${tool_subdirectory}-x86_64")
            set(raw_executable ON)
            set(download_sha512 50aa0894dbeedb9189a56f17baa8cecfa55c5f9c1f93a61b9ab5e10984754a400884fc9802b4979f536778e15f813a72807396b4b47694e4c05eadb841361c69)
        elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
            set(supported_on_unix ON)
            set(tool_subdirectory "${program_version}-darwin")
            set(download_urls "https://github.com/bazelbuild/bazel/releases/download/${program_version}/bazel-${tool_subdirectory}-x86_64")
            set(download_filename "bazel-${tool_subdirectory}-x86_64")
            set(raw_executable ON)
            set(download_sha512 3500560c9d49d37a1ead2d2777d673c6f1874582883e141ecd5b3991005b1b6b8aab5f255c187133d771497c2a956f5c1e0dfad04dc453525634537e65b649af)
        else()
            set(tool_subdirectory "${program_version}-windows")
            set(download_urls "https://github.com/bazelbuild/bazel/releases/download/${program_version}/bazel-${tool_subdirectory}-x86_64.zip")
            set(download_filename "bazel-${tool_subdirectory}-x86_64.zip")
            set(download_sha512 3954ab54b465d62eef397767dac7ce21d06ac8ea3e1571d0e7b1f0ea8b5c2cf44eea5d252b85a63a1e1a08dbe9a219783cc23c2888673c35e2df03edfdc9e5a7)
        endif()
    elseif(program STREQUAL "ARIA2")
        set(program_name aria2c)
        set(program_version 1.35.0)
        set(paths_to_search "${DOWNLOADS}/tools/aria2c/aria2-${program_version}-win-32bit-build1")
        set(download_urls "https://github.com/aria2/aria2/releases/download/release-${program_version}/aria2-${program_version}-win-32bit-build1.zip")
        set(download_filename "aria2-${program_version}-win-32bit-build1.zip")
        set(download_sha512 933537cad820b1cecf43a9eeca7e1b241dd7b1c902ee942441a166f2c38845f16046321efbdfa2f83c7e9fc50c7ecc5da6fd00e0c6e2124c07d3b783aa5092a4)
    elseif(program STREQUAL "PKGCONFIG")
        set(program_name pkg-config)
        if(DEFINED ENV{PKG_CONFIG})
            debug_message(STATUS "PKG_CONFIG found in ENV! Using $ENV{PKG_CONFIG}")
            set(PKGCONFIG "$ENV{PKG_CONFIG}" CACHE INTERNAL "")
            set(PKGCONFIG "${PKGCONFIG}" PARENT_SCOPE)
            return()
        elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "OpenBSD")
            # As of 6.8, the OpenBSD specific pkg-config doesn't support {pcfiledir}
            set(supported_on_unix ON)
            set(rename_binary_to "pkg-config")
            set(program_version 0.29.2.1)
            set(raw_executable ON)
            set(download_filename "pkg-config.openbsd")
            set(tool_subdirectory "openbsd")
            set(download_urls "https://raw.githubusercontent.com/jgilje/pkg-config-openbsd/master/pkg-config")
            set(download_sha512 b7ec9017b445e00ae1377e36e774cf3f5194ab262595840b449832707d11e443a102675f66d8b7e8b2e2f28cebd6e256835507b1e0c69644cc9febab8285080b)
            set(version_command --version)
        elseif(CMAKE_HOST_WIN32)
            if(NOT EXISTS "${PKGCONFIG}")
                set(VERSION 0.29.2-2)
                set(program_version git-8.0.0.5906.c9a21571-1)
                vcpkg_acquire_msys(
                    PKGCONFIG_ROOT
                    NO_DEFAULT_PACKAGES
                    DIRECT_PACKAGES
                        "https://repo.msys2.org/mingw/i686/mingw-w64-i686-pkg-config-${VERSION}-any.pkg.tar.zst"
                        54f8dad3b1a36a4515db47825a3214fbd2bd82f604aec72e7fb8d79068095fda3c836fb2296acd308522d6e12ce15f69e0c26dcf4eb0681fd105d057d912cdb7
                        "https://repo.msys2.org/mingw/i686/mingw-w64-i686-libwinpthread-${program_version}-any.pkg.tar.zst"
                        2c3d9e6b2eee6a4c16fd69ddfadb6e2dc7f31156627d85845c523ac85e5c585d4cfa978659b1fe2ec823d44ef57bc2b92a6127618ff1a8d7505458b794f3f01c
                )
            endif()
            set("${program}" "${PKGCONFIG_ROOT}/mingw32/bin/pkg-config.exe" CACHE INTERNAL "")
            set("${program}" "${${program}}" PARENT_SCOPE)
            return()
        else()
            set(brew_package_name pkg-config)
            set(apt_package_name pkg-config)
            set(paths_to_search "/bin" "/usr/bin" "/usr/local/bin")
        endif()
    else()
        message(FATAL "unknown tool ${program} -- unable to acquire.")
    endif()

    if("${program_name}" STREQUAL "")
        message(FATAL_ERROR "Internal error: failed to initialize program_name for program ${program}")
    endif()

    set(full_subdirectory "${DOWNLOADS}/tools/${program_name}/${tool_subdirectory}")
    if(NOT "${tool_subdirectory}" STREQUAL "")
        list(APPEND paths_to_search ${full_subdirectory})
    endif()
    if("${full_subdirectory}" MATCHES [[^(.*)[/\\]+$]])
        # remove trailing slashes, which may turn into a trailing `\` which CMake _does not like_
        set(full_subdirectory "${CMAKE_MATCH_1}")
    endif()

    if("${search_names}" STREQUAL "")
        set(search_names "${program_name}")
    endif()

    z_vcpkg_find_acquire_program_find_internal("${program}"
        INTERPRETER "${interpreter}"
        PATHS ${paths_to_search}
        NAMES ${search_names}
    )
    if(NOT ${program})
        z_vcpkg_find_acquire_program_find_external("${program}"
            ${extra_search_args}
            PROGRAM_NAME "${program_name}"
            MIN_VERSION "${program_version}"
            INTERPRETER "${interpreter}"
            NAMES ${search_names}
            VERSION_COMMAND ${version_command}
        )
    endif()
    if(NOT ${program})
        if(NOT VCPKG_HOST_IS_WINDOWS AND NOT supported_on_unix)
            set(example ".")
            if(NOT "${brew_package_name}" STREQUAL "" AND VCPKG_HOST_IS_OSX)
                set(example ":\n    brew install ${brew_package_name}")
            elseif(NOT "${apt_package_name}" STREQUAL "" AND VCPKG_HOST_IS_LINUX)
                set(example ":\n    sudo apt-get install ${apt_package_name}")
            endif()
            message(FATAL_ERROR "Could not find ${program_name}. Please install it via your package manager${example}")
        endif()

        if(NOT "${sourceforge_args}" STREQUAL "")
            # Locally change editable to suppress re-extraction each time
            set(_VCPKG_EDITABLE 1)
            vcpkg_from_sourceforge(OUT_SOURCE_PATH SFPATH ${sourceforge_args})
            unset(_VCPKG_EDITABLE)
        else()
            vcpkg_download_distfile(archive_path
                URLS ${download_urls}
                SHA512 "${download_sha512}"
                FILENAME "${download_filename}"
            )

            file(MAKE_DIRECTORY "${full_subdirectory}")
            if(raw_executable)
                if(NOT "${rename_binary_to}" STREQUAL "")
                    file(INSTALL "${archive_path}"
                        DESTINATION "${full_subdirectory}"
                        RENAME "${rename_binary_to}"
                        FILE_PERMISSIONS
                            OWNER_READ OWNER_WRITE OWNER_EXECUTE
                            GROUP_READ GROUP_EXECUTE
                            WORLD_READ WORLD_EXECUTE
                    )
                else()
                    file(COPY "${archive_path}"
                        DESTINATION "${full_subdirectory}"
                        FILE_PERMISSIONS
                            OWNER_READ OWNER_WRITE OWNER_EXECUTE
                            GROUP_READ GROUP_EXECUTE
                            WORLD_READ WORLD_EXECUTE
                    )
                endif()
            else()
                cmake_path(GET download_filename EXTENSION archive_extension)
                string(TOLOWER "${archive_extension}" archive_extension)
                if("${archive_extension}" MATCHES [[\.msi$]])
                    cmake_path(NATIVE_PATH archive_path archive_native_path)
                    cmake_path(NATIVE_PATH full_subdirectory destination_native_path)
                    vcpkg_execute_in_download_mode(
                        COMMAND msiexec
                            /a "${archive_native_path}"
                            /qn "TARGETDIR=${destination_native_path}"
                        WORKING_DIRECTORY "${DOWNLOADS}"
                    )
                elseif("${archive_extension}" MATCHES [[\.7z\.exe$]])
                    vcpkg_find_acquire_program(7Z)
                    vcpkg_execute_in_download_mode(
                        COMMAND ${7Z} x
                            "${archive_path}"
                            "-o${full_subdirectory}"
                            -y -bso0 -bsp0
                        WORKING_DIRECTORY "${full_subdirectory}"
                    )
                else()
                    vcpkg_execute_in_download_mode(
                        COMMAND "${CMAKE_COMMAND}" -E tar xzf "${archive_path}"
                        WORKING_DIRECTORY "${full_subdirectory}"
                    )
                endif()
            endif()
        endif()

        if(NOT "${post_install_command}" STREQUAL "")
            vcpkg_execute_required_process(
                ALLOW_IN_DOWNLOAD_MODE
                COMMAND ${post_install_command}
                WORKING_DIRECTORY "${full_subdirectory}"
                LOGNAME "${program}-tool-post-install"
            )
        endif()
        unset("${program}")
        unset("${program}" CACHE)
        z_vcpkg_find_acquire_program_find_internal("${program}"
            INTERPRETER "${interpreter}"
            PATHS ${paths_to_search}
            NAMES ${search_names}
        )
        if(NOT ${program})
            message(FATAL_ERROR "Unable to find ${program}")
        endif()
    endif()

    set("${program}" "${${program}}" PARENT_SCOPE)
endfunction()

repository: SABERBOY/vcpkg

repo_name: SABERBOY/vcpkg

extension: cmake


text:
# base recipe: poky/meta/recipes-devtools/perl/libtest-needs-perl_0.002005.bb
# base branch: warrior
# base commit: 01b8a8b54bc569e5ef3f5e6fc6abcee365ab25d9

SUMMARY = "Skip tests when modules not available"
DESCRIPTION = "Skip test scripts if modules are not available. \
The requested modules will be loaded, and optionally have their versions \
checked. If the module is missing, the test script will be skipped. Modules \
that are found but fail to compile will exit with an error rather than skip."

HOMEPAGE = "https://metacpan.org/release/Test-Needs"
SECTION = "libs"
LICENSE = "Artistic-1.0 | GPL-1.0+"

CPAN_NAME = "Test-Needs"
CPAN_AUTHOR = "HAARG"

LIC_FILES_CHKSUM = "file://README;md5=3f3ccd21a0a48aa313db212cc3b1bc09;beginline=81;endline=82"

DEPENDS += "perl"

inherit debian-package
require recipes-debian/sources/libtest-needs-perl.inc

DEBIAN_QUILT_PATCHES = ""
DEBIAN_UNPACK_DIR = "${WORKDIR}/${CPAN_NAME}-${PV}"

S = "${WORKDIR}/${CPAN_NAME}-${PV}"

inherit cpan ptest-perl

RDEPENDS_${PN}-ptest += "perl-module-test-more"

BBCLASSEXTEND = "native"

license: MIT

repository: miraclelinux/meta-debian-extended

license_type: permissive

repo_name: miraclelinux/meta-debian-extended

branch_name: refs/heads/warrior

gha_license_id: MIT

gha_language: BitBake

extension: bb


text:
file(REMOVE_RECURSE
  "CMakeFiles/p2433.dir/main.cpp.obj"
  "libp2433.dll.a"
  "p2433.exe"
  "p2433.exe.manifest"
  "p2433.pdb"
)

# Per-language clean rules from dependency scanning.
foreach(lang CXX)
  include(CMakeFiles/p2433.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()

branch_name: refs/heads/master


text:
// Copyright 2017 The Upspin Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

/*
Command upspin-ui presents a web interface to the Upspin name space,
and also provides a facility to sign up an Upspin user and deploy
an upspinserver to Google Cloud Platform.
It operates as the user in the specified config.
If no config is available at the specified path,
the user is prompted to sign up an Upspin user.

Browser features

The Upspin browser presents two navigation panes.

Each browser pane lists the contents of an Upspin directory.
The directory is shown in a text box at the top of each pane.

You can navigate directly to a specific Upspin path by typing (or pasting) it
into the text box and pressing the enter key.
The button to the left of the text box navigates to the parent of the current
directory.

Clicking the name of an entry will attempt to download the entry with your web
browser or, if the entry is a directory, will navigate to that directory.

At startup, the left pane displays the current user's root and the right pane
displays the path augie@upspin.io.

The checkboxes beside each entry permit the (de-)selection of entries.
The checkbox at the top of each list of entries (de-)selects all entries in
that directory.

The "Delete" button recursively deletes the selected files and directories.

The "Copy" button recurisively copies the selected files and directories to
the directory displayed in the opposite pane.

The "Make directory" button creates a directory in the pane's current
directory.

The "Refresh" button reloads the contents of the directory and displays it.

The info buttons (a little "i" in a circle, to the right of each file) display
extended information for a given directory entry.

Files created by upspin-ui

The signup process creates a config file at the location provided by the
-config flag. The flag's default value is $HOME/upspin/config.
Signup also generates key files and puts them in the directory
$HOME/.ssh/$USER, where $USER is the Upspin user name.

The upspinserver deployment process records its state in a file with the same
name as the config file with the additional suffix ".gcpState".
This state file is used to resume the deployment process should the upspin-ui
program crash or be terminated by the user.
Once deployment is complete this file may be removed.
Deployment also generates key files which it puts in $HOME/.ssh/$USER,
where $USER is the Upspin user name of the server being deployed.

During the signup and deployment processes, upspin-ui logs debugging
information to $HOME/upspin/log/upspin-ui.log.
*/
package main

repository: upspin/augie

repo_name: upspin/augie

extension: go


text:
/*
 * Copyright (c) 2018 The Go Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
 */

package url

import (
	"errors"
	"fmt"
	"strings"
	_ "unsafe"
)

func ishex(c byte) bool {
	switch {
	case '0' <= c && c <= '9':
		return true
	case 'a' <= c && c <= 'f':
		return true
	case 'A' <= c && c <= 'F':
		return true
	}
	return false
}

func unhex(c byte) byte {
	switch {
	case '0' <= c && c <= '9':
		return c - '0'
	case 'a' <= c && c <= 'f':
		return c - 'a' + 10
	case 'A' <= c && c <= 'F':
		return c - 'A' + 10
	}
	return 0
}

// Return true if the specified character should be escaped when
// appearing in a URL string, according to RFC 3986.
//
// Please be informed that for now shouldEscape does not check all
// reserved characters correctly. See golang.org/issue/5684.
func shouldEscape(c byte, mode encoding) bool {
	// §2.3 Unreserved characters (alphanum)
	if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' {
		return false
	}

	if mode == encodeHost || mode == encodeZone {
		// §3.2.2 Host allows
		//	sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
		// as part of reg-name.
		// We add : because we include :port as part of host.
		// We add [ ] because we include [ipv6]:port as part of host.
		// We add < > because they're the only characters left that
		// we could possibly allow, and Parse will reject them if we
		// escape them (because hosts can't use %-encoding for
		// ASCII bytes).
		switch c {
		case '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=', ':', '[', ']', '<', '>', '"':
			return false
		}
	}

	switch c {
	case '-', '_', '.', '~': // §2.3 Unreserved characters (mark)
		return false

	case '$', '&', '+', ',', '/', ':', ';', '=', '?', '@': // §2.2 Reserved characters (reserved)
		// Different sections of the URL allow a few of
		// the reserved characters to appear unescaped.
		switch mode {
		case encodePath: // §3.3
			// The RFC allows : @ & = + $ but saves / ; , for assigning
			// meaning to individual path segments. This package
			// only manipulates the path as a whole, so we allow those
			// last three as well. That leaves only ? to escape.
			return c == '?'

		case encodePathSegment: // §3.3
			// The RFC allows : @ & = + $ but saves / ; , for assigning
			// meaning to individual path segments.
			return c == '/' || c == ';' || c == ',' || c == '?'

		case encodeUserPassword: // §3.2.1
			// The RFC allows ';', ':', '&', '=', '+', '$', and ',' in
			// userinfo, so we must escape only '@', '/', and '?'.
			// The parsing of userinfo treats ':' as special so we must escape
			// that too.
			return c == '@' || c == '/' || c == '?' || c == ':'

		case encodeQueryComponent: // §3.4
			// The RFC reserves (so we must escape) everything.
			return true

		case encodeFragment: // §4.1
			// The RFC text is silent but the grammar allows
			// everything, so escape nothing.
			return false
		}
	}

	// Everything else must be escaped.
	return true
}

// unescape unescapes a string; the mode specifies
// which section of the URL string is being unescaped.
func unescape(s string, mode encoding) (string, error) {
	// Count %, check that they're well-formed.
	n := 0
	hasPlus := false
	for i := 0; i < len(s); {
		switch s[i] {
		case '%':
			n++
			if i+2 >= len(s) || !ishex(s[i+1]) || !ishex(s[i+2]) {
				s = s[i:]
				if len(s) > 3 {
					s = s[:3]
				}
				return "", EscapeError(s)
			}
			// Per https://tools.ietf.org/html/rfc3986#page-21
			// in the host component %-encoding can only be used
			// for non-ASCII bytes.
			// But https://tools.ietf.org/html/rfc6874#section-2
			// introduces %25 being allowed to escape a percent sign
			// in IPv6 scoped-address literals. Yay.
			if mode == encodeHost && unhex(s[i+1]) < 8 && s[i:i+3] != "%25" {
				return "", EscapeError(s[i : i+3])
			}
			if mode == encodeZone {
				// RFC 6874 says basically "anything goes" for zone identifiers
				// and that even non-ASCII can be redundantly escaped,
				// but it seems prudent to restrict %-escaped bytes here to those
				// that are valid host name bytes in their unescaped form.
				// That is, you can use escaping in the zone identifier but not
				// to introduce bytes you couldn't just write directly.
				// But Windows puts spaces here! Yay.
				v := unhex(s[i+1])<<4 | unhex(s[i+2])
				if s[i:i+3] != "%25" && v != ' ' && shouldEscape(v, encodeHost) {
					return "", EscapeError(s[i : i+3])
				}
			}
			i += 3
		case '+':
			hasPlus = mode == encodeQueryComponent
			i++
		default:
			if (mode == encodeHost || mode == encodeZone) && s[i] < 0x80 && shouldEscape(s[i], mode) {
				return "", InvalidHostError(s[i : i+1])
			}
			i++
		}
	}

	if n == 0 && !hasPlus {
		return s, nil
	}

	t := make([]byte, len(s)-2*n)
	j := 0
	for i := 0; i < len(s); {
		switch s[i] {
		case '%':
			t[j] = unhex(s[i+1])<<4 | unhex(s[i+2])
			j++
			i += 3
		case '+':
			if mode == encodeQueryComponent {
				t[j] = ' '
			} else {
				t[j] = '+'
			}
			j++
			i++
		default:
			t[j] = s[i]
			j++
			i++
		}
	}
	return string(t), nil
}

func escape(s string, mode encoding) string {
	spaceCount, hexCount := 0, 0
	for i := 0; i < len(s); i++ {
		c := s[i]
		if shouldEscape(c, mode) {
			if c == ' ' && mode == encodeQueryComponent {
				spaceCount++
			} else {
				hexCount++
			}
		}
	}

	if spaceCount == 0 && hexCount == 0 {
		return s
	}

	t := make([]byte, len(s)+2*hexCount)
	j := 0
	for i := 0; i < len(s); i++ {
		switch c := s[i]; {
		case c == ' ' && mode == encodeQueryComponent:
			t[j] = '+'
			j++
		case shouldEscape(c, mode):
			t[j] = '%'
			t[j+1] = "0123456789ABCDEF"[c>>4]
			t[j+2] = "0123456789ABCDEF"[c&15]
			j += 3
		default:
			t[j] = s[i]
			j++
		}
	}
	return string(t)
}

// Maybe rawurl is of the form scheme:path.
// (Scheme must be [a-zA-Z][a-zA-Z0-9+-.]*)
// If so, return scheme, path; else return "", rawurl.
func getscheme(rawurl string) (scheme, path string, err error) {
	for i := 0; i < len(rawurl); i++ {
		c := rawurl[i]
		switch {
		case 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z':
			// do nothing
		case '0' <= c && c <= '9' || c == '+' || c == '-' || c == '.':
			if i == 0 {
				return "", rawurl, nil
			}
		case c == ':':
			if i == 0 {
				return "", "", errors.New("missing protocol scheme")
			}
			return rawurl[:i], rawurl[i+1:], nil
		default:
			// we have encountered an invalid character,
			// so there is no valid scheme
			return "", rawurl, nil
		}
	}
	return "", rawurl, nil
}

// Maybe s is of the form t c u.
// If so, return t, c u (or t, u if cutc == true).
// If not, return s, "".
func split(s string, c string, cutc bool) (string, string) {
	i := strings.Index(s, c)
	if i < 0 {
		return s, ""
	}
	if cutc {
		return s[:i], s[i+len(c):]
	}
	return s[:i], s[i:]
}

// parse parses a URL from a string in one of two contexts. If
// viaRequest is true, the URL is assumed to have arrived via an HTTP request,
// in which case only absolute URLs or path-absolute relative URLs are allowed.
// If viaRequest is false, all forms of relative URLs are allowed.
func parse(rawurl string, viaRequest bool) (*URL, error) {
	var rest string
	var err error

	if rawurl == "" && viaRequest {
		return nil, errors.New("empty url")
	}
	url := new(URL)

	if rawurl == "*" {
		url.Path = "*"
		return url, nil
	}

	// Split off possible leading "http:", "mailto:", etc.
	// Cannot contain escaped characters.
	if url.Scheme, rest, err = getscheme(rawurl); err != nil {
		return nil, err
	}
	url.Scheme = strings.ToLower(url.Scheme)

	//@comment : was `if strings.HasSuffix(rest, "?") && strings.Count(rest, "?") == 1 {`
	if len(rest) >= 1 && rest[len(rest)-1:] == "?" && strings.Count(rest, "?") == 1 {
		url.ForceQuery = true
		rest = rest[:len(rest)-1]
	} else {
		rest, url.RawQuery = split(rest, "?", true)
	}

	//@comment : was `if !strings.HasPrefix(rest, "/") {`
	if len(rest) < 1 || rest[:1] != "/" {
		if url.Scheme != "" {
			// We consider rootless paths per RFC 3986 as opaque.
			url.Opaque = rest
			return url, nil
		}
		if viaRequest {
			return nil, errors.New("invalid URI for request")
		}

		// Avoid confusion with malformed schemes, like cache_object:foo/bar.
		// See golang.org/issue/16822.
		//
		// RFC 3986, §3.3:
		// In addition, a URI reference (Section 4.1) may be a relative-path reference,
		// in which case the first path segment cannot contain a colon (":") character.
		colon := byteIndex(rest, ':') // @comment : was strings.Index
		slash := byteIndex(rest, '/') // @comment : was strings.Index
		if colon >= 0 && (slash < 0 || colon < slash) {
			// First path segment has colon. Not allowed in relative URL.
			return nil, errors.New("first path segment in URL cannot contain colon")
		}
	}

	//@comment : was `if (url.Scheme != "" || !viaRequest && !strings.HasPrefix(rest, "///")) && strings.HasPrefix(rest, "//") {`
	if (url.Scheme != "" || !viaRequest && (len(rest) < 3 || rest[:3] != "///")) && (len(rest) >= 2 && rest[:2] == "//") {
		var authority string
		authority, rest = split(rest[2:], "/", false)
		url.User, url.Host, err = parseAuthority(authority)
		if err != nil {
			return nil, err
		}
	}
	// Set Path and, optionally, RawPath.
	// RawPath is a hint of the encoding of Path. We don't want to set it if
	// the default escaping of Path is equivalent, to help make sure that people
	// don't rely on it in general.
	if err := url.setPath(rest); err != nil {
		return nil, err
	}
	return url, nil
}

func parseAuthority(authority string) (user *Userinfo, host string, err error) {
	i := strings.LastIndexByte(authority, '@')
	if i < 0 {
		host, err = parseHost(authority)
	} else {
		host, err = parseHost(authority[i+1:])
	}
	if err != nil {
		return nil, "", err
	}
	if i < 0 {
		return nil, host, nil
	}
	userinfo := authority[:i]
	if !validUserinfo(userinfo) {
		return nil, "", errors.New("net/url: invalid userinfo")
	}
	if !strings.Contains(userinfo, ":") {
		if userinfo, err = unescape(userinfo, encodeUserPassword); err != nil {
			return nil, "", err
		}
		user = User(userinfo)
	} else {
		username, password := split(userinfo, ":", true)
		if username, err = unescape(username, encodeUserPassword); err != nil {
			return nil, "", err
		}
		if password, err = unescape(password, encodeUserPassword); err != nil {
			return nil, "", err
		}
		user = UserPassword(username, password)
	}
	return user, host, nil
}

// parseHost parses host as an authority without user
// information. That is, as host[:port].
func parseHost(host string) (string, error) {
	//@comment : was `if strings.HasPrefix(host, "[") {`
	if len(host) >= 1 && host[:1] == "[" {
		// Parse an IP-Literal in RFC 3986 and RFC 6874.
		// E.g., "[fe80::1]", "[fe80::1%25en0]", "[fe80::1]:80".
		i := strings.LastIndexByte(host, ']')
		if i < 0 {
			return "", errors.New("missing ']' in host")
		}
		colonPort := host[i+1:]
		if !validOptionalPort(colonPort) {
			return "", fmt.Errorf("invalid port %q after host", colonPort)
		}

		// RFC 6874 defines that %25 (%-encoded percent) introduces
		// the zone identifier, and the zone identifier can use basically
		// any %-encoding it likes. That's different from the host, which
		// can only %-encode non-ASCII bytes.
		// We do impose some restrictions on the zone, to avoid stupidity
		// like newlines.
		zone := strings.Index(host[:i], "%25")
		if zone >= 0 {
			host1, err := unescape(host[:zone], encodeHost)
			if err != nil {
				return "", err
			}
			host2, err := unescape(host[zone:i], encodeZone)
			if err != nil {
				return "", err
			}
			host3, err := unescape(host[i:], encodeHost)
			if err != nil {
				return "", err
			}
			return host1 + host2 + host3, nil
		}
	}

	var err error
	if host, err = unescape(host, encodeHost); err != nil {
		return "", err
	}
	return host, nil
}

// validEncodedPath reports whether s is a valid encoded path.
// It must not contain any bytes that require escaping during path encoding.
func validEncodedPath(s string) bool {
	for i := 0; i < len(s); i++ {
		// RFC 3986, Appendix A.
		// pchar = unreserved / pct-encoded / sub-delims / ":" / "@".
		// shouldEscape is not quite compliant with the RFC,
		// so we check the sub-delims ourselves and let
		// shouldEscape handle the others.
		switch s[i] {
		case '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=', ':', '@':
			// ok
		case '[', ']':
			// ok - not specified in RFC 3986 but left alone by modern browsers
		case '%':
			// ok - percent encoded, will decode
		default:
			if shouldEscape(s[i], encodePath) {
				return false
			}
		}
	}
	return true
}

// validOptionalPort reports whether port is either an empty string
// or matches /^:\d*$/
func validOptionalPort(port string) bool {
	if port == "" {
		return true
	}
	if port[0] != ':' {
		return false
	}
	for _, b := range port[1:] {
		if b < '0' || b > '9' {
			return false
		}
	}
	return true
}

func parseQuery(m Values, query string) (err error) {
	for query != "" {
		key := query
		if i := strings.IndexAny(key, "&;"); i >= 0 {
			key, query = key[:i], key[i+1:]
		} else {
			query = ""
		}
		if key == "" {
			continue
		}
		value := ""
		if i := byteIndex(key, '='); i >= 0 {
			key, value = key[:i], key[i+1:]
		}
		key, err1 := QueryUnescape(key)
		if err1 != nil {
			if err == nil {
				err = err1
			}
			continue
		}
		value, err1 = QueryUnescape(value)
		if err1 != nil {
			if err == nil {
				err = err1
			}
			continue
		}
		m[key] = append(m[key], value)
	}
	return err
}

// resolvePath applies special path segments from refs and applies
// them to base, per RFC 3986.
func resolvePath(base, ref string) string {
	var full string
	if ref == "" {
		full = base
	} else if ref[0] != '/' {
		i := strings.LastIndexByte(base, '/')
		full = base[:i+1] + ref
	} else {
		full = ref
	}
	if full == "" {
		return ""
	}
	var dst []string
	src := strings.Split(full, "/")
	for _, elem := range src {
		switch elem {
		case ".":
			// drop
		case "..":
			if len(dst) > 0 {
				dst = dst[:len(dst)-1]
			}
		default:
			dst = append(dst, elem)
		}
	}
	if last := src[len(src)-1]; last == "." || last == ".." {
		// Add final slash to the joined path.
		dst = append(dst, "")
	}
	return "/" + strings.TrimPrefix(strings.Join(dst, "/"), "/")
}

func stripPort(hostport string) string {
	colon := byteIndex(hostport, ':')
	if colon == -1 {
		return hostport
	}
	if i := byteIndex(hostport, ']'); i != -1 {
		return strings.TrimPrefix(hostport[:i], "[")
	}
	return hostport[:colon]
}

func portOnly(hostport string) string {
	colon := byteIndex(hostport, ':')
	if colon == -1 {
		return ""
	}
	if i := strings.Index(hostport, "]:"); i != -1 {
		return hostport[i+len("]:"):]
	}
	if strings.Contains(hostport, "]") {
		return ""
	}
	return hostport[colon+len(":"):]
}

// validUserinfo reports whether s is a valid userinfo string per RFC 3986
// Section 3.2.1:
//     userinfo    = *( unreserved / pct-encoded / sub-delims / ":" )
//     unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
//     sub-delims  = "!" / "$" / "&" / "'" / "(" / ")"
//                   / "*" / "+" / "," / ";" / "="
//
// It doesn't validate pct-encoded. The caller does that via func unescape.
func validUserinfo(s string) bool {
	for _, r := range s {
		if 'A' <= r && r <= 'Z' {
			continue
		}
		if 'a' <= r && r <= 'z' {
			continue
		}
		if '0' <= r && r <= '9' {
			continue
		}
		switch r {
		case '-', '.', '_', ':', '~', '!', '$', '&', '\'',
			'(', ')', '*', '+', ',', ';', '=', '%', '@':
			continue
		default:
			return false
		}
	}
	return true
}

//go:linkname byteIndex strings.IndexByte
func byteIndex(s string, c byte) int

repository: badu/http

repo_name: badu/http


text:
set(GCC_COMPATIBLE_COMPILER 1)
set(TESTS_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share/Ocsfml")
set(CPP_COMPILER ${CMAKE_CXX_COMPILER})
set(LIB_MAKER "ar")
set(DLL_LINKER "${CMAKE_CXX_COMPILER}")
set(LINK_STDLIB_STA "A \"-cclib\" ; A \"-lc++\"")
set(LINK_STDLIB_DYN "A \"-cclib\" ; A \"-lc++\"")
set(OBJ_FLAG "-o")
set(LIB_FLAG "-q")
set(INCLUDEPATH_FLAG "-I")
set(OPTIMIZATION_LEVEL "-g" )
set(COMPILATION_FLAGS "A \"${OPTIMIZATION_LEVEL}\" ; A \"-fvisibility=hidden\" ; A \"-fPIC\" ; A \"-Wno-switch\" ; A \"-I${EXTERNAL_CPP_INSTALL_PREFIX}\";A \"-std=c++0x\" ;A \"-stdlib=libc++\"; A \"-c\"")
set(LINKING_LIB_FLAGS "A \"\"")
set(LINKING_DLL_FLAGS "A \"-shared\"")
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    set(LINKING_DLL_FLAGS "${LINKING_DLL_FLAGS} ; A \"-flat_namespace\" ; A\"-undefined\" ; A\"suppress\"")
endif()
set(MAKE_STATIC_COMMAND "make_archive")
set(OBJ_EXTENSION "o")
set(LIB_EXTENSION "a")
set(OCSFML_LINKPATH "A \"-L${OCAML_DIR}/site-lib/ocsfml\"")

if(${CPP_DEV_MODE})
  add_definitions(
    -fPIC ${OPTIMIZATION_LEVEL} -std=c++0x -stdlib=libc++
    )
endif()

license: Zlib

repository: kyoDralliam/Ocsfml

repo_name: kyoDralliam/Ocsfml


text:
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.

package outposts

import (
	"context"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/internal/awsutil"
	"github.com/aws/aws-sdk-go-v2/private/protocol"
)

type CreateOutpostInput struct {
	_ struct{} `type:"structure"`

	// The Availability Zone.
	//
	// You must specify AvailabilityZone or AvailabilityZoneId.
	AvailabilityZone *string `min:"1" type:"string"`

	// The ID of the Availability Zone.
	//
	// You must specify AvailabilityZone or AvailabilityZoneId.
	AvailabilityZoneId *string `min:"1" type:"string"`

	// The Outpost description.
	Description *string `min:"1" type:"string"`

	// The name of the Outpost.
	Name *string `min:"1" type:"string"`

	// The ID of the site.
	//
	// SiteId is a required field
	SiteId *string `min:"1" type:"string" required:"true"`
}

// String returns the string representation
func (s CreateOutpostInput) String() string {
	return awsutil.Prettify(s)
}

// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateOutpostInput) Validate() error {
	invalidParams := aws.ErrInvalidParams{Context: "CreateOutpostInput"}
	if s.AvailabilityZone != nil && len(*s.AvailabilityZone) < 1 {
		invalidParams.Add(aws.NewErrParamMinLen("AvailabilityZone", 1))
	}
	if s.AvailabilityZoneId != nil && len(*s.AvailabilityZoneId) < 1 {
		invalidParams.Add(aws.NewErrParamMinLen("AvailabilityZoneId", 1))
	}
	if s.Description != nil && len(*s.Description) < 1 {
		invalidParams.Add(aws.NewErrParamMinLen("Description", 1))
	}
	if s.Name != nil && len(*s.Name) < 1 {
		invalidParams.Add(aws.NewErrParamMinLen("Name", 1))
	}

	if s.SiteId == nil {
		invalidParams.Add(aws.NewErrParamRequired("SiteId"))
	}
	if s.SiteId != nil && len(*s.SiteId) < 1 {
		invalidParams.Add(aws.NewErrParamMinLen("SiteId", 1))
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}

// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s CreateOutpostInput) MarshalFields(e protocol.FieldEncoder) error {
	e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{})

	if s.AvailabilityZone != nil {
		v := *s.AvailabilityZone

		metadata := protocol.Metadata{}
		e.SetValue(protocol.BodyTarget, "AvailabilityZone", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
	}
	if s.AvailabilityZoneId != nil {
		v := *s.AvailabilityZoneId

		metadata := protocol.Metadata{}
		e.SetValue(protocol.BodyTarget, "AvailabilityZoneId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
	}
	if s.Description != nil {
		v := *s.Description

		metadata := protocol.Metadata{}
		e.SetValue(protocol.BodyTarget, "Description", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
	}
	if s.Name != nil {
		v := *s.Name

		metadata := protocol.Metadata{}
		e.SetValue(protocol.BodyTarget, "Name", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
	}
	if s.SiteId != nil {
		v := *s.SiteId

		metadata := protocol.Metadata{}
		e.SetValue(protocol.BodyTarget, "SiteId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
	}
	return nil
}

type CreateOutpostOutput struct {
	_ struct{} `type:"structure"`

	// Information about an Outpost.
	Outpost *Outpost `type:"structure"`
}

// String returns the string representation
func (s CreateOutpostOutput) String() string {
	return awsutil.Prettify(s)
}

// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s CreateOutpostOutput) MarshalFields(e protocol.FieldEncoder) error {
	if s.Outpost != nil {
		v := s.Outpost

		metadata := protocol.Metadata{}
		e.SetFields(protocol.BodyTarget, "Outpost", v, metadata)
	}
	return nil
}

const opCreateOutpost = "CreateOutpost"

// CreateOutpostRequest returns a request value for making API operation for
// AWS Outposts.
//
// Creates an Outpost.
//
//    // Example sending a request using CreateOutpostRequest.
//    req := client.CreateOutpostRequest(params)
//    resp, err := req.Send(context.TODO())
//    if err == nil {
//        fmt.Println(resp)
//    }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/outposts-2019-12-03/CreateOutpost
func (c *Client) CreateOutpostRequest(input *CreateOutpostInput) CreateOutpostRequest {
	op := &aws.Operation{
		Name:       opCreateOutpost,
		HTTPMethod: "POST",
		HTTPPath:   "/outposts",
	}

	if input == nil {
		input = &CreateOutpostInput{}
	}

	req := c.newRequest(op, input, &CreateOutpostOutput{})

	return CreateOutpostRequest{Request: req, Input: input, Copy: c.CreateOutpostRequest}
}

// CreateOutpostRequest is the request type for the
// CreateOutpost API operation.
type CreateOutpostRequest struct {
	*aws.Request
	Input *CreateOutpostInput
	Copy  func(*CreateOutpostInput) CreateOutpostRequest
}

// Send marshals and sends the CreateOutpost API request.
func (r CreateOutpostRequest) Send(ctx context.Context) (*CreateOutpostResponse, error) {
	r.Request.SetContext(ctx)
	err := r.Request.Send()
	if err != nil {
		return nil, err
	}

	resp := &CreateOutpostResponse{
		CreateOutpostOutput: r.Request.Data.(*CreateOutpostOutput),
		response:            &aws.Response{Request: r.Request},
	}

	return resp, nil
}

// CreateOutpostResponse is the response type for the
// CreateOutpost API operation.
type CreateOutpostResponse struct {
	*CreateOutpostOutput

	response *aws.Response
}

// SDKResponseMetdata returns the response metadata for the
// CreateOutpost request.
func (r *CreateOutpostResponse) SDKResponseMetdata() *aws.Response {
	return r.response
}


text:
DESCRIPTION = "Apache Portable Runtime (APR) library"
SECTION = "libs"
MAINTAINER = "Mustafa Yuecel <yuecelm@ee.ethz.ch>"
LICENSE = "Apache License, Version 2.0"

PR = "r0"

# apache mirrors?
SRC_URI = "http://mirror.switch.ch/mirror/apache/dist/apr/${P}.tar.bz2"

inherit autotools lib_package binconfig

do_configure() {
  oe_runconf
}

do_stage() {
  oe_libinstall -a -so -C .libs libapr-1 ${STAGING_LIBDIR}
}

repository: Terentyev/familiar-linux

repo_name: Terentyev/familiar-linux


text:
@Article{kiejna2011epidemiologia,
  title = {Epidemiologia zaburze{\'n} ot{\k{e}}piennych w Polsce--przegl{\k{a}}d bada{\'n}},
  author = {A Kiejna and D Frydecka and P Biecek and T Adamowski},
  journal = {Post{\k{e}}py Nauk Medycznych},
  volume = {8},
  pages = {676--681},
  year = {2011},
}

extension: bib


text:
require gcc_csl-arm.bb

PV = "3.4.4+csl-arm-${SRCDATE}"
BINV = "3.4.4"

SRC_URI += "file://15342.patch;patch=1 file://gcc-3.4.0-arm-lib1asm.patch;patch=1 file://no-libfloat.patch;patch=1"

PR = "r0"

DEFAULT_PREFERENCE = "-1"

repository: jdegges/gumstix-pip-oe

repo_name: jdegges/gumstix-pip-oe