From 71f0d5b92383b24e84988a4ac6c937936ad8340b Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sat, 10 Feb 2024 10:57:33 +0000 Subject: [PATCH] build: add libepoxy Add libepoxy dependency to CI manifest and Nix. For Nix, we need to set shellHook to workaround a NixOS limitation, see: https://github.com/NixOS/nixpkgs/issues/287763 (cherry picked from commit fcd51e7373d14881e13ad086304d3511355b5f1b) Signed-off-by: Yuxuan Shui --- .builds/freebsd.yml | 1 + .editorconfig | 3 +++ flake.nix | 20 +++++++++++++++----- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml index 41c3d927..546df097 100644 --- a/.builds/freebsd.yml +++ b/.builds/freebsd.yml @@ -12,6 +12,7 @@ packages: - uthash - libconfig - libglvnd + - libepoxy - dbus - pcre sources: diff --git a/.editorconfig b/.editorconfig index b40d8e8b..fea97be8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,3 +3,6 @@ root = true indent_style = tab indent_size = 8 max_line_length = 90 +[*.nix] +indent_style = space +indent_size = 2 diff --git a/flake.nix b/flake.nix index 8baaa3b6..414cacc9 100644 --- a/flake.nix +++ b/flake.nix @@ -24,12 +24,22 @@ overlays = [ overlay ]; in rec { inherit overlay overlays; - defaultPackage = pkgs.picom; + defaultPackage = pkgs.picom.overrideAttrs (o: { + version = "11"; + src = ./.; + buildInputs = o.buildInputs ++ [ pkgs.libepoxy ]; + }); devShell = defaultPackage.overrideAttrs { - buildInputs = defaultPackage.buildInputs ++ [ - pkgs.clang-tools - pkgs.llvmPackages_14.clang-unwrapped.python - ]; + buildInputs = defaultPackage.buildInputs ++ (with pkgs; [ + clang-tools_17 + llvmPackages_17.clang-unwrapped.python + ]); + hardeningDisable = [ "fortify" ]; + shellHook = '' + # Workaround a NixOS limitation on sanitizers: + # See: https://github.com/NixOS/nixpkgs/issues/287763 + export LD_LIBRARY_PATH+=":/run/opengl-driver/lib" + ''; }; }); }