pkg.soopen package index

brew / 排名 9647

使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper 安装 unifdef

查看 unifdef 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install unifdef

local Homebrew formula metadata

MacPorts已验证 · 94%
sudo port install unifdef

MacPorts ports tree · devel/unifdef/Portfile · 来源: api.github.com

Linux

Alpine Linux apk已验证 · 92%
sudo apk add unifdef

Alpine Linux edge package indexes · unifdef · 来源: dl-cdn.alpinelinux.org

Debian apt已验证 · 92%
sudo apt install unifdef

Debian stable package indexes · unifdef · 来源: deb.debian.org

Fedora dnf已验证 · 92%
sudo dnf install unifdef

Fedora Rawhide package metadata · unifdef · 来源: dl.fedoraproject.org

Nix已验证 · 92%
nix profile install nixpkgs#unifdef

nixpkgs package indexes · pkgs/by-name/un/unifdef/package.nix · 来源: api.github.com

Arch Linux pacman已验证 · 92%
sudo pacman -S unifdef

Arch Linux sync databases · unifdef · 来源: geo.mirror.pkgbuild.com

openSUSE zypper已验证 · 92%
sudo zypper install unifdef

openSUSE Tumbleweed package metadata · unifdef · 来源: download.opensuse.org

概览

软件包摘要

Selectively process conditional C preprocessor directives

命令和别名

  • unifdef
  • unifdefall

历史

项目历史与用法

unifdef is a source-filtering utility that selectively removes C preprocessor conditionals. The official manual says it processes `#if`, `#ifdef`, `#ifndef`, `#elif`, `#else`, and `#endif` lines when command-line macro definitions are sufficient to decide whether a block should be kept or removed.

项目历史

unifdef is much older than its GitHub mirror. The official manual states that the command appeared in 2.9BSD, and that ANSI C support was added in FreeBSD 4.7. It also credits the original implementation to Dave Yost and Tony Finch's rewrite for ANSI C support.

Tony Finch's official project page explains the modern motivation: understanding `xterm`'s heavily conditionalized pty-handling code. That places unifdef in the Unix source-reading and source-cleanup tradition rather than in general-purpose preprocessing.

The current project page publishes release archives, manual documentation, a browsable source repository, and a GitHub collaboration mirror. The GitHub README warns that GitHub release downloads are incomplete and points users back to the official dotat.at release files, which is useful context for packagers.

采用历史

The official homepage gives a concrete high-profile adoption example: the Linux kernel uses unifdef to strip `#ifdef __KERNEL__` sections from headers exported to userland. It also notes use outside C, including LaTeX workflows.

The supplied package facts show broad distribution packaging across Homebrew, Debian/Ubuntu, Fedora/DNF, Alpine, Arch, MacPorts, Nix, openSUSE, and others. That matches the tool's age and purpose: it is small, portable, and useful in build and source-export pipelines.

使用方式

unifdef is used by specifying macros with `-D`, `-U`, or a definitions file, then filtering input files so known conditional branches are removed while unknown conditionals are preserved. It can operate on stdin/stdout or modify files in place.

The manual also documents `unifdefall`, a script that uses `unifdef -s` and `cpp -dM` to derive macro information and remove all conditional directives from a file. This shows the tool's role as a controlled partial preprocessor rather than a full C preprocessor replacement.

为什么软件包爱好者会关心

unifdef is important in the package-nerd niche because it is both tiny and historically deep: a BSD-era tool still used for practical source filtering. It belongs in base-system and package-manager collections because build scripts and source-export tasks can depend on it without pulling in a large toolchain beyond normal C build support.

Its Linux-kernel header-export use case is exactly the kind of quiet infrastructure job package maintainers care about: remove implementation-only conditional sections, preserve line-oriented source structure, and keep generated user-facing source understandable.

时间线

  • 2.9BSD: Manual says the `unifdef` command appeared.
  • FreeBSD 4.7: Manual says ANSI C support was added.
  • 2015: Official manual page is dated December 3, 2015.
  • Current project page: Release 2.12 archives are published on dotat.at.
  • Current README: GitHub is maintained as a collaboration mirror, while release downloads remain on dotat.at.

Related projects

  • The manual lists `cpp(1)` and `diff(1)` as related tools.
  • The official page cites Linux kernel header export as a real-world use.
  • The official page also mentions use with LaTeX, showing text-mode uses outside C.

安全态势

尚未找到受保护工具覆盖

没有找到 unifdef 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布,以便未来覆盖拥有稳定的软件包 URL。

安装行为

  • 未记录 Homebrew bottle 元数据。

建议审查

在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。

可执行文件

已安装的可执行文件

命令类型暴露范围备注
unifdef可执行文件已索引可执行文件从本地可执行文件索引发现。
unifdefall可执行文件已索引可执行文件从本地可执行文件索引发现。

新鲜度

版本和新鲜度

这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。

页面生成时间2026-08-03
管理器版本2.12
管理器更新时间
本地数据未知
上游不可用
检测到的最新版本未检测到
  • OK没有生成新鲜度警告。

安装元数据

软件包元数据

软件包键brew:unifdef
版本2.12
软件包管理器Homebrew
主页https://dotat.at/prog/unifdef/
仓库https://github.com/fanf2/unifdef
Bottle未记录
服务未声明

源数据库匹配

其他软件包管理器记录

匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。

Debian apt95%

unifdef 2.12-1

Remove cpp '#ifdef' lines from files

http://dotat.at/prog/unifdef/

sudo apt install unifdef
  • Section: devel
  • Architecture: amd64
  • 2 依赖
  • normalized package name match
  • 匹配方式:Unifdef
Debian stable package indexes · deb.debian.org · Debian stable package indexes: unifdef from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix95%

unifdef

nix profile install nixpkgs#unifdef
  • normalized package name match
  • 匹配方式:Unifdef
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/un/unifdef/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
Ubuntu apt95%

unifdef 2.12-1

Remove cpp '#ifdef' lines from files

http://dotat.at/prog/unifdef/

sudo apt install unifdef
  • Section: universe/devel
  • Architecture: amd64
  • 2 依赖
  • normalized package name match
  • 匹配方式:Unifdef
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: unifdef from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
apk95%

unifdef 2.12-r4

Selectively remove C preprocessor conditionals

https://github.com/fanf2/unifdef

sudo apk add unifdef
  • License: BSD-2-Clause AND BSD-3-Clause
  • Architecture: x86_64
  • Source Package: unifdef
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Unifdef
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: unifdef from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

unifdef-doc 2.12-r4

Selectively remove C preprocessor conditionals (documentation)

https://github.com/fanf2/unifdef

sudo apk add unifdef-doc
  • License: BSD-2-Clause AND BSD-3-Clause
  • Architecture: x86_64
  • Source Package: unifdef
  • normalized package name match
  • 匹配方式:Unifdef
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: unifdef-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
dnf95%

unifdef 2.12-9.fc45

Selectively remove C preprocessor conditionals

https://dotat.at/prog/unifdef/

sudo dnf install unifdef
  • License: BSD-2-Clause AND BSD-3-Clause
  • Category: Unspecified
  • Architecture: x86_64
  • Source Package: unifdef
  • 3 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Unifdef
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: unifdef from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst
pacman95%

unifdef 2.12-4

Remove #ifdef'ed lines

https://dotat.at/prog/unifdef/

sudo pacman -S unifdef
  • License: GPL
  • Architecture: x86_64
  • normalized package name match
  • 匹配方式:Unifdef
Arch Linux sync databases · geo.mirror.pkgbuild.com · Arch Linux sync databases: unifdef from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz
zypper95%

unifdef 2.12-3.5

Removes ifdefs from C files

https://dotat.at/prog/unifdef/

sudo zypper install unifdef
  • License: BSD-2-Clause
  • Category: Development/Libraries/C and C++
  • Architecture: x86_64
  • Source Package: unifdef
  • 2 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Unifdef
openSUSE Tumbleweed package metadata · download.opensuse.org · openSUSE Tumbleweed package metadata: unifdef from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst
MacPorts95%

unifdef

sudo port install unifdef
  • normalized package name match
  • 匹配方式:Unifdef
MacPorts ports tree · api.github.com · MacPorts ports tree: devel/unifdef/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

来源线索

由仓库数据生成

此页面由 av-webscripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。

使用的来源

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