1
0
Fork 0
mirror of https://github.com/Cloudef/bemenu synced 2024-05-21 23:16:12 +02:00

Add darwin.nix and build instructions

This commit is contained in:
Jari Vetoniemi 2022-10-07 13:55:16 +09:00
parent 9f46da3bb5
commit abc46a9a62
2 changed files with 42 additions and 0 deletions

View File

@ -48,6 +48,8 @@ LD_LIBRARY_PATH=. BEMENU_RENDERERS=. ./bemenu-run
## OSX
### Homebrew
```sh
# Make sure you have GNU Make and pkg-config installed
brew install make pkg-config
@ -59,6 +61,15 @@ PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig" sh build-osx.sh curses
# Other than that, follow the normal build steps, but use `build-osx.sh` instead of make
```
### Nix
There is darwin.nix provided in this repo, you can install bemenu with it by running
```sh
nix-env -i -f darwin.nix
```
This installs only the curses backend.
## Dependencies
- C compiler

31
darwin.nix Normal file
View File

@ -0,0 +1,31 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation rec {
name = "bemenu";
src = ./.;
nativeBuildInputs = with pkgs; [ pkg-config scdoc ];
buildInputs = with pkgs; [ ncurses ];
postPatch = ''
substituteInPlace GNUmakefile --replace '-soname' '-install_name'
'';
makeFlags = ["PREFIX=$(out)"];
buildFlags = ["PREFIX=$(out)" "clients" "curses"];
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/fix-darwin-dylib-names.sh
# ^ does not handle .so files
postInstall = ''
so="$(find "$out/lib" -name "libbemenu.so.[0-9]" -print -quit)"
for f in "$out/bin/"*; do
install_name_tool -change "$(basename $so)" "$so" $f
done
'';
meta = with pkgs.lib; {
homepage = "https://github.com/Cloudef/bemenu";
description = "Dynamic menu library and client program inspired by dmenu";
license = licenses.gpl3Plus;
platforms = with platforms; darwin;
};
}