# ninja を Homebrew, chocolatey, MacPorts, Nix, pacman, zypper, scoop, winget でインストール

ninja のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

```sh
sudo av install brew:ninja
```

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install ninja
```

  証拠: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install ninja
```

  証拠: MacPorts ports tree: devel/ninja/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#ninja
```

  証拠: nixpkgs package indexes: pkgs/by-name/ni/ninja/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S ninja
```

  証拠: Arch Linux sync databases: ninja from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install ninja
```

  証拠: openSUSE Tumbleweed package metadata: ninja from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install ninja
```

  証拠: Chocolatey community package catalog: ninja from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','netfx-4.7.1-devpack'

- Scoop (92%):

```sh
scoop install main/ninja
```

  証拠: Scoop official bucket manifest trees: bucket/ninja.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id Ninja-build.Ninja -e
```

  証拠: Windows Package Manager source index: Ninja-build.Ninja from https://cdn.winget.microsoft.com/cache/source.msix

## パッケージ情報

- **パッケージキー:** brew:ninja
- **パッケージマネージャ:** Homebrew
- **バージョン:** 1.13.2
- **ソース概要:** Small build system for use with gyp or CMake
- **ホームページ:** <https://ninja-build.org/>
- **リポジトリ:** <https://github.com/ninja-build/ninja>
- **生成日時:** 2026-08-03T19:37:03+00:00

## 実行可能ファイル

- ninja (エイリアス)

## インストール挙動

- Bottle: 利用不可

## バージョンと鮮度

- ページ生成日: 2026-08-03
- マネージャ版: 1.13.2
## プロジェクトの歴史と使われ方

Ninja is a small, low-level build system optimized for fast incremental builds. Its central idea is deliberately narrow: higher-level tools such as GN, GYP, CMake, Meson, or custom generators decide the project model, and Ninja executes the already-lowered build graph quickly.

### プロジェクトの歴史

Evan Martin wrote Ninja while working on Google Chrome. In his Performance of Open Source Software chapter, he says he started Ninja in 2010 as an experiment to make Chrome builds faster, especially the front of the build where the tool loads build files and starts the first compile. This led to the design that made `.ninja` files simple, generated, and quick to parse.

The project became public and then broadened beyond Chrome. The same history says Ninja gradually replaced other build systems used by Chrome, CMake gained a Ninja generator, and projects such as LLVM and ReactOS used it through CMake. The Ninja homepage later summarized the tool as an assembler-like build system used by Google Chrome, parts of Android, LLVM, and many CMake-backed projects.

### 採用の歴史

Ninja's adoption is unusually strong for such a small tool because it sits at the bottom of many developer workflows. Developers may never hand-write `build.ninja`, but they install Ninja because CMake, Meson, GN, or language build systems generate it and expect a fast executor.

On 2026-07-01, Homebrew listed Ninja 1.13.2 with 545,459 installs over 365 days and 352,367 installs-on-request. That install volume is a package-manager reflection of Ninja's role as a build substrate rather than a tool people necessarily think about directly.

### 使われ方

The normal package-nerd workflow is `cmake -G Ninja -S . -B build` or a Meson/GN equivalent, followed by `ninja -C build`. By default, `ninja` looks for `build.ninja` in the current directory and builds all out-of-date targets; flags such as `-C` and `-j` intentionally resemble Make, although Ninja already runs jobs in parallel by default.

Ninja build files are plain text and debuggable, but the project explicitly does not optimize for hand authoring. This makes the package easy to reason about in dependency graphs: if a formula or language package depends on Ninja, it usually means some higher-level generator will emit the actual build plan.

### パッケージ好きにとっての重要性

Ninja is one of the canonical examples of doing less and winning: no general-purpose project language, no rich conditionals, no policy layer, just a fast executor. Its package significance is huge because it became the common backend for CMake/Meson/GN-era native builds across macOS, Linux, Windows, and cross-platform CI.

### タイムライン

- {'date': '2010', 'event': 'Evan Martin started Ninja while working on Google Chrome.'}
- {'date': '2010s', 'event': 'Ninja spread from Chrome to CMake-backed projects including LLVM and ReactOS.'}
- {'date': '2025-07-10', 'event': 'Ninja homepage listed v1.13.1 as released.'}
- {'date': '2026-07-01', 'event': 'Homebrew formula listed stable Ninja 1.13.2.'}

### Related projects

- CMake
- GN
- GYP
- Meson
- LLVM
- Chromium

### ソース

- <https://aosabook.org/en/posa/ninja.html>
- <https://formulae.brew.sh/formula/ninja>
- <https://ninja-build.org/>
- <https://ninja-build.org/manual>


## セキュリティノート

build system capable of executing project logic.

- **Geiger リスク:** yellow / 高
- build system capable of executing project logic

## 他のパッケージマネージャ記録

- Nix - ninja: normalized package name match | nixpkgs package indexes: pkgs/by-name/ni/ninja/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - ninja - 1.13.2-3: normalized package name match | Arch Linux sync databases: ninja from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Small build system with a focus on speed | https://ninja-build.org/
- zypper - ninja - 1.13.2-1.5: normalized package name match | openSUSE Tumbleweed package metadata: ninja from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A small build system closest in spirit to Make | https://ninja-build.org/
- MacPorts - ninja: normalized package name match | MacPorts ports tree: devel/ninja/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - ninja: normalized package name match | Chocolatey community package catalog: ninja from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','netfx-4.7.1-devpack'
- Scoop - main/ninja: normalized package name match | Scoop official bucket manifest trees: bucket/ninja.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - Ninja-build.Ninja: normalized package name match | Windows Package Manager source index: Ninja-build.Ninja from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

View the package source record on GitHub. [combined/ninja.yml](https://github.com/mxcl/pkgdb/blob/main/combined/ninja.yml)


## ソース

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
