Skip to content

Commit

Permalink
Merge pull request #43 from mattthias/use_meson_to_build
Browse files Browse the repository at this point in the history
Use meson to build
  • Loading branch information
mattthias authored Apr 17, 2022
2 parents 09f67cd + ffd2d19 commit 657c4dc
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 17 deletions.
49 changes: 34 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,53 @@ HP-UX and Solaris.
- ascii theme support

## slurm was tested on:
- Debian GNU/Linux 8.0
- FreeBSD 10
- CentOS 6/7
- Debian GNU/Linux 10/11 (buster/bullseye)
- FreeBSD 12
- CentOS 7/8

## Compiling:
- Install cmake and libncurses5-dev e.g.:
- Install meson and libncurses6-dev e.g.:
on Debian (if you don't want to use the Debian package of slurm)

apt-get install build-essential
apt-get install cmake libncurses5-dev
sudo apt install build-essential meson libncurses6-dev

or on CentOS / RedHat

yum groupinstall 'Development Tools'
yum install cmake ncurses-devel
# Add EPEL on CentOS 7
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

# Enable PowerTools repo in CentOS 8
sudo dnf config-manager --set-enabled powertools

sudo yum groupinstall 'Development Tools'
sudo yum install meson ncurses-devel

or on FreeBSD 12

pkg install meson pkgconf ncurses

or on Alpine Linux

- Create a build directory
apk add gcc musl-dev pkgconf meson ncurses-dev linux-headers

mkdir _build
- Run cmake to create the Makefiles
or on OpenBSD 6.9

pkg_add meson
# some patches to the code are necessary...

- Setup a build directory

meson setup _build

- Run meson to build

cd _build/
cmake ..
- Run make to build the binary
meson compile

make
- Install the program

sudo make install
sudo meson install

- Try it!

slurm -i eth0 # or whatever your interface is
Expand Down
14 changes: 14 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
project('slurm', 'c')

add_global_arguments('-D_HAVE_NCURSES', language: 'c')

ncurses_dep = dependency('ncurses', version: '>=5')

# build and install slurm binary
executable('slurm', 'slurm.c', dependencies: ncurses_dep, install:true )

# install manpage and theme files
install_man('slurm.1')
install_subdir('themes',
install_dir: get_option('datadir') / 'slurm',
strip_directory: true)
4 changes: 2 additions & 2 deletions os.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@
#include <netinet/in.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <net/ppp_defs.h>
#include <net/if_ppp.h>
#include <linux/ppp_defs.h>
#include <linux/if_ppp.h>
#elif defined (__Solaris__) /* S O L A R I S */
#include <stdio.h>
#define NO_CURSES_E 1
Expand Down

0 comments on commit 657c4dc

Please sign in to comment.