8 enableShared ? !stdenv.hostPlatform.isStatic,
12 stdenv.mkDerivation (finalAttrs: {
16 src = fetchFromGitHub {
17 owner = "codam-coding-college";
19 rev = "refs/tags/v${finalAttrs.version}";
20 hash = "sha256-c4LoTePHhQeZTx33V1K3ZyXmT7vjB6NdkGVAiSuJKfI=";
25 patchShebangs --build ./tools
27 + lib.optionalString enableShared ''
28 substituteInPlace CMakeLists.txt \
29 --replace-fail "mlx42 STATIC" "mlx42 SHARED"
34 nativeBuildInputs = [ cmake ];
38 ++ lib.optionals stdenv.hostPlatform.isDarwin (
39 with darwin.apple_sdk.frameworks;
47 cmakeFlags = [ (lib.cmakeBool "DEBUG" enableDebug) ];
50 mkdir -p $out/lib/pkgconfig
51 substituteAll ${./mlx42.pc} $out/lib/pkgconfig/mlx42.pc
55 changelog = "https://github.com/codam-coding-college/MLX42/releases/tag/v${finalAttrs.version}";
56 description = "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;