1
0
Fork 0
mirror of https://github.com/Cloudef/bemenu synced 2024-04-16 06:44:06 +02:00

nix: use pname and add generated version

This commit is contained in:
Jari Vetoniemi 2022-10-11 14:48:24 +09:00
parent d235dc38f7
commit d5121dedad

View File

@ -1,8 +1,15 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation rec {
name = "bemenu";
src = ./.;
let
src = pkgs.copyPathToStore ./.;
semver = builtins.readFile "${src}/VERSION";
revision = builtins.readFile (pkgs.runCommand "get-rev" {
nativeBuildInputs = with pkgs; [ git ];
} "GIT_DIR=${src}/.git git rev-parse --short HEAD | tr -d '\n' > $out");
in pkgs.stdenv.mkDerivation rec {
inherit src;
pname = "bemenu";
version = "${semver}${revision}";
nativeBuildInputs = with pkgs; [ pkg-config scdoc ];
buildInputs = with pkgs; [ ncurses ];