{
    "version": "2.32.10",
    "description": "SDL (Simple DirectMedia Layer) is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.",
    "homepage": "https://www.libsdl.org",
    "license": "Zlib",
    "url": [
        "https://github.com/libsdl-org/SDL/releases/download/release-2.32.10/SDL2-devel-2.32.10-VC.zip",
        "https://github.com/libsdl-org/SDL/releases/download/release-2.32.10/SDL2-2.32.10.zip"
    ],
    "hash": [
        "af347939395a58b365846aaea27391e69f9ec9d4dd650d6ac40802159b418a6e",
        "12b2dc2eb8f2836100a7916b5d394a0c82f1f7e32693f95f98305403af242f08"
    ],
    "installer": {
        "script": [
            "# organize files",
            "mkdir -f \"$dir\\lib\\pkgconfig\" > $null",
            "mkdir -f \"$dir\\include\\SDL2\" > $null",
            "# make arch consistent with scoop naming",
            "mv \"$dir\\SDL2-$version\\lib\\x86\" \"$dir\\SDL2-$version\\lib\\32bit\"",
            "mv \"$dir\\SDL2-$version\\lib\\x64\" \"$dir\\SDL2-$version\\lib\\64bit\"",
            "# only install the requested architecture",
            "mv \"$dir\\SDL2-$version\\lib\\$architecture\\*\" \"$dir\\lib\"",
            "",
            "$srcdir = \"$dir\\SDL2-$version\\\"",
            "mv \"$srcdir\\include\\*.h\"  \"$dir\\include\\SDL2\"",
            "rm \"$dir\\include\\*.h.*\"",
            "$pcin = \"$srcdir\\sdl2.pc.in\"",
            "$pcout = \"$dir\\lib\\pkgconfig\\sdl2.pc\"",
            "Set-Content $pcout ((gc $pcin) `",
            "    -replace \"@prefix@\",\"\" `",
            "    -replace \"@exec_prefix@\",\"`${prefix}\" `",
            "    -replace \"@libdir@\",\"`${exec_prefix}/lib\" `",
            "    -replace \"@includedir@\",\"`${prefix}/include\" `",
            "    -replace \"@SDL_VERSION@\",\"$version\" `",
            "    -replace \"@SDL_RLD_FLAGS@\",\"\" `",
            "    -replace \"@SDL_LIBS@\",\"-lSDL2\" `",
            "    -replace \"@SDL_STATIC_LIBS@\",\"-lSDL2\" `",
            "    -replace \"@SDL_CFLAGS@\",\"\" `",
            "    -replace \"@PKGCONFIG_LIBS_PRIV@\",\"\" `",
            ")",
            "",
            "Remove-Item -Recurse \"$srcdir\"",
            "",
            "$cmdir = if (get_config NO_JUNCTIONS) { $dir } else { \"$(appdir $app $global)\\current\" }",
            "$pcdir = \"$cmdir\\lib\\pkgconfig\"",
            "# future sessions",
            "$null, $currpath = Split-PathLikeEnvVar -Pattern $pcdir -Path (Get-EnvVar -Name 'PKG_CONFIG_PATH' -Global:$global)",
            "Set-EnvVar -Name 'PKG_CONFIG_PATH' -Value \"$pcdir;$currpath\" -Global:$global",
            "$null, $currpath = Split-PathLikeEnvVar -Pattern $cmdir -Path (Get-EnvVar -Name 'CMAKE_PREFIX_PATH' -Global:$global)",
            "Set-EnvVar -Name 'CMAKE_PREFIX_PATH' -Value \"$cmdir;$currpath\" -Global:$global",
            "# this session",
            "$null, $env:PKG_CONFIG_PATH = Split-PathLikeEnvVar -Pattern $pcdir -Path $env:PKG_CONFIG_PATH",
            "$env:PKG_CONFIG_PATH = \"$pcdir;$env:PKG_CONFIG_PATH\"",
            "$null, $env:CMAKE_PREFIX_PATH = Split-PathLikeEnvVar -Pattern $cmdir -Path $env:CMAKE_PREFIX_PATH",
            "$env:CMAKE_PREFIX_PATH = \"$cmdir;$env:CMAKE_PREFIX_PATH\""
        ]
    },
    "uninstaller": {
        "script": [
            "$cmdir = if (get_config NO_JUNCTIONS) { $dir } else { \"$(appdir $app $global)\\current\" }",
            "$pcdir = \"$cmdir\\lib\\pkgconfig\"",
            "# future sessions",
            "$was_in_path, $newpath = Split-PathLikeEnvVar -Pattern $pcdir -Path (Get-EnvVar -Name 'PKG_CONFIG_PATH' -Global:$global)",
            "if($was_in_path) {",
            "    Write-Host \"Removing $(friendly_path $pcdir) from your path.\"",
            "    Set-EnvVar -Name 'PKG_CONFIG_PATH' -Value $newpath -Global:$global",
            "}",
            "$was_in_path, $newpath = Split-PathLikeEnvVar -Pattern $cmdir -Path (Get-EnvVar -Name 'CMAKE_PREFIX_PATH' -Global:$global)",
            "if($was_in_path) {",
            "    Write-Host \"Removing $(friendly_path $cmdir) from your path.\"",
            "    Set-EnvVar -Name 'CMAKE_PREFIX_PATH' -Value $newpath -Global:$global",
            "}",
            "# current session",
            "$was_in_path, $newpath = Split-PathLikeEnvVar -Pattern $pcdir -Path $env:PKG_CONFIG_PATH",
            "if($was_in_path) { $env:PKG_CONFIG_PATH = $newpath }",
            "$was_in_path, $newpath = Split-PathLikeEnvVar -Pattern $cmdir -Path $env:CMAKE_PREFIX_PATH",
            "if($was_in_path) { $env:CMAKE_PREFIX_PATH = $newpath }"
        ]
    },
    "checkver": {
        "github": "https://api.github.com/repos/libsdl-org/SDL/releases",
        "regex": "release-(2.[\\d.]+)"
    },
    "autoupdate": {
        "url": [
            "https://github.com/libsdl-org/SDL/releases/download/release-$version/SDL2-devel-$version-VC.zip",
            "https://github.com/libsdl-org/SDL/releases/download/release-$version/SDL2-$version.zip"
        ]
    }
}
