mlx42: init at 2.3.2

TomaSajt f4b36600 371426a4

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