tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
mlx42: init at 2.3.2
TomaSajt
2 years ago
f4b36600
371426a4
+72
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
ml
mlx42
mlx42.pc
package.nix
+10
pkgs/by-name/ml/mlx42/mlx42.pc
···
1
1
+
prefix=@out@
2
2
+
exec_prefix=${prefix}
3
3
+
libdir=${prefix}/lib
4
4
+
includedir=${prefix}/include
5
5
+
6
6
+
Name: mlx42
7
7
+
Description: A simple cross-platform graphics library that uses GLFW and OpenGL
8
8
+
Version: @version@
9
9
+
Libs: -L${libdir} -lmlx42
10
10
+
Cflags: -I${includedir}
+62
pkgs/by-name/ml/mlx42/package.nix
···
1
1
+
{ lib
2
2
+
, stdenv
3
3
+
, fetchFromGitHub
4
4
+
, fetchpatch
5
5
+
, cmake
6
6
+
, glfw
7
7
+
, darwin
8
8
+
, enableShared ? !stdenv.hostPlatform.isStatic
9
9
+
, enableDebug ? false
10
10
+
}:
11
11
+
12
12
+
stdenv.mkDerivation (finalAttrs: {
13
13
+
pname = "mlx42";
14
14
+
version = "2.3.2";
15
15
+
16
16
+
src = fetchFromGitHub {
17
17
+
owner = "codam-coding-college";
18
18
+
repo = "MLX42";
19
19
+
rev = "refs/tags/v${finalAttrs.version}";
20
20
+
hash = "sha256-JCBV8NWibSugqXkbgP0v3gDfaaMNFYztWpBRfHJUG8E=";
21
21
+
};
22
22
+
23
23
+
patches = [
24
24
+
(fetchpatch {
25
25
+
name = "add-cmake-install.patch";
26
26
+
url = "https://github.com/codam-coding-college/MLX42/commit/a51ca8e0ec3fb793fa96d710696dcee8a4fe57d6.patch";
27
27
+
hash = "sha256-i+0yHZVvfTG19BGVrz7GuEuBw3B7lylCPEvx07il23M=";
28
28
+
})
29
29
+
];
30
30
+
31
31
+
postPatch = ''
32
32
+
patchShebangs ./tools
33
33
+
''
34
34
+
+ lib.optionalString enableShared ''
35
35
+
substituteInPlace CMakeLists.txt \
36
36
+
--replace "mlx42 STATIC" "mlx42 SHARED"
37
37
+
'';
38
38
+
39
39
+
nativeBuildInputs = [ cmake ];
40
40
+
41
41
+
buildInputs = [ glfw ]
42
42
+
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ OpenGL Cocoa IOKit ]);
43
43
+
44
44
+
cmakeFlags = [ "-DDEBUG=${toString enableDebug}" ];
45
45
+
46
46
+
postInstall = ''
47
47
+
mkdir -p $out/lib/pkgconfig
48
48
+
substituteAll ${./mlx42.pc} $out/lib/pkgconfig/mlx42.pc
49
49
+
50
50
+
# This file was removed after 2.3.2, so the used patch doesn't copy this file
51
51
+
# This line can be removed after the next release
52
52
+
cp $src/include/MLX42/MLX42_Input.h $out/include/MLX42
53
53
+
'';
54
54
+
55
55
+
meta = {
56
56
+
description = "A simple cross-platform graphics library that uses GLFW and OpenGL";
57
57
+
homepage = "https://github.com/codam-coding-college/MLX42";
58
58
+
license = lib.licenses.gpl2Only;
59
59
+
maintainers = with lib.maintainers; [ tomasajt ];
60
60
+
platforms = lib.platforms.unix;
61
61
+
};
62
62
+
})