mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-23 04:58:44 +08:00
local.pkgs.matplotplusplus: enable opengl
This commit is contained in:
parent
f6a5022aca
commit
22ef0c27f5
13
local/pkgs/matplotplusplus/add-glad.patch
Normal file
13
local/pkgs/matplotplusplus/add-glad.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/source/matplot/CMakeLists.txt b/source/matplot/CMakeLists.txt
|
||||
index fe9ad53..4007fae 100644
|
||||
--- a/source/matplot/CMakeLists.txt
|
||||
+++ b/source/matplot/CMakeLists.txt
|
||||
@@ -221,7 +221,7 @@ if (MATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND)
|
||||
if (NOT GLAD_FOUND AND NOT TARGET glad)
|
||||
# Use CPM only if not found, to avoid ODR violations
|
||||
# find_package(GLAD REQUIRE) would suffice if it worked well
|
||||
- FetchContent_Declare(glad GIT_REPOSITORY https://github.com/Dav1dde/glad.git GIT_TAG v0.1.36)
|
||||
+ FetchContent_Declare(glad SOURCE_DIR @glad@)
|
||||
FetchContent_MakeAvailable(glad)
|
||||
else ()
|
||||
# FindGLAD does not usually create a target, so we create an interface target
|
@ -1,7 +1,17 @@
|
||||
{
|
||||
stdenv, fetchFromGitHub, cmake, pkg-config,
|
||||
gnuplot, libjpeg, libtiff, zlib, libpng, lapack, blas, fftw, opencv, nodesoup, cimg
|
||||
}: stdenv.mkDerivation rec
|
||||
stdenv, fetchFromGitHub, cmake, pkg-config, substituteAll,
|
||||
gnuplot, libjpeg, libtiff, zlib, libpng, lapack, blas, fftw, opencv, nodesoup, cimg, glfw, libGL, python3
|
||||
}:
|
||||
let
|
||||
glad = fetchFromGitHub
|
||||
{
|
||||
owner = "Dav1dde";
|
||||
repo = "glad";
|
||||
rev = "v0.1.36";
|
||||
sha256 = "FtkPz0xchwmqE+QgS+nSJVYaAfJSTUmZsObV/IPypVQ=";
|
||||
};
|
||||
python = python3.withPackages (pythonPackages: with pythonPackages; [ glad ]);
|
||||
in stdenv.mkDerivation rec
|
||||
{
|
||||
pname = "matplotplusplus";
|
||||
version = "1.2.0";
|
||||
@ -9,14 +19,16 @@
|
||||
{
|
||||
owner = "alandefreitas";
|
||||
repo = "matplotplusplus";
|
||||
rev = "v${version}";
|
||||
sha256 = "mYXAB1AbCtcd2rEuluJN6hDKE9+AowodjJt2pdyntes=";
|
||||
rev = "a40344efa9dc5ea0c312e6e9ef4eb7238d98dc12";
|
||||
sha256 = "6/dH/Rl2aAb8b+Ji5LwzkC+GWPOCBnYCrjy0qk8u/+I=";
|
||||
};
|
||||
cmakeFlags =
|
||||
[
|
||||
"-DBUILD_SHARED_LIBS=ON" "-DMATPLOTPP_BUILD_SHARED_LIBS=ON" "-DMATPLOTPP_BUILD_EXAMPLES=OFF"
|
||||
"-DMATPLOTPP_WITH_SYSTEM_NODESOUP=ON" "-DMATPLOTPP_WITH_SYSTEM_CIMG=ON"
|
||||
"-DMATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND=ON" "-DGLAD_REPRODUCIBLE=ON"
|
||||
];
|
||||
buildInputs = [ gnuplot libjpeg libtiff zlib libpng lapack blas fftw opencv nodesoup cimg ];
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
patches = [(substituteAll { src = ./add-glad.patch; inherit glad; })];
|
||||
buildInputs = [ gnuplot libjpeg libtiff zlib libpng lapack blas fftw opencv nodesoup cimg glfw libGL python ];
|
||||
nativeBuildInputs = [ cmake pkg-config python ];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user