summaryrefslogtreecommitdiff
path: root/media-libs/libsdl2
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-libs/libsdl2
reinit the tree, so we can have metadata
Diffstat (limited to 'media-libs/libsdl2')
-rw-r--r--media-libs/libsdl2/Manifest11
-rw-r--r--media-libs/libsdl2/files/libsdl2-2.0.4-static-libs.patch89
-rw-r--r--media-libs/libsdl2/files/libsdl2-2.0.5-ds3_ds4.patch48
-rw-r--r--media-libs/libsdl2/files/libsdl2-2.0.5-static-libs.patch89
-rw-r--r--media-libs/libsdl2/libsdl2-2.0.4.ebuild153
-rw-r--r--media-libs/libsdl2/libsdl2-2.0.5-r1.ebuild158
-rw-r--r--media-libs/libsdl2/libsdl2-2.0.5.ebuild157
-rw-r--r--media-libs/libsdl2/metadata.xml40
8 files changed, 745 insertions, 0 deletions
diff --git a/media-libs/libsdl2/Manifest b/media-libs/libsdl2/Manifest
new file mode 100644
index 000000000000..faf44ab47424
--- /dev/null
+++ b/media-libs/libsdl2/Manifest
@@ -0,0 +1,11 @@
+AUX libsdl2-2.0.4-static-libs.patch 4899 SHA256 e9ee478c8f2f70f0849038d448a29aaf9c13079e8a6ca663c6f186fc38ea0c44 SHA512 a71a6807251a8348f14a9dc1c5990d59cc63e067ee611a43b850950d8afde737830cf0bb0b0fd1fe6dc37e16490020fa21fbb9c70285333ee44ae2eb292f1a5a WHIRLPOOL 59b032da6ab86a75b23b8da2418de93a714a18499bd9a3cdbac10b8daf66499bdc1b746c78dcc463add42c334b5fe45eb9c725a497d0360c1f2d110e6f9acd98
+AUX libsdl2-2.0.5-ds3_ds4.patch 10482 SHA256 66a1702baaffa6e565edb72a1be670facbf865ffcc1d3ccd9a0a584354a0a43a SHA512 01e8f09f48b464a7f60d87ea47418b51f26f28b4463f2d55e9b2e9374f6824ac1981e98b599d244c0900409a93f93d4a4f363b51c0f8e1a84e4f04ffb883ca27 WHIRLPOOL 78fc07da0813298fddddadc40d9e83787c7881acefbcb53d7110fc4d6c82c411dc7e943a58a0a576823ed3f64686b5cb5168e08246b7b9702b5ce13d8e647627
+AUX libsdl2-2.0.5-static-libs.patch 4686 SHA256 6bf51c76aa0bd65d9036a415f5edcc17a2a04906538c4a7dce359818ebaf68c0 SHA512 98f02ace8419e25f5feb737fdb39dddf55b8db6188cd517bb720d9d02537ddcd4cc6a0c32efd7ec699a694dd719366866fd9eb5174775749802ee75dd2e944e6 WHIRLPOOL e0a884675211d3761ade50085bead66eec8d4b2205f3d4819da19b358c0f506c5b4bea401df649925709bda85f94a9fdca339d8c846da658f7904284ccb7f26e
+DIST SDL2-2.0.4.tar.gz 4136230 SHA256 da55e540bf6331824153805d58b590a29c39d2d506c6d02fa409aedeab21174b SHA512 dd0a95878639856c0f4b8a579ace8071379ab64519fa139b22d3ed857a0f0db87a75bc8480c7207e02fbffd1fdbd448e3c0b882c451675b0e2f1a945af02e1d6 WHIRLPOOL 2203061d32d51552e5bcfaa9752de5cb3173c0c733698894de177f9a0c1bad73706633e2d232f9b893e4c3736a93aff00ae94eb044b19a05a1cdd7a4c030b574
+DIST SDL2-2.0.5.tar.gz 4209352 SHA256 442038cf55965969f2ff06d976031813de643af9c9edc9e331bd761c242e8785 SHA512 6401f5df08c08316c09bc6ac5b28345c5184bb25770baa5c94c0a582ae130ddf73bb736e44bb31f4e427c1ddbbeec4755a6a5f530b6b4c3d0f13ebc78ddc1750 WHIRLPOOL 77aff6af67c29aab175f812be0aebbb65a757bd942de872b8330cb7cfabcd4abe0abd0c21b56bd409fb623b97c71981be5807e47dc03bf773aac85361582b796
+EBUILD libsdl2-2.0.4.ebuild 4755 SHA256 1b95e513c3f963ff37b9e4ffe788561a9a7c37dbe2e5b4a92cfd81808cbfa0f5 SHA512 a3ee75d9916d1000282f30a7e7a6587ca5b523d08d77a3a0efc220e64ee552df462f1fd9d8f1128dd6b67e799e3046101dc1c3dc0aa30f90a12f0e58f2413210 WHIRLPOOL 728d2749a7aabc6abd66cd513c823d05ff2b875953ba0f0a5b75ecb52ad8b20f6d2b7d2741f7ad06787fb70f31381757cf6787ae363fbf5f4d6bed65fc3e2923
+EBUILD libsdl2-2.0.5-r1.ebuild 4833 SHA256 bb1f34d9cb5aa7dd1e1f19db22e6aded0869d6af5bd929ece2f94791ed600d8d SHA512 9cbb0dc1fdb10c1d2f4c88615874c9c712dc864f8e65629bd0943aba3131dbd9f401a4a64e7b43a6ac393f8c69239e85ee0135ee886b47569dde4f20c4c098f5 WHIRLPOOL 8d44901b1aca11b1ed4aa70eb2bc9c617b429a362bf732e793dce6f0809fc6b11ab6ecfa11071c7aa1fb808018964bd1a7c23bc905de409c8a3d5957ad36794e
+EBUILD libsdl2-2.0.5.ebuild 4791 SHA256 c3c15eb2967f2a35f0fed5fbfe12cbeb4368be3d56752eb22eb72da0bd4e1a28 SHA512 a7ee500df710579bd4be766935984871a0311307b78f35d42cb7459c25d298fe66b00283d044e8ab7353722b30ab5f52327840e87cc08d9ff6fa23e4b4f84e66 WHIRLPOOL 829bb0a737d7fba58c8253455a54914e93e0eca6b7e1dab9f5288e674c45e78a1f5c585d97341fd815ee3205cfdef8d8d9d624f0367503cd6e6fa8532e3927d0
+MISC ChangeLog 5036 SHA256 d1346c5a7e7ba020de8f72d1f638c8fec4418d962cf9188b9518af6b93b0dc2d SHA512 d2a1dc0decdbd5b0b5754ee4fd14667e41d3e01927b8bbc1cd4bdb4b7499dfd326cdafbebfc80ba9daf8ba4a44a388ccc8d636b17dcfdb949122a7b0265d0871 WHIRLPOOL 03843cb5a80f4bc3f9908355f6c8414278bd69da91a5dc4ce4435c8c25c71412f06278e937d193e9735e762f8dad230e7e626ff71627f3de50fa12475ffa8561
+MISC ChangeLog-2015 5311 SHA256 e543afa31a118561233bf9060d1719933f81ca15415e4798bfb0c4bd8711119e SHA512 09400d6937e900025ffdf6b3d39ef2202b7a9a83df98fed2354e4fe85bcbb1d0f966e608088f1c372bba9559c0ece17405ee0d5115502e84f11642d7789d7c02 WHIRLPOOL c91ea0b26d40e85fd2bc8404d3f6b94cfd670d3e75915482111420012a18ce355cbffb18382cbd81aa5e337227f60399c522aa51dc9905cc591319900a27b96d
+MISC metadata.xml 1626 SHA256 437d69fbda00c8837a4fb18ecfb6ecb1615004434844241aa15c57e7a57a8947 SHA512 bca03557793cab7fe23ff7073add8bc112f4046326dae99cda4079b3adccd56b9179c871b04e97174c178d90b1b82b3f6ff5f42f53a705d4a22c9732e57787de WHIRLPOOL 6d2aea6011e9953b9b1c0e394d0ee54b52173c3c51e12971146d285077e6f199a322e1933387039adfa239456a412ff7274daa8e26260c9943565a029f1d22a1
diff --git a/media-libs/libsdl2/files/libsdl2-2.0.4-static-libs.patch b/media-libs/libsdl2/files/libsdl2-2.0.4-static-libs.patch
new file mode 100644
index 000000000000..bee2fd580aaa
--- /dev/null
+++ b/media-libs/libsdl2/files/libsdl2-2.0.4-static-libs.patch
@@ -0,0 +1,89 @@
+--- SDL2-2.0.4.orig/configure.in
++++ SDL2-2.0.4/configure.in
+@@ -3114,7 +3114,7 @@
+ if test -f /lib/w32api/libuuid.a; then
+ LIBUUID=/lib/w32api/libuuid.a
+ else
+- LIBUUID=-luuid
++ LIBUUID=-Wl,-luuid
+ fi
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -static-libgcc"
+ # The Windows platform requires special setup
+@@ -3464,23 +3464,23 @@
+
+ VERSION_OBJECTS=`echo $VERSION_SOURCES`
+ VERSION_DEPENDS=`echo $VERSION_SOURCES`
+-VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
++VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.lo,g'`
+ VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.rc\\\\
+- \\$(WINDRES) \\$< \\$@,g"`
++\\$(objects)/\\2.lo: \\1/\\2.rc\\\\
++ \\$(LIBTOOL) --mode=compile --tag=RC \\$(WINDRES) -i \\$< -o \\$@,g"`
+
+ SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
+ SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
+-SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
++SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+ SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.c\\\\
++\\$(objects)/\\2.lo: \\1/\\2.c\\\\
+ \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+
+ SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
+ SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
+-SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
++SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+ SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.c\\\\
++\\$(objects)/\\2.lo: \\1/\\2.c\\\\
+ \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+
+ # Set runtime shared library paths as needed
+--- SDL2-2.0.4.orig/Makefile.in
++++ SDL2-2.0.4/Makefile.in
+@@ -33,10 +33,10 @@
+ OBJECTS = @OBJECTS@
+ VERSION_OBJECTS = @VERSION_OBJECTS@
+
+-SDLMAIN_TARGET = libSDL2main.a
++SDLMAIN_TARGET = libSDL2main.la
+ SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
+
+-SDLTEST_TARGET = libSDL2_test.a
++SDLTEST_TARGET = libSDL2_test.la
+ SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
+
+ SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS
+@@ -138,15 +138,13 @@
+ .PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
+
+ $(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
+- $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
++ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
+
+ $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
+- $(RUN_CMD_AR)$(AR) cru $@ $(SDLMAIN_OBJECTS)
+- $(RUN_CMD_RANLIB)$(RANLIB) $@
++ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) -all-static
+
+ $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
+- $(RUN_CMD_AR)$(AR) cru $@ $(SDLTEST_OBJECTS)
+- $(RUN_CMD_RANLIB)$(RANLIB) $@
++ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) -all-static
+
+ install: all install-bin install-hdrs install-lib install-data
+ install-bin:
+@@ -167,10 +165,8 @@
+ install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
+ $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
+ $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
+- $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
+- $(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
+- $(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
+- $(RANLIB) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
++ $(LIBTOOL) --mode=install $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
++ $(LIBTOOL) --mode=install $(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
+ install-data:
+ $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
+ $(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
diff --git a/media-libs/libsdl2/files/libsdl2-2.0.5-ds3_ds4.patch b/media-libs/libsdl2/files/libsdl2-2.0.5-ds3_ds4.patch
new file mode 100644
index 000000000000..34455663a563
--- /dev/null
+++ b/media-libs/libsdl2/files/libsdl2-2.0.5-ds3_ds4.patch
@@ -0,0 +1,48 @@
+diff --git a/src/joystick/SDL_gamecontrollerdb.h b/src/joystick/SDL_gamecontrollerdb.h
+index 1e623cb..ae84c6d 100644
+--- a/src/joystick/SDL_gamecontrollerdb.h
++++ b/src/joystick/SDL_gamecontrollerdb.h
+@@ -47,6 +47,8 @@ static const char *s_ControllerMappings [] =
+ "4c056802000000000000504944564944,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
+ "25090500000000000000504944564944,PS3 DualShock,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,",
+ "4c05c405000000000000504944564944,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
++ "4c05cc09000000000000504944564944,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
++ "4c05a00b000000000000504944564944,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
+ #endif
+ #if defined(__MACOSX__)
+ "10280000000000000900000000000000,8Bitdo SFC30 GamePad Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,",
+@@ -62,6 +64,10 @@ static const char *s_ControllerMappings [] =
+ "11010000000000002014000000000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,",
+ "11010000000000001714000000000000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,",
+ "5e040000000000008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,",
++ "030000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
++ "030000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
++ "030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
++ "030000004c050000a00b000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
+ #endif
+ #if defined(__LINUX__)
+ "05000000102800000900000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,",
+@@ -85,12 +91,23 @@ static const char *s_ControllerMappings [] =
+ "03000000550900001072000011010000,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,",
+ "050000007e0500003003000001000000,Nintendo Wii Remote Pro Controller,a:b1,b:b0,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
+ "050000003620000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,",
++ "030000004c0500006802000010010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
++ "050000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:a12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:a13,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
+ "030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,",
++ "030000004c0500006802000010810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,",
++ "050000004c0500006802000000810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,",
++ "030000004c0500006802000011810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,",
+ "03000000341a00003608000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
+ "030000004c050000c405000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
+ "050000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
+ "030000004c050000cc09000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
+ "050000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
++ "030000004c050000a00b000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
++ "030000004c050000c405000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,",
++ "050000004c050000c405000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,",
++ "030000004c050000cc09000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,",
++ "050000004c050000cc09000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,",
++ "030000004c050000a00b000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,",
+ "03000000c6240000045d000025010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
+ "03000000321500000009000011010000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,",
+ "050000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,",
diff --git a/media-libs/libsdl2/files/libsdl2-2.0.5-static-libs.patch b/media-libs/libsdl2/files/libsdl2-2.0.5-static-libs.patch
new file mode 100644
index 000000000000..eed72dcccc35
--- /dev/null
+++ b/media-libs/libsdl2/files/libsdl2-2.0.5-static-libs.patch
@@ -0,0 +1,89 @@
+--- SDL2-2.0.5/configure.in
++++ SDL2-2.0.5/configure.in
+@@ -3197,7 +3197,7 @@
+ if test -f /lib/w32api/libuuid.a; then
+ LIBUUID=/lib/w32api/libuuid.a
+ else
+- LIBUUID=-luuid
++ LIBUUID=-Wl,-luuid
+ fi
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -static-libgcc"
+ # The Windows platform requires special setup
+@@ -3597,23 +3597,23 @@
+
+ VERSION_OBJECTS=`echo $VERSION_SOURCES`
+ VERSION_DEPENDS=`echo $VERSION_SOURCES`
+-VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
++VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.lo,g'`
+ VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.rc\\\\
+- \\$(WINDRES) \\$< \\$@,g"`
++\\$(objects)/\\2.lo: \\1/\\2.rc\\\\
++ \\$(LIBTOOL) --mode=compile --tag=RC \\$(WINDRES) -i \\$< -o \\$@,g"`
+
+ SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES`
+ SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES`
+-SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
++SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+ SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.c\\\\
++\\$(objects)/\\2.lo: \\1/\\2.c\\\\
+ \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+
+ SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES`
+ SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES`
+-SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
++SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+ SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\
+-\\$(objects)/\\2.o: \\1/\\2.c\\\\
++\\$(objects)/\\2.lo: \\1/\\2.c\\\\
+ \\$(RUN_CMD_CC)\\$(LIBTOOL) --tag=CC --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
+
+ # Set runtime shared library paths as needed
+--- SDL2-2.0.5/Makefile.in
++++ SDL2-2.0.5/Makefile.in
+@@ -36,10 +36,10 @@
+ GEN_OBJECTS = @GEN_OBJECTS@
+ VERSION_OBJECTS = @VERSION_OBJECTS@
+
+-SDLMAIN_TARGET = libSDL2main.a
++SDLMAIN_TARGET = libSDL2main.la
+ SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
+
+-SDLTEST_TARGET = libSDL2_test.a
++SDLTEST_TARGET = libSDL2_test.la
+ SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
+
+ WAYLAND_SCANNER = @WAYLAND_SCANNER@
+@@ -144,15 +144,13 @@
+ .PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
+
+ $(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS)
+- $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
++ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
+
+ $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
+- $(RUN_CMD_AR)$(AR) cru $@ $(SDLMAIN_OBJECTS)
+- $(RUN_CMD_RANLIB)$(RANLIB) $@
++ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) -all-static
+
+ $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
+- $(RUN_CMD_AR)$(AR) cru $@ $(SDLTEST_OBJECTS)
+- $(RUN_CMD_RANLIB)$(RANLIB) $@
++ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) -all-static
+
+ install: all install-bin install-hdrs install-lib install-data
+ install-bin:
+@@ -173,10 +171,8 @@
+ install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
+ $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
+ $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
+- $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
+- $(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
+- $(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
+- $(RANLIB) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
++ $(LIBTOOL) --mode=install $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
++ $(LIBTOOL) --mode=install $(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
+ install-data:
+ $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
+ $(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
diff --git a/media-libs/libsdl2/libsdl2-2.0.4.ebuild b/media-libs/libsdl2/libsdl2-2.0.4.ebuild
new file mode 100644
index 000000000000..59861016a7c3
--- /dev/null
+++ b/media-libs/libsdl2/libsdl2-2.0.4.ebuild
@@ -0,0 +1,153 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# TODO: convert FusionSound #484250
+
+EAPI=5
+inherit autotools flag-o-matic toolchain-funcs eutils multilib-minimal
+
+MY_P=SDL2-${PV}
+DESCRIPTION="Simple Direct Media Layer"
+HOMEPAGE="http://www.libsdl.org"
+SRC_URI="http://www.libsdl.org/release/${MY_P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 x86"
+
+IUSE="cpu_flags_x86_3dnow alsa altivec custom-cflags dbus fusionsound gles haptic +joystick cpu_flags_x86_mmx nas opengl oss pulseaudio +sound cpu_flags_x86_sse cpu_flags_x86_sse2 static-libs +threads tslib udev +video wayland X xinerama xscreensaver"
+REQUIRED_USE="
+ alsa? ( sound )
+ fusionsound? ( sound )
+ gles? ( video )
+ nas? ( sound )
+ opengl? ( video )
+ pulseaudio? ( sound )
+ wayland? ( gles )
+ xinerama? ( X )
+ xscreensaver? ( X )"
+
+RDEPEND="
+ alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
+ dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
+ fusionsound? ( || ( >=media-libs/FusionSound-1.1.1 >=dev-libs/DirectFB-1.7.1[fusionsound] ) )
+ gles? ( >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},gles2] )
+ nas? ( >=media-libs/nas-1.9.4[${MULTILIB_USEDEP}] )
+ opengl? (
+ >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
+ >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}]
+ )
+ pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
+ tslib? ( >=x11-libs/tslib-1.0-r3[${MULTILIB_USEDEP}] )
+ udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] )
+ wayland? (
+ >=dev-libs/wayland-1.0.6[${MULTILIB_USEDEP}]
+ >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},egl,gles2,wayland]
+ >=x11-libs/libxkbcommon-0.2.0[${MULTILIB_USEDEP}]
+ )
+ X? (
+ >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}]
+ >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXrandr-1.4.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}]
+ >=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}]
+ xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] )
+ xscreensaver? ( >=x11-libs/libXScrnSaver-1.2.2-r1[${MULTILIB_USEDEP}] )
+ )"
+DEPEND="${RDEPEND}
+ X? (
+ >=x11-proto/xextproto-7.2.1-r1[${MULTILIB_USEDEP}]
+ >=x11-proto/xproto-7.0.24[${MULTILIB_USEDEP}]
+ )
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ # https://bugzilla.libsdl.org/show_bug.cgi?id=1431
+ epatch "${FILESDIR}"/${P}-static-libs.patch
+ sed -i -e 's/configure.in/configure.ac/' Makefile.in || die
+ mv configure.{in,ac} || die
+ AT_M4DIR="/usr/share/aclocal acinclude" eautoreconf
+}
+
+multilib_src_configure() {
+ use custom-cflags || strip-flags
+
+ # sorted by `./configure --help`
+ ECONF_SOURCE="${S}" econf \
+ $(use_enable static-libs static) \
+ --enable-atomic \
+ $(use_enable sound audio) \
+ $(use_enable video) \
+ --enable-render \
+ --enable-events \
+ $(use_enable joystick) \
+ $(use_enable haptic) \
+ --enable-power \
+ --enable-filesystem \
+ $(use_enable threads) \
+ --enable-timers \
+ --enable-file \
+ --disable-loadso \
+ --enable-cpuinfo \
+ --enable-assembly \
+ $(use_enable cpu_flags_x86_sse ssemath) \
+ $(use_enable cpu_flags_x86_mmx mmx) \
+ $(use_enable cpu_flags_x86_3dnow 3dnow) \
+ $(use_enable cpu_flags_x86_sse sse) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable altivec) \
+ $(use_enable oss) \
+ $(use_enable alsa) \
+ --disable-alsa-shared \
+ --disable-esd \
+ $(use_enable pulseaudio) \
+ --disable-pulseaudio-shared \
+ --disable-arts \
+ $(use_enable nas) \
+ --disable-nas-shared \
+ --disable-sndio \
+ --disable-sndio-shared \
+ $(use_enable sound diskaudio) \
+ $(use_enable sound dummyaudio) \
+ $(use_enable wayland video-wayland) \
+ --disable-wayland-shared \
+ --disable-video-mir \
+ $(use_enable X video-x11) \
+ --disable-x11-shared \
+ $(use_enable X video-x11-xcursor) \
+ $(use_enable X video-x11-xdbe) \
+ $(use_enable xinerama video-x11-xinerama) \
+ $(use_enable X video-x11-xinput) \
+ $(use_enable X video-x11-xrandr) \
+ $(use_enable xscreensaver video-x11-scrnsaver) \
+ $(use_enable X video-x11-xshape) \
+ $(use_enable X video-x11-vm) \
+ --disable-video-cocoa \
+ --disable-video-directfb \
+ $(multilib_native_use_enable fusionsound) \
+ --disable-fusionsound-shared \
+ $(use_enable video video-dummy) \
+ $(use_enable opengl video-opengl) \
+ $(use_enable gles video-opengles) \
+ $(use_enable udev libudev) \
+ $(use_enable dbus) \
+ --disable-ibus \
+ $(use_enable tslib input-tslib) \
+ --disable-directx \
+ --disable-rpath \
+ --disable-render-d3d \
+ $(use_with X x)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+ dodoc {BUGS,CREDITS,README,README-SDL,TODO,WhatsNew}.txt docs/README*.md
+}
diff --git a/media-libs/libsdl2/libsdl2-2.0.5-r1.ebuild b/media-libs/libsdl2/libsdl2-2.0.5-r1.ebuild
new file mode 100644
index 000000000000..f5f05fb0c9bc
--- /dev/null
+++ b/media-libs/libsdl2/libsdl2-2.0.5-r1.ebuild
@@ -0,0 +1,158 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# TODO: convert FusionSound #484250
+
+EAPI=6
+inherit autotools flag-o-matic toolchain-funcs eutils multilib-minimal
+
+MY_P=SDL2-${PV}
+DESCRIPTION="Simple Direct Media Layer"
+HOMEPAGE="http://www.libsdl.org"
+SRC_URI="http://www.libsdl.org/release/${MY_P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~x86"
+
+IUSE="cpu_flags_x86_3dnow alsa altivec custom-cflags dbus fusionsound gles haptic +joystick cpu_flags_x86_mmx nas opengl oss pulseaudio +sound cpu_flags_x86_sse cpu_flags_x86_sse2 static-libs +threads tslib udev +video wayland X xinerama xscreensaver"
+REQUIRED_USE="
+ alsa? ( sound )
+ fusionsound? ( sound )
+ gles? ( video )
+ nas? ( sound )
+ opengl? ( video )
+ pulseaudio? ( sound )
+ wayland? ( gles )
+ xinerama? ( X )
+ xscreensaver? ( X )"
+
+RDEPEND="
+ alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
+ dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
+ fusionsound? ( || ( >=media-libs/FusionSound-1.1.1 >=dev-libs/DirectFB-1.7.1[fusionsound] ) )
+ gles? ( >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},gles2] )
+ nas? ( >=media-libs/nas-1.9.4[${MULTILIB_USEDEP}] )
+ opengl? (
+ >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
+ >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}]
+ )
+ pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
+ tslib? ( >=x11-libs/tslib-1.0-r3[${MULTILIB_USEDEP}] )
+ udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] )
+ wayland? (
+ >=dev-libs/wayland-1.0.6[${MULTILIB_USEDEP}]
+ >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},egl,gles2,wayland]
+ >=x11-libs/libxkbcommon-0.2.0[${MULTILIB_USEDEP}]
+ )
+ X? (
+ >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}]
+ >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXrandr-1.4.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}]
+ >=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}]
+ xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] )
+ xscreensaver? ( >=x11-libs/libXScrnSaver-1.2.2-r1[${MULTILIB_USEDEP}] )
+ )"
+DEPEND="${RDEPEND}
+ X? (
+ >=x11-proto/xextproto-7.2.1-r1[${MULTILIB_USEDEP}]
+ >=x11-proto/xproto-7.0.24[${MULTILIB_USEDEP}]
+ )
+ virtual/pkgconfig"
+
+PATCHES=(
+ # https://bugzilla.libsdl.org/show_bug.cgi?id=1431
+ "${FILESDIR}"/${PN}-2.0.5-static-libs.patch
+ "${FILESDIR}"/${PN}-2.0.5-ds3_ds4.patch
+)
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ default
+ sed -i -e 's/configure.in/configure.ac/' Makefile.in || die
+ mv configure.{in,ac} || die
+ AT_M4DIR="/usr/share/aclocal acinclude" eautoreconf
+}
+
+multilib_src_configure() {
+ use custom-cflags || strip-flags
+
+ # sorted by `./configure --help`
+ ECONF_SOURCE="${S}" econf \
+ $(use_enable static-libs static) \
+ --enable-atomic \
+ $(use_enable sound audio) \
+ $(use_enable video) \
+ --enable-render \
+ --enable-events \
+ $(use_enable joystick) \
+ $(use_enable haptic) \
+ --enable-power \
+ --enable-filesystem \
+ $(use_enable threads) \
+ --enable-timers \
+ --enable-file \
+ --disable-loadso \
+ --enable-cpuinfo \
+ --enable-assembly \
+ $(use_enable cpu_flags_x86_sse ssemath) \
+ $(use_enable cpu_flags_x86_mmx mmx) \
+ $(use_enable cpu_flags_x86_3dnow 3dnow) \
+ $(use_enable cpu_flags_x86_sse sse) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable altivec) \
+ $(use_enable oss) \
+ $(use_enable alsa) \
+ --disable-alsa-shared \
+ --disable-esd \
+ $(use_enable pulseaudio) \
+ --disable-pulseaudio-shared \
+ --disable-arts \
+ $(use_enable nas) \
+ --disable-nas-shared \
+ --disable-sndio \
+ --disable-sndio-shared \
+ $(use_enable sound diskaudio) \
+ $(use_enable sound dummyaudio) \
+ $(use_enable wayland video-wayland) \
+ --disable-wayland-shared \
+ --disable-video-mir \
+ $(use_enable X video-x11) \
+ --disable-x11-shared \
+ $(use_enable X video-x11-xcursor) \
+ $(use_enable X video-x11-xdbe) \
+ $(use_enable xinerama video-x11-xinerama) \
+ $(use_enable X video-x11-xinput) \
+ $(use_enable X video-x11-xrandr) \
+ $(use_enable xscreensaver video-x11-scrnsaver) \
+ $(use_enable X video-x11-xshape) \
+ $(use_enable X video-x11-vm) \
+ --disable-video-cocoa \
+ --disable-video-directfb \
+ $(multilib_native_use_enable fusionsound) \
+ --disable-fusionsound-shared \
+ $(use_enable video video-dummy) \
+ $(use_enable opengl video-opengl) \
+ $(use_enable gles video-opengles) \
+ $(use_enable udev libudev) \
+ $(use_enable dbus) \
+ --disable-ibus \
+ $(use_enable tslib input-tslib) \
+ --disable-directx \
+ --disable-rpath \
+ --disable-render-d3d \
+ $(use_with X x)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+ dodoc {BUGS,CREDITS,README,README-SDL,TODO,WhatsNew}.txt docs/README*.md
+}
diff --git a/media-libs/libsdl2/libsdl2-2.0.5.ebuild b/media-libs/libsdl2/libsdl2-2.0.5.ebuild
new file mode 100644
index 000000000000..ab6d53900bfc
--- /dev/null
+++ b/media-libs/libsdl2/libsdl2-2.0.5.ebuild
@@ -0,0 +1,157 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# TODO: convert FusionSound #484250
+
+EAPI=6
+inherit autotools flag-o-matic toolchain-funcs eutils multilib-minimal
+
+MY_P=SDL2-${PV}
+DESCRIPTION="Simple Direct Media Layer"
+HOMEPAGE="http://www.libsdl.org"
+SRC_URI="http://www.libsdl.org/release/${MY_P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ia64 ~ppc ~ppc64 ~x86"
+
+IUSE="cpu_flags_x86_3dnow alsa altivec custom-cflags dbus fusionsound gles haptic +joystick cpu_flags_x86_mmx nas opengl oss pulseaudio +sound cpu_flags_x86_sse cpu_flags_x86_sse2 static-libs +threads tslib udev +video wayland X xinerama xscreensaver"
+REQUIRED_USE="
+ alsa? ( sound )
+ fusionsound? ( sound )
+ gles? ( video )
+ nas? ( sound )
+ opengl? ( video )
+ pulseaudio? ( sound )
+ wayland? ( gles )
+ xinerama? ( X )
+ xscreensaver? ( X )"
+
+RDEPEND="
+ alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
+ dbus? ( >=sys-apps/dbus-1.6.18-r1[${MULTILIB_USEDEP}] )
+ fusionsound? ( || ( >=media-libs/FusionSound-1.1.1 >=dev-libs/DirectFB-1.7.1[fusionsound] ) )
+ gles? ( >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},gles2] )
+ nas? ( >=media-libs/nas-1.9.4[${MULTILIB_USEDEP}] )
+ opengl? (
+ >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
+ >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}]
+ )
+ pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
+ tslib? ( >=x11-libs/tslib-1.0-r3[${MULTILIB_USEDEP}] )
+ udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP}] )
+ wayland? (
+ >=dev-libs/wayland-1.0.6[${MULTILIB_USEDEP}]
+ >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP},egl,gles2,wayland]
+ >=x11-libs/libxkbcommon-0.2.0[${MULTILIB_USEDEP}]
+ )
+ X? (
+ >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXcursor-1.1.14[${MULTILIB_USEDEP}]
+ >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXrandr-1.4.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}]
+ >=x11-libs/libXxf86vm-1.1.3[${MULTILIB_USEDEP}]
+ xinerama? ( >=x11-libs/libXinerama-1.1.3[${MULTILIB_USEDEP}] )
+ xscreensaver? ( >=x11-libs/libXScrnSaver-1.2.2-r1[${MULTILIB_USEDEP}] )
+ )"
+DEPEND="${RDEPEND}
+ X? (
+ >=x11-proto/xextproto-7.2.1-r1[${MULTILIB_USEDEP}]
+ >=x11-proto/xproto-7.0.24[${MULTILIB_USEDEP}]
+ )
+ virtual/pkgconfig"
+
+PATCHES=(
+ # https://bugzilla.libsdl.org/show_bug.cgi?id=1431
+ "${FILESDIR}"/${PN}-2.0.5-static-libs.patch
+)
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ default
+ sed -i -e 's/configure.in/configure.ac/' Makefile.in || die
+ mv configure.{in,ac} || die
+ AT_M4DIR="/usr/share/aclocal acinclude" eautoreconf
+}
+
+multilib_src_configure() {
+ use custom-cflags || strip-flags
+
+ # sorted by `./configure --help`
+ ECONF_SOURCE="${S}" econf \
+ $(use_enable static-libs static) \
+ --enable-atomic \
+ $(use_enable sound audio) \
+ $(use_enable video) \
+ --enable-render \
+ --enable-events \
+ $(use_enable joystick) \
+ $(use_enable haptic) \
+ --enable-power \
+ --enable-filesystem \
+ $(use_enable threads) \
+ --enable-timers \
+ --enable-file \
+ --disable-loadso \
+ --enable-cpuinfo \
+ --enable-assembly \
+ $(use_enable cpu_flags_x86_sse ssemath) \
+ $(use_enable cpu_flags_x86_mmx mmx) \
+ $(use_enable cpu_flags_x86_3dnow 3dnow) \
+ $(use_enable cpu_flags_x86_sse sse) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable altivec) \
+ $(use_enable oss) \
+ $(use_enable alsa) \
+ --disable-alsa-shared \
+ --disable-esd \
+ $(use_enable pulseaudio) \
+ --disable-pulseaudio-shared \
+ --disable-arts \
+ $(use_enable nas) \
+ --disable-nas-shared \
+ --disable-sndio \
+ --disable-sndio-shared \
+ $(use_enable sound diskaudio) \
+ $(use_enable sound dummyaudio) \
+ $(use_enable wayland video-wayland) \
+ --disable-wayland-shared \
+ --disable-video-mir \
+ $(use_enable X video-x11) \
+ --disable-x11-shared \
+ $(use_enable X video-x11-xcursor) \
+ $(use_enable X video-x11-xdbe) \
+ $(use_enable xinerama video-x11-xinerama) \
+ $(use_enable X video-x11-xinput) \
+ $(use_enable X video-x11-xrandr) \
+ $(use_enable xscreensaver video-x11-scrnsaver) \
+ $(use_enable X video-x11-xshape) \
+ $(use_enable X video-x11-vm) \
+ --disable-video-cocoa \
+ --disable-video-directfb \
+ $(multilib_native_use_enable fusionsound) \
+ --disable-fusionsound-shared \
+ $(use_enable video video-dummy) \
+ $(use_enable opengl video-opengl) \
+ $(use_enable gles video-opengles) \
+ $(use_enable udev libudev) \
+ $(use_enable dbus) \
+ --disable-ibus \
+ $(use_enable tslib input-tslib) \
+ --disable-directx \
+ --disable-rpath \
+ --disable-render-d3d \
+ $(use_with X x)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+ dodoc {BUGS,CREDITS,README,README-SDL,TODO,WhatsNew}.txt docs/README*.md
+}
diff --git a/media-libs/libsdl2/metadata.xml b/media-libs/libsdl2/metadata.xml
new file mode 100644
index 000000000000..04b7e237bb79
--- /dev/null
+++ b/media-libs/libsdl2/metadata.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <longdescription>
+ Simple DirectMedia Layer is a cross-platform multimedia library
+ designed to provide low level access to audio, keyboard, mouse,
+ joystick, 3D hardware via OpenGL, and 2D video framebuffer. It is
+ used by MPEG playback software, emulators, and many popular games,
+ including the award winning Linux port of "Civilization: Call To
+ Power."
+
+ Simple DirectMedia Layer supports Linux, Windows, BeOS, MacOS
+ Classic, MacOS X, FreeBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.
+ There is also code, but no official support, for Windows CE,
+ AmigaOS, Dreamcast, Atari, NetBSD, AIX, OSF/Tru64, RISC OS, and
+ SymbianOS.
+
+ SDL is written in C, but works with C++ natively, and has bindings
+ to several other languages, including Ada, Eiffel, Java, Lua, ML,
+ Perl, PHP, Pike, Python, and Ruby.
+ </longdescription>
+ <use>
+ <flag name="fusionsound">use FusionSound audio driver</flag>
+ <flag name="gles">include OpenGL ES support</flag>
+ <flag name="haptic">Enable the haptic (force feedback) subsystem
+ </flag>
+ <flag name="joystick">Control joystick support
+ (disable at your own risk)</flag>
+ <flag name="sound">Control audio support (disable at your own risk)
+ </flag>
+ <flag name="tslib">Build with tslib support for touchscreen devices
+ </flag>
+ <flag name="video">Control video support (disable at your own risk)
+ </flag>
+ </use>
+</pkgmetadata>