From cfb648daef74f695e42e3314c05296a72168860c Mon Sep 17 00:00:00 2001 From: Linnnus Date: Wed, 14 Feb 2024 17:56:30 +0100 Subject: build: Use stdenv from llvmPackages This patch updates the flake to use llvmPackages.stdenv rather than the default pkgs.stdenv. This fixes an issue on MacOS where the ASAN runtime library isn't found. I have no idea why. --- Makefile | 2 +- flake.nix | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 90d321d..7520811 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .POSIX: .PHONY: all install uninstall clean -CC := cc +CC ?= cc CFLAGS := -W -O $(shell pkg-config --cflags libgit2) CFLAGS += -g3 -O0 -fsanitize=address,undefined -fsanitize-trap CFLAGS += -Wall -Wextra -Wconversion -Wdouble-promotion \ diff --git a/flake.nix b/flake.nix index 24c60a1..1341dd9 100644 --- a/flake.nix +++ b/flake.nix @@ -10,8 +10,9 @@ flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; + stdenv = pkgs.llvmPackages_14.stdenv; - simple-wiki = pkgs.stdenv.mkDerivation { + simple-wiki = stdenv.mkDerivation { pname = "simple-wiki"; version = "0.0.0"; @@ -24,9 +25,15 @@ mkdir -p $out make PREFIX=$out install ''; + + meta = with pkgs.lib; { + description = "Simplest possible wiki system"; + license = licenses.unlicense; + mainProgram = "simplewiki"; + }; }; - creole-test = pkgs.stdenv.mkDerivation rec { + creole-test = stdenv.mkDerivation rec { pname = "creole-test"; version = simple-wiki.version; @@ -42,9 +49,8 @@ ''; }; - devShell = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ pkg-config ]; - buildInputs = with pkgs; [ libgit2 ]; + devShell = (pkgs.mkShell.override { inherit stdenv; }) { + inputsFrom = [ simple-wiki creole-test ]; }; in { -- cgit v1.2.3