msys2/MINGW-packages: PKGBUILD Scripts Behind MSYS2's MinGW-w64 Binaries
Project brief: Package scripts for MinGW-w64 targets to build under MSYS2. MINGW-packages This repository contains package scripts for MinGW-w64 targets to build under MSYS2.
At a glance
- What is it?
- MINGW-packages is the PKGBUILD repository that MSYS2's build system turns into pre-built MinGW-w64 binary packages. It is a packaging repository, not a compiler distribution, and the README is explicit that most users should install the binaries rather than build from these scripts.
- Who is it for?
- Adopt MINGW-packages if you are a packager, a maintainer, or someone who needs a specific version or build flag that the pre-built UCRT64 binaries do not provide, and you are comfortable with MSYS2's build tooling. Do not adopt it if you just want a compiler on Windows: the README's own recommendation is to install the pre-built binary packages, and the last push to this repository was on 2020-08-16, so treat the tree as a snapshot rather than a moving target.
- Can I use it commercially?
- Yes. BSD-3-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly Shell, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 17, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What MINGW-packages Actually Is, and Who It Is For
This repository contains package scripts for MinGW-w64 targets to build under MSYS2. That sentence is the whole scope. It is not a compiler, not an installer, and not a runtime. It is a collection of per-package directories, each named mingw-w64-<something>, that hold the build recipe MSYS2 uses to produce a Windows-targeted binary from upstream source.
MSYS2 itself is described in the README as an independent rewrite of MSYS providing a Unix-like environment and command-line interface for Windows, which makes it possible to port software running on POSIX systems to Windows. MINGW-packages is the layer above that: the recipes that turn ported software into installable packages.
The audience is therefore narrow and specific. Package maintainers who want to add or update a library. People who need a build of some library that differs from what the repository ships, whether that means an older version or a different configuration. And anyone curious enough to read how a given Windows port is actually assembled. If you write C or C++ on Windows and just want headers and libraries to link against, you are not the audience for the scripts. You are the audience for the binaries they produce.
The PKGBUILD Layout and the Data Flow From Script to Installed Library
The top-level listing is almost entirely package directories: mingw-w64-7zip, mingw-w64-SDL2, mingw-w64-abseil-cpp, mingw-w64-alacritty, and hundreds more in the same pattern. Alongside them sit a small number of infrastructure entries: .ci/, .devcontainer/, .github/, .gitattributes, .gitignore, .mailmap, LICENSE, README.md, and three shared directories named mingw-w64-PKGBUILD-common/, mingw-w64-PKGBUILD-templates/, and mingw-w64-PKGBUILD-common/.
The presence of PKGBUILD-common and PKGBUILD-templates tells you something about the design. Package scripts are not written from scratch each time. They share common fragments and start from templates, which is why hundreds of directories can stay broadly consistent in structure. For a contributor, that is the useful part: you copy the pattern, adjust the source URL, version, dependencies and build commands, and the surrounding machinery stays the same.
The data flow is one-directional. A change merges into the git repository. The build system picks it up. Compiled packages then appear in the MSYS2 UCRT64 repository. The README warns that this is not instant: after merging changes, it can take a few days until compiled and built packages are accessible in the repo. That lag is the single most important operational fact about this project, because it means a merged pull request is not the same thing as an available package.
Installing Pre-Built MinGW Packages With pacman
The README's first and recommended path is to skip this repository entirely and install the pre-built binary packages from the MSYS2 UCRT64 repo, which include the binaries, libraries, headers and man pages. The stated assumption is a properly installed MSYS2 environment, and the command runs from the bash prompt:
pacman -S ${package-name}Substitute the real package name, for example mingw-w64-ucrt-x86_64-sdl2. The package name is not the directory name in this repository; the README points to the MSYS2 package management documentation for finding the correct package, and the project homepage at packages.msys2.org is the searchable index. What you should see is pacman resolving the package and its dependencies and writing files into the MSYS2 tree.
Two caveats come straight from the README. First, not all packages in this repository are built and accessible from the UCRT64 repo right away, so a directory existing here does not guarantee an installable package today. Second, availability of old versions is uneven: for some packages you can find older versions in the repo if you need them, for others only the most recent version is present.
Building a Package Yourself With makepkg-mingw
The alternative the README gives is to download or clone the package folder and build it yourself, in whatever version you like. This is the path for someone who needs a specific version or a build variation that the repository does not carry. It assumes a properly installed MSYS2 environment and build tools.
From inside the package directory, the build command is:
cd ${package-name}
MINGW_ARCH=ucrt64 makepkg-mingw -sLfMINGW_ARCH=ucrt64 selects the UCRT64 target, matching the repo the README names. The -sLf flags are the ones the README shows; it does not spell out what each does, so treat the line as a unit rather than improvising variants. When the build finishes, the resulting package files are installed locally with:
pacman -U ${package-name}*.pkg.tar.zstThe glob matters: makepkg-mingw can emit more than one package file, and the README says to install the freshly built package or packages. Note the extension .pkg.tar.zst, which is the format the README uses. If the build fails, the README does not document rollback or cleanup, so you are working from the general behaviour of the tooling rather than from anything this repository specifies.
Where This Repository Is the Wrong Tool
The clearest limitation is stated by the project itself: the common way to use these packages is as pre-built binaries. Cloning MINGW-packages to get a working compiler toolchain is a misreading of what it is. There is no MinGW-w64 download here, no installer, and no compiler binary in the tree. The directories contain scripts.
A second limitation is version availability. The README says that for some packages you can find older versions in the repo if you need older version, and for some packages you have only the most recent version. That asymmetry means you cannot assume that pinning to an older release is possible for any given library. If your project depends on a specific older version of something and the repo only carries the most recent one, building from this repository will not save you; you will have to fetch and adapt the recipe yourself.
A third is the merge-to-availability delay of a few days. Anyone treating a merged change as an immediately usable package will be surprised. And the last push to this repository was on 2020-08-16, so the state of the tree reflects that point rather than continuous activity. That does not make the scripts useless, but it does mean you should check the individual package directory you care about rather than assuming the whole collection tracks upstream releases.
How It Compares to Pulling a MinGW-w64 Toolchain Directly
The obvious alternative is to obtain a MinGW-w64 toolchain directly and manage libraries yourself, rather than going through a package manager at all. The difference in approach is fundamental. A direct toolchain gives you a compiler and a sysroot and leaves every third-party library as your problem: you fetch source, configure it for the target, build it, and keep track of what you built. There is no package database and no dependency resolution.
MINGW-packages takes the opposite position. Each library is a recipe in a directory, the build is driven by makepkg-mingw, and the result is installed through pacman, which means dependencies, file ownership and upgrades are handled by the package manager. The cost is the indirection: you depend on someone else's recipe, on the repository's build infrastructure, and on the few-day lag before a merged change becomes installable. You also inherit whatever version the recipe pins.
Which is better depends on what you are doing. If you need one toolchain and a handful of libraries you build once, a direct approach keeps you in control of every flag. If you are maintaining software that links against dozens of libraries and you want those libraries updated and installed consistently, the package-script route removes a large amount of manual work, at the price of waiting on and trusting the recipes.
Licence, Maintenance Cost and What to Check Before Contributing
The LICENSE file carries the BSD 3-Clause "New" or "Revised" License, and the README's licence section refers to it as MSYS2-packages, a naming slip worth knowing about when you search for it. BSD 3-Clause is permissive: it allows use and redistribution provided the copyright notice and licence text are retained and the names of contributors are not used to endorse derived products. That applies to the repository's own scripts. It says nothing about the licences of the hundreds of upstream projects those scripts build. If you redistribute a package built from one of these directories, the upstream project's licence governs the binary, and those licences vary widely. This is not legal advice; read the LICENSE file and the individual package's upstream licence.
The maintenance cost of contributing is not in writing a PKGBUILD from nothing. The PKGBUILD-common and PKGBUILD-templates directories exist precisely so that new packages follow an established shape. The real cost is ongoing: upstream releases move, source URLs and checksums change, and a recipe that is not updated stops building. Because the last push to this repository was on 2020-08-16, anyone treating the tree as current should verify the specific package directory they intend to use, including whether its source references still resolve. The README points to the MSYS2 wiki page on creating packages for instructions and advice, which is where the conventions live rather than in this repository's own documentation.
Editorial conclusion
Adopt MINGW-packages if you are a packager, a maintainer, or someone who needs a specific version or build flag that the pre-built UCRT64 binaries do not provide, and you are comfortable with MSYS2's build tooling. Do not adopt it if you just want a compiler on Windows: the README's own recommendation is to install the pre-built binary packages, and the last push to this repository was on 2020-08-16, so treat the tree as a snapshot rather than a moving target. Before relying on it, verify the package folder for the library you need actually exists, check whether an older version is still in the repo or only the most recent one, and read the LICENSE file for the BSD 3-Clause terms.
Frequently asked questions
How can I list the installed packages in MSYS2?
The README does not give a listing command. It only shows pacman -S for installing a pre-built binary package and pacman -U for installing a package you built locally, and it points to the MSYS2 package management documentation for details about finding the correct package.
Which MSYS2 should I use?
The README names the MSYS2 UCRT64 repo as the source of pre-built binary packages, and its self-build example sets MINGW_ARCH=ucrt64. It does not compare the available environments or recommend one over another; that guidance is in the MSYS2 documentation.
Is MinGW better than MSYS2?
The README does not treat them as competing choices. It describes MSYS2 as an independent rewrite of MSYS providing a Unix-like environment for Windows, and this repository as package scripts for MinGW-w64 targets that build under MSYS2, so the two are layers rather than alternatives.
What is MinGW used for?
The README frames MinGW-w64 as the target for the packages in this repository: each directory is a package script for a MinGW-w64 target built under MSYS2, producing Windows binaries, libraries, headers and man pages that you then build against.
Community notes