# Install swig with Homebrew, apk, chocolatey, apt, dnf, MacPorts, Nix, pacman, zypper, scoop, winget

Generate scripting interfaces to C/C++ code. Version 4.4.1 via Homebrew; verified from local package data. Also installable with debian: sudo apt install swig.

## Install

```sh
sudo av install brew:swig
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install swig
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install swig
```

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

### Linux

- apk (92%):

```sh
sudo apk add swig
```

  Evidence: Alpine Linux edge package indexes: swig from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install swig
```

  Evidence: Debian stable package indexes: swig from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install swig
```

  Evidence: Fedora Rawhide package metadata: swig from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#swig
```

  Evidence: nixpkgs package indexes: pkgs/by-name/sw/swig/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S swig
```

  Evidence: Arch Linux sync databases: swig from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install swig
```

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

### Windows

- Chocolatey (92%):

```sh
choco install swig
```

  Evidence: Chocolatey community package catalog: swig from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','striata-reader'

- Scoop (92%):

```sh
scoop install main/swig
```

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

- winget (92%):

```sh
winget install --id SWIG.SWIG -e
```

  Evidence: Windows Package Manager source index: SWIG.SWIG from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:swig
- **Package manager:** Homebrew
- **Version:** 4.4.1
- **Source summary:** Generate scripting interfaces to C/C++ code
- **Homepage:** <https://www.swig.org/>
- **Repository:** <https://github.com/swig/swig>
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- ccache-swig (alias)
- swig (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 4.4.1
## Project history and usage

SWIG, the Simplified Wrapper and Interface Generator, is a long-running tool for connecting C and C++ programs to higher-level languages. In package-manager culture it is a classic build dependency: old, portable, cross-language, and often installed because another package needs generated bindings.

### Project history

SWIG began in July 1995 when Dave Beazley developed it at Los Alamos National Laboratory for scientific software that needed scripting interfaces. The official history says it was rewritten in C++ at the University of Utah in January 1996 and expanded beyond its original environment to Tcl, Perl, and Guile.

Version 1.0 arrived in September 1996 with Python support, followed by 1.1 in 1997. The long 1.3 development series began in 2000 and carried the project through a decade of incremental language and parser work before SWIG 2.0.0 was released in 2010.

Later major releases continued to track C++ and target-language evolution: 3.0.0 in 2014, 4.0.0 in 2019, 4.1.x in 2022, 4.2.x in 2023-2024, 4.3.x in 2024-2025, and 4.4.x in 2025.

### Adoption history

The SWIG homepage describes support for common scripting languages including JavaScript, Perl, PHP, Python, Tcl, and Ruby, plus non-scripting targets such as C#, D, Go, Java, Lua, OCaml, Octave, Scilab, R, and Guile. That breadth made it a general-purpose bridge for C and C++ libraries rather than a single-language extension tool.

The documentation page lists papers and tutorials from the 1996-1998 period and later training material, reflecting early adoption in Tcl, Python, Perl, scientific computing, and systems integration communities.

The input package facts show SWIG in many package managers, including apk, Homebrew, Chocolatey, Debian, DNF, MacPorts, Nix, pacman, Scoop, Ubuntu, winget, and zypper. That distribution footprint fits its role as a cross-platform tool needed by both developers and downstream package builds.

### How it is used

SWIG is commonly used to parse C or C++ declarations and generate wrapper or glue code so higher-level languages can call native libraries. It is also used for prototyping, testing, embedding interpreters, and exporting parse information.

In package builds, SWIG often appears as a build-time dependency for projects that ship generated bindings for Python, Java, Ruby, Perl, Tcl, R, Octave, or other target languages.

### Why package nerds care

SWIG is package-nerd significant because it is part compiler, part portability layer, and part historical artifact of scripting-language extension culture. It lets a C or C++ library become packages in multiple language ecosystems without hand-writing every binding layer.

Its long release history also matters operationally: old software may require old SWIG behavior, while new packages need modern C++, Python, JavaScript, Ruby, PHP, Go, or Java support. Distribution maintainers therefore care about which SWIG version is installed and when generated files are regenerated.

### Timeline

- 1995: SWIG developed at Los Alamos National Laboratory.
- 1996: First alpha release and version 1.0 with Python support.
- 1997: Version 1.1 released.
- 2000: SWIG 1.3 alpha series begins.
- 2010: SWIG 2.0.0 released.
- 2014: SWIG 3.0.0 released.
- 2019: SWIG 4.0.0 released.
- 2022: SWIG 4.1.0 and 4.1.1 released.
- 2024: SWIG 4.2.x and 4.3.0 released.
- 2025: SWIG 4.3.1, 4.4.0, and 4.4.1 released.

### Related projects

- Related technologies include Python extension modules, Perl XS, JNI, CFFI/ctypes-style foreign function interfaces, CORBA/IDL-style interface compilers, and package build systems that generate language bindings from C and C++ headers.

### Sources

- <https://www.swig.org/>
- <https://www.swig.org/compat.html>
- <https://www.swig.org/doc.html>
- <https://www.swig.org/history.html>
- input.source_facts.package-manager


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Other Package-Manager Records

- Debian apt - swig - 4.3.0-1: normalized package name match | Debian stable package indexes: swig from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Generate scripting interfaces to C/C++ code | https://www.swig.org/
- Debian apt - swig-doc - 4.3.0-1: normalized package name match | Debian stable package indexes: swig-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | HTML documentation for SWIG | https://www.swig.org/
- Debian apt - swig-examples - 4.3.0-1: normalized package name match | Debian stable package indexes: swig-examples from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Examples for applications of SWIG | https://www.swig.org/
- Nix - swig: normalized package name match | nixpkgs package indexes: pkgs/by-name/sw/swig/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - swig - 4.2.0-2ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: swig from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Generate scripting interfaces to C/C++ code | http://www.swig.org/
- Ubuntu apt - swig-doc - 4.2.0-2ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: swig-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | HTML documentation for SWIG | http://www.swig.org/
- Ubuntu apt - swig-examples - 4.2.0-2ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: swig-examples from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Examples for applications of SWIG | http://www.swig.org/
- apk - swig - 4.4.1-r1: normalized package name match | Alpine Linux edge package indexes: swig from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A compiler that makes it easy to integrate C and C++ code with scripting languages | https://www.swig.org/
- apk - swig-doc - 4.4.1-r1: normalized package name match | Alpine Linux edge package indexes: swig-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | A compiler that makes it easy to integrate C and C++ code with scripting languages (documentation) | https://www.swig.org/
- dnf - ccache-swig - 4.4.1-8.fc45: normalized package name match | Fedora Rawhide package metadata: ccache-swig from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Fast compiler cache | https://www.swig.org/
- dnf - python3-swig - 4.4.1-8.fc45: normalized package name match | Fedora Rawhide package metadata: python3-swig from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Python package metadata for SWIG | https://www.swig.org/
- dnf - swig - 4.4.1-8.fc45: normalized package name match | Fedora Rawhide package metadata: swig from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Connects C/C++/Objective C to some high-level programming languages | https://www.swig.org/
- dnf - swig-doc - 4.4.1-8.fc45: normalized package name match | Fedora Rawhide package metadata: swig-doc from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Documentation files for SWIG | https://www.swig.org/
- dnf - swig-gdb - 4.4.1-8.fc45: normalized package name match | Fedora Rawhide package metadata: swig-gdb from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Commands for easier debugging of SWIG | https://www.swig.org/
- pacman - swig - 4.4.1-2: normalized package name match | Arch Linux sync databases: swig from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Generate scripting interfaces to C/C++ code | https://www.swig.org/
- zypper - swig - 4.4.1-2.3: normalized package name match | openSUSE Tumbleweed package metadata: swig from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Simplified Wrapper and Interface Generator | https://www.swig.org/


## Combined YAML source

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


## Sources

- 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
