Skip to content

A 'simple' Makefile to automate building of wlroots, sway and a few other related utilities

Notifications You must be signed in to change notification settings

schauveau/sway-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sway-build

A 'simple' Makefile to build wlroots, sway and a few other related utilities

sway-build

The purpose of this repository is to provide 'simple' Makefile to build wlroots, sway and a few other related utilities.

The Makefile was tested on Debian unstable but its should hopefully work on other systems with minimal changes.

As of today the Makefile can build the following packages

  • wlroots (required by sway)
  • jsonc (required by sway)
  • sway
  • swayidle - Idle management daemon for Sway
  • swaylock - Lockscreen application for Sway
  • grim - Screenshot application for Sway
  • slurp - Select a region with the mouse (for grim)
  • mako - Notification daemon for Sway

Required packages

The file debian-packages.txt provides a list of required packages for Debian/Buster (testing). It is likely incomplete but this is probably a good starting point.

The required apt-get command can be obtained with

make required-apt-install

Customization of the Makefile

The TARGET variable defines the installation direction and probably needs to be customized according to your needs.

Case 1: Installation in /usr/local/

PREFIX=/usr/local
LIBDIR=
SUDO=sudo

Case 2: Installation in a non-standard directory owned by root

PREFIX=/opt/sway-desktop
LIBDIR=lib
SUDO=sudo

Case 3: Installation in a directory owned by user

PREFIX=$(HOME)/sway/
LIBDIR=lib
SUDO=

The variable SUDO is used by the installation targets.

On Debian based systems, LIBDIR forces meson to install libraires and pkg-config files in the specified subdirectory. A typical value is lib but other values such as lib32, lib64 or lib/x86_64-linux-gnu are possible. That should not be needed when installing in /usr/local.

A few other variables can be customized. Please refer the Makefile for more details.

Environment Variables

When using a non-standard target directory, it may be necessary to define a few environment varables (PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH, MANPATH, ...).

Use make env-sh-build (or the script generate-env.sh) to produce a suitable shell script in $(BUILD_DIR)/env.sh.

And of course, you need to source that generated script before compiling the various packages (because of pkg-config) and before starting your sway desktop.

source  ..../path/to/sway/env.h

Generic Makefile targets

make list-targets

List all available targets in the Makefile

make full-install

Attempt to clone from github, configure, build and install all targets.

make required-apt-install

Print the command required to install all required packages for Debian/Buster

make env-sh-build

Generate a shell script to set the required environment variables in $(BUILD_DIR)/env.sh

Specific Makefile target for package xxxx

make xxxx-git-clone

Clone the sources from git in directory $SRC_DIR/xxxx/:

  • For most packages, the default behavior is to clone the master branch

  • Be aware that git clone is made significantly faster by dropping the history with the option --depth=1. That behavior may not be desirable if you intend to develop in that source directory.

make xxxx-git-pull

Do a git pull in $SRC_DIR/xxxx/

make xxxx-configure

Create the $(BUILD_DIR)/xxxx directory and configure.

make xxxx-build

Build the package

make xxxx-clean

Clean a previous build of the package

make xxx-install

Install the package (only after a successfull build)

make xxxx-rebuild

An alias for

make xxxx-clean
make xxxx-build

make xxxx-all

An alias for

make xxxx-git-clone
make xxxx-configure
make xxxx-clean
make xxxx-build

make xxxx-all-install

An alias for

make xxxx-all
make xxxx-install

About

A 'simple' Makefile to automate building of wlroots, sway and a few other related utilities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published