{
    "version": "5.0",
    "description": "A simple and easy-to-use library to enjoy videogames programming (this version is for the MinGW compiler)",
    "homepage": "https://www.raylib.com/",
    "license": "Zlib",
    "architecture": {
        "64bit": {
            "url": "https://github.com/raysan5/raylib/releases/download/5.0/raylib-5.0_win64_mingw-w64.zip",
            "hash": "17dd46401858ca5d747045089bfdedf64abc83848e90733135cb1edfd711f3a6"
        },
        "32bit": {
            "url": "https://github.com/raysan5/raylib/releases/download/5.0/raylib-5.0_win32_mingw-w64.zip",
            "hash": "1db93ae5d78ec2fc8f42d48974365f865ea1fa2b5973a1689e13152f28e2e667"
        }
    },
    "post_install": [
        "# Move extracted files to app root directory",
        "Move-Item \"$dir\\raylib-*\\*\" \"$dir\" && Remove-Item \"$dir\\raylib-*\"",
        "# Configure pkg-config file with the library data.",
        "# Download raylib pkg-config file",
        "Invoke-WebRequest -Uri https://raw.githubusercontent.com/raysan5/raylib/$version/raylib.pc.in -OutFile $dir\\raylib.pc.in",
        "# Create helper variables:",
        "$pc_in = \"$dir\\raylib.pc.in\"",
        "$pc_out = \"$dir\\lib\\pkgconfig\\raylib.pc\"",
        "$pc_dir = \"$dir\\lib\\pkgconfig\"",
        "$cm_dir = \"$dir\"",
        "# Create folder for pkg-config",
        "New-Item -Path $pc_dir -ItemType Directory | Out-Null",
        "# Configure the pkg-config file.",
        "Set-Content $pc_out ((Get-Content $pc_in) `",
        "    -replace \"@CMAKE_INSTALL_PREFIX@\",\"\" `",
        "    -replace \"@libdir_for_pc_file@\",\"`${exec_prefix}/lib\" `",
        "    -replace \"@includedir_for_pc_file@\",\"`${prefix}/include\" `",
        "    -replace \"@PROJECT_VERSION@\",\"$version\" `",
        "    -replace \"@PKG_CONFIG_LIBS_EXTRA@\",\"\" `",
        "    -replace \"@PKG_CONFIG_LIBS_PRIVATE@\",\"\" `",
        "    -replace \"@GLFW_PKG_DEPS@\",\"\" `",
        ")",
        "# Remove raylib.pc.in",
        "Remove-Item \"$dir\\raylib.pc.in\"",
        "# Make the library discoverable by adding the path to the Env variables.",
        "# Do it for the future sessions",
        "# For pkg-config user",
        "$null, $currpath = strip_path (env 'PKG_CONFIG_PATH' $global) $pc_dir",
        "write-host \"Adding $app to PKG_CONFIG_PATH.\"",
        "env 'PKG_CONFIG_PATH' $global \"$pc_dir;$currpath\"",
        "# For cmake user",
        "$null, $currpath = strip_path (env 'CMAKE_PREFIX_PATH' $global) $cm_dir",
        "write-host \"Adding $app to CMAKE_PREFIX_PATH.\"",
        "env 'CMAKE_PREFIX_PATH' $global \"$cm_dir;$currpath\"",
        "# Do it for this session",
        "# For pkg-config user",
        "$null, $env:PKG_CONFIG_PATH = strip_path $env:PKG_CONFIG_PATH $pc_dir",
        "$env:PKG_CONFIG_PATH = \"$pc_dir;$env:PKG_CONFIG_PATH\"",
        "# For cmake user",
        "$null, $env:CMAKE_PREFIX_PATH = strip_path $env:CMAKE_PREFIX_PATH $cm_dir",
        "$env:CMAKE_PREFIX_PATH = \"$cm_dir;$env:CMAKE_PREFIX_PATH\""
    ],
    "uninstaller": {
        "script": [
            "# Remove library link in the env variables",
            "# Create helper variables:",
            "$pc_dir = \"$dir\\lib\\pkgconfig\"",
            "$cm_dir = \"$dir\"",
            "# Delete env variables for future sessions:",
            "$was_in_path, $newpath = strip_path (env 'PKG_CONFIG_PATH' $global) $pc_dir",
            "if($was_in_path) {",
            "    write-host \"Removing $(friendly_path $pc_dir) from your path.\"",
            "    env 'PKG_CONFIG_PATH' $global $newpath",
            "}",
            "$was_in_path, $newpath = strip_path (env 'CMAKE_PREFIX_PATH' $global) $cm_dir",
            "if($was_in_path) {",
            "    write-host \"Removing $(friendly_path $cm_dir) from your path.\"",
            "    env 'CMAKE_PREFIX_PATH' $global $newpath",
            "}",
            "# Delete env variables for this session:",
            "$was_in_path, $newpath = strip_path $env:PKG_CONFIG_PATH $pc_dir",
            "if($was_in_path) { $env:PKG_CONFIG_PATH = $newpath }",
            "$was_in_path, $newpath = strip_path $env:CMAKE_PREFIX_PATH $cm_dir",
            "if($was_in_path) { $env:CMAKE_PREFIX_PATH = $newpath }"
        ]
    },
    "checkver": {
        "github": "https://github.com/raysan5/raylib"
    },
    "autoupdate": {
        "architecture": {
            "64bit": {
                "url": "https://github.com/raysan5/raylib/releases/download/$version/raylib-$version_win64_mingw-w64.zip"
            },
            "32bit": {
                "url": "https://github.com/raysan5/raylib/releases/download/$version/raylib-$version_win32_mingw-w64.zip"
            }
        }
    }
}
