--- /dev/null
+From 56bf091a0e8c5242e160d37f2974f3e1e2525821 Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Sun, 7 May 2017 10:49:21 +0200
+Subject: [PATCH] Use GNUInstallDirs in order to change installation paths
+
+* This allows distro-specific modification of directories
+ to adjust to different FHS layouts.
+---
+ CMakeLists.txt | 5 ++++-
+ docs/CMakeLists.txt | 2 +-
+ resources/music/CMakeLists.txt | 2 +-
+ src/tracker/CMakeLists.txt | 2 +-
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 996e2f0..bac54f3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -19,9 +19,12 @@
+ # along with MilkyTracker. If not, see <http://www.gnu.org/licenses/>.
+ #
+
+-cmake_minimum_required(VERSION 2.6)
++cmake_minimum_required(VERSION 2.8.5)
+ project(MilkyTracker)
+
++# Adhere to GNU filesystem layout conventions
++include(GNUInstallDirs)
++
+ # Force SDL if requested
+ option(FORCESDL "Force SDL instead of native" OFF)
+ if(FORCESDL)
+diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
+index 0aacc60..aca4a61 100644
+--- a/docs/CMakeLists.txt
++++ b/docs/CMakeLists.txt
+@@ -35,7 +35,7 @@ elseif(WIN32)
+ set(INSTALL_DEST .)
+ else()
+ list(APPEND DOCUMENTS readme_unix)
+- set(INSTALL_DEST share/doc/${PROJECT_NAME_LOWER})
++ set(INSTALL_DEST ${CMAKE_INSTALL_DOCDIR})
+ endif()
+
+ install(FILES ${DOCUMENTS} DESTINATION ${INSTALL_DEST})
+diff --git a/resources/music/CMakeLists.txt b/resources/music/CMakeLists.txt
+index f918b6e..f29fcd6 100644
+--- a/resources/music/CMakeLists.txt
++++ b/resources/music/CMakeLists.txt
+@@ -24,7 +24,7 @@ file(GLOB SONGS "*.xm")
+ if(APPLE OR WIN32)
+ set(INSTALL_DEST "Example Songs")
+ else()
+- set(INSTALL_DEST share/${PROJECT_NAME_LOWER}/songs)
++ set(INSTALL_DEST ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME_LOWER}/songs)
+ endif()
+
+ install(FILES ${SONGS} DESTINATION ${INSTALL_DEST})
+diff --git a/src/tracker/CMakeLists.txt b/src/tracker/CMakeLists.txt
+index 1e4062e..b7a96a7 100644
+--- a/src/tracker/CMakeLists.txt
++++ b/src/tracker/CMakeLists.txt
+@@ -399,7 +399,7 @@ target_link_libraries(
+ if(APPLE OR WIN32)
+ set(INSTALL_DEST .)
+ else()
+- set(INSTALL_DEST bin)
++ set(INSTALL_DEST ${CMAKE_INSTALL_BINDIR})
+ endif()
+
+ install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_DEST})
--- /dev/null
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils eutils vcs-snapshot
+
+DESCRIPTION="FastTracker 2 inspired music tracker"
+HOMEPAGE="http://milkytracker.titandemo.org/"
+SRC_URI="https://github.com/milkytracker/MilkyTracker/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="|| ( GPL-3 MPL-1.1 ) AIFFWriter.m BSD GPL-3 GPL-3+ LGPL-2.1+ MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa jack"
+
+RDEPEND="
+ dev-libs/zziplib
+ media-libs/libsdl2[X]
+ sys-libs/zlib
+ alsa? ( media-libs/alsa-lib )
+ jack? ( media-sound/jack-audio-connection-kit )"
+DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}"/${PN}-1.0.0-docdir.patch )
+HTML_DOCS=( docs/{ChangeLog,FAQ,MilkyTracker}.html )
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_DOCDIR=share/doc/${PF}
+ $(cmake-utils_use_find_package alsa ALSA)
+ $(cmake-utils_use_find_package jack JACK)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ newicon resources/pictures/carton.png ${PN}.png
+ make_desktop_entry ${PN} MilkyTracker ${PN} \
+ "AudioVideo;Audio;Sequencer"
+}