From 8f633d6fb42359c7111cff25abdb6de36dee0a2d Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Mon, 8 Nov 2021 15:28:18 +0800 Subject: [PATCH] epoxy: 1.5.4 -> 1.5.9 autotools -> meson as upstream no longer supports the former. --- .../libraries/libepoxy/default.nix | 53 +++++++++++++------ 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/pkgs/development/libraries/libepoxy/default.nix b/pkgs/development/libraries/libepoxy/default.nix index 83b8ba8960d5..bd9520da1c4f 100644 --- a/pkgs/development/libraries/libepoxy/default.nix +++ b/pkgs/development/libraries/libepoxy/default.nix @@ -1,37 +1,56 @@ -{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, utilmacros, python3 -, libGL, libX11 +{ lib +, stdenv +, fetchFromGitHub +, meson +, ninja +, pkg-config +, utilmacros +, python3 +, libGL +, libX11 }: -with lib; +let + inherit (lib) getLib optional optionalString; +in stdenv.mkDerivation rec { pname = "libepoxy"; - version = "1.5.4"; + version = "1.5.9"; src = fetchFromGitHub { owner = "anholt"; repo = pname; rev = version; - sha256 = "0rmg0qlswn250h0arx434jh3hwzsr95lawanpmh1czsfvrcx59l6"; + sha256 = "sha256-8rdmC8FZUkKkEvWPJIdfrBQHiwa81vl5tmVqRdU4UIY="; }; - outputs = [ "out" "dev" ]; - - nativeBuildInputs = [ autoreconfHook pkg-config utilmacros python3 ]; - buildInputs = [ libGL libX11 ]; - - preConfigure = optionalString stdenv.isDarwin '' - substituteInPlace configure --replace build_glx=no build_glx=yes - substituteInPlace src/dispatch_common.h --replace "PLATFORM_HAS_GLX 0" "PLATFORM_HAS_GLX 1" - ''; - patches = [ ./libgl-path.patch ]; + postPatch = '' + patchShebangs src/*.py + '' + + optionalString stdenv.isDarwin '' + substituteInPlace src/dispatch_common.h --replace "PLATFORM_HAS_GLX 0" "PLATFORM_HAS_GLX 1" + ''; + + outputs = [ "out" "dev" ]; + + nativeBuildInputs = [ meson ninja pkg-config utilmacros python3 ]; + + buildInputs = [ libGL libX11 ]; + + mesonFlags = [ + "-Dtests=${if doCheck then "true" else "false"}" + ] + ++ optional stdenv.isDarwin "-Dglx=yes"; + NIX_CFLAGS_COMPILE = ''-DLIBGL_PATH="${getLib libGL}/lib"''; - doCheck = false; # needs X11 + # tests are running from version 1.5.9 + doCheck = true; - meta = { + meta = with lib; { description = "A library for handling OpenGL function pointer management"; homepage = "https://github.com/anholt/libepoxy"; license = licenses.mit;