forked from RepoMirrors/bemenu
Add darwin.nix and build instructions
This commit is contained in:
parent
9f46da3bb5
commit
abc46a9a62
11
README.md
11
README.md
@ -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
31
darwin.nix
Normal 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;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user