nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 glfw,
7 enableShared ? !stdenv.hostPlatform.isStatic,
8 enableDebug ? false,
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "mlx42";
13 version = "2.4.2";
14
15 src = fetchFromGitHub {
16 owner = "codam-coding-college";
17 repo = "MLX42";
18 tag = "v${finalAttrs.version}";
19 hash = "sha256-IMwDdWtbu882N43oTr/c6Fq34TduCuUt34Vh2Hx/TJY=";
20 };
21
22 postPatch = ''
23 patchShebangs --build ./tools
24 '';
25
26 strictDeps = true;
27
28 nativeBuildInputs = [ cmake ];
29
30 buildInputs = [ glfw ];
31
32 cmakeFlags = [
33 (lib.cmakeBool "BUILD_SHARED_LIBS" enableShared)
34 (lib.cmakeBool "DEBUG" enableDebug)
35 ];
36
37 postInstall = ''
38 mkdir -p $out/lib/pkgconfig
39 substituteAll ${./mlx42.pc} $out/lib/pkgconfig/mlx42.pc
40 '';
41
42 meta = {
43 changelog = "https://github.com/codam-coding-college/MLX42/releases/tag/v${finalAttrs.version}";
44 description = "Simple cross-platform graphics library that uses GLFW and OpenGL";
45 homepage = "https://github.com/codam-coding-college/MLX42";
46 license = lib.licenses.gpl2Only;
47 maintainers = with lib.maintainers; [ tomasajt ];
48 platforms = lib.platforms.unix;
49 };
50})