# Kotlin/Native mirror (pkg.shecan.ir)

> Mirror of download.jetbrains.com/kotlin/native: the Kotlin/Native toolchain dependencies (LLVM, GCC toolchain and sysroots, lldb, libffi) that the compiler downloads into ~/.konan/dependencies from dependenciesUrl in konan.properties, and the prebuilt compiler distributions under builds/ used by Kotlin Gradle plugin 1.9 and older (kotlin.native.distribution.baseDownloadUrl).

- Upstream: download.jetbrains.com/kotlin/native
- Mirror URL: <https://mirror-jetbrains.pkg.shecan.ir/kotlin/native/>
- Clients: kotlin-native, gradle, curl
- Service status: <https://pkg.shecan.ir/status.json> (key `jetbrains`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/jetbrains/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/jetbrains.json>

## Limitations

- From Kotlin Gradle plugin 2.0 the compiler itself is downloaded from Maven Central (kotlin-native-prebuilt); use the Maven mirror (mirror-maven.pkg.shecan.ir/central/) in the project repositories. JetBrains no longer publishes 2.2+ compilers under download.jetbrains.com/kotlin/native/builds.
- The Gradle plugin has no property for the dependencies URL: edit dependenciesUrl in konan.properties of each installed compiler (~/.konan/kotlin-native-prebuilt-*/konan/konan.properties), as shown.
- IDE, Toolbox App and other download.jetbrains.com files are not mirrored.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### kotlin-native: persistent (user- or system-wide configuration)

Run (linux, macos)

```sh
for f in ~/.konan/kotlin-native-prebuilt-*/konan/konan.properties; do
  sed -i.bak 's#^dependenciesUrl *=.*#dependenciesUrl = https://mirror-jetbrains.pkg.shecan.ir/kotlin/native#' "$f"
done
```

### gradle: project (files inside the project)

Configuration file, Kotlin Gradle plugin 1.9 or older: `gradle.properties` (checked by hand)

```ini
kotlin.native.distribution.baseDownloadUrl=https://mirror-jetbrains.pkg.shecan.ir/kotlin/native/builds
```

### curl: temporary (one command or the current shell; nothing saved)

Verify

```sh
curl -fLO https://mirror-jetbrains.pkg.shecan.ir/kotlin/native/libffi-3.2.1-2-linux-x86-64.tar.gz
```
