MineSweeper is a simple Minesweeper clone implemented in C using GTK4.
It provides a classic Minesweeper experience with a modern GTK4 interface, and is designed to run on Linux systems.
You can install the latest version of MineSweeper by running the following command in your terminal
curl -sL https://pstasiak2000.github.io/MineSweeper/scripts/install_deb.sh | bashFor older versions of Ubuntu, you will need to build the .deb package first. The script is provided in /scripts/build-deb.sh.
Firstly make sure the relevant dependencies are installed:
sudo apt update
sudo apt install libgtk-4-dev librsvg2-dev devscripts debhelper dh-cmake Now from repo root, run the build script
./scripts/build-deb.shThis will create a minesweeper_X.Y.Z-1_amd64.deb in the parent directory. You can now install the application with
sudo apt install ./minesweeper*.debOn Arch Linux and derivatives, you can build and install using the provided PKGBUILD:
# Clone the repository
git clone https://github.com/pstasiak2000/MineSweeper.git
cd MineSweeper
# Copy the Arch PKGBUILD to the root
cp packaging/arch/PKGBUILD .
# Build and install the package
makepkg -siWarning
Note: The PKGBUILD assumes the repository layout is unchanged. Moving files or directories may cause build failures.
After installation, MineSweeper will be available as a standard application and should appear in your desktop environment’s application menu.
If you prefer to build directly from source, follow these steps:
# Clean previous builds
rm -rf build
# Configure the build directory
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=/usrIf you wish to compile the source code with developer tools included, you can enable them by setting -DCOMPILE_WITH_DEV_TOOLS=TRUE during the configuration.
cmake --build buildThis will compile all source files and generate the MineSweeper executable in the build directory.
- To install to the default systems directories:
sudo cmake --install build- To install to a custom directory (useful for staging or packaging):
DESTDIR=/path/to/install cmake --install build- The application installs a
.desktopfile, so it should integrate with most Linux desktop environments automatically. - Icons are installed in standard locations (
/usr/share/icons/hicolor/...) and should appear in menus and window decorations. - If you’re running KDE, you may need to refresh the application cache:
kbuildsycoca5-
To uninstall:
- If installed via PKGBUILD:
sudo pacman -R minesweeper
- If installed manually: remove the installed files in
/usr/bin,/usr/share/applications/,/usr/share/icons/, and/usr/share/metainfo/.
- GTK4
- librsvg
- glib2 (for building)
- cmake (for building)
- pkgconf (for building)
-
CMAKE cannot find
CMakeLists.txt: Make sure you runcmake -S .from the repository root, not fromsrc/or any other subdirectory. -
Resources errors (
resources.c,.gresource.xml,.png/.svgmissing): Ensure thatresources.cis generated or included insrc/and that the paths inresources.gresource.xmlare correct relative to the repository root. -
PKGBUILD build errors with local sources: Use
source=("file://../")if the PKGBUILD is in a subdirectory, pointing to the repository root.
This ensures $srcdir resolves correctly.
- Application icon not showing in KDE: Refresh the application cache:
kbuildsycoca5- General build errors:
Make sure all dependencies (
gtk4,librsvg,glib2,cmake,pkgconf) are installed.
Clean your build directory if necessary:
rm -rf build