Skip to content

Commit

Permalink
refactor(pistache): Improve derivation
Browse files Browse the repository at this point in the history
* List all deps explicitly and remove `with pkgs;`
* Remove unused `gtest` and `doxygen` deps
* Enable OpenSSL support and make it optional
* Replace `with lib; with platforms;` with `lib.platforms.*`
* Use `pname` attribute instead of name
* Set platforms to Linux only, as per:
  pistacheio/pistache#6 (comment)
  • Loading branch information
PetarKirov committed Mar 30, 2023
1 parent e99a10e commit 65fc15c
Showing 1 changed file with 36 additions and 23 deletions.
59 changes: 36 additions & 23 deletions packages/pistache/default.nix
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
{pkgs}:
with pkgs;
stdenv.mkDerivation rec {
name = "pistache-${version}";
version = "2023-02-25";
src = fetchFromGitHub {
owner = "pistacheio";
repo = "pistache";
rev = "ae073a0709ed1d6f0c28db90766c64b06f0366e6";
hash = "sha256-4mqiQRL3ucXudNRvjCExPUAlz8Q5BzEqJUMVK6f30ug=";
};
{
stdenv,
lib,
fetchFromGitHub,
meson,
cmake,
ninja,
pkgconfig,
openssl,
rapidjson,
howard-hinnant-date,
}:
stdenv.mkDerivation rec {
pname = "pistache";
version = "2023-02-25";
src = fetchFromGitHub {
owner = "pistacheio";
repo = "pistache";
rev = "ae073a0709ed1d6f0c28db90766c64b06f0366e6";
hash = "sha256-4mqiQRL3ucXudNRvjCExPUAlz8Q5BzEqJUMVK6f30ug=";
};

nativeBuildInputs = with pkgs; [meson cmake ninja pkgconfig gtest];
nativeBuildInputs = [meson cmake ninja pkgconfig];

buildInputs = with pkgs; [
doxygen
openssl
rapidjson
howard-hinnant-date
];
buildInputs = [
openssl
rapidjson
howard-hinnant-date
];

meta = with lib; {
homepage = "https://github.com/pistacheio/pistache";
platforms = with platforms; linux ++ darwin;
};
}
mesonFlags =
lib.optional (openssl != null)
(lib.mesonOption "PISTACHE_USE_SSL" "true");

meta = {
homepage = "https://github.com/pistacheio/pistache";
platforms = lib.platforms.linux;
};
}

0 comments on commit 65fc15c

Please sign in to comment.