# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack import *


class Sdl2(CMakePackage):
    """Simple DirectMedia Layer is a cross-platform development library designed
    to provide low level access to audio, keyboard, mouse, joystick, and
    graphics hardware via OpenGL and Direct3D."""

    homepage = "https://wiki.libsdl.org/FrontPage"
    url      = "https://libsdl.org/release/SDL2-2.0.5.tar.gz"

    version('2.0.5', 'd4055424d556b4a908aa76fad63abd3c')

    depends_on('cmake@2.8.5:', type='build')

@@ -310,16 +310,20 @@
  library
+%0A   
  designe
@@ -323,20 +323,16 @@
 designed
-%0A   
  to prov
@@ -392,16 +392,16 @@
 ick,
- and
 %0A   
+ and
  gra
@@ -616,16 +616,16 @@
 bd3c')%0A%0A
-
     depe
@@ -661,8 +661,224 @@
 build')%0A
+    depends_on('libxext', type='link')%0A%0A    def cmake_args(self):%0A        return %5B%0A            '-DSSEMATH=%7B0%7D'.format(%0A                'OFF' if self.spec.satisfies('target=aarch64') else 'ON'%0A            )%0A        %5D%0A

fix dependency for libxext and build on ARM (#12351)