summaryrefslogtreecommitdiff
blob: ddca961976a2dd795c489f922a2aca09b62a0e72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit desktop xdg

DESCRIPTION="Digital audio workstation"
HOMEPAGE="https://www.reaper.fm"

WDL_COMMIT="34b220ef76cc73c13098e60748cca55a20b6f903"

SRC_URI="
	amd64? ( https://www.reaper.fm/files/$(ver_cut 1).x/reaper$(ver_cut 1)$(printf %02d $(( 10#$(ver_cut 2) )))_linux_x86_64.tar.xz )
	x86? ( https://www.reaper.fm/files/$(ver_cut 1).x/reaper$(ver_cut 1)$(printf %02d $(( 10#$(ver_cut 2) )))_linux_i686.tar.xz )
	arm64? ( https://www.reaper.fm/files/$(ver_cut 1).x/reaper$(ver_cut 1)$(printf %02d $(( 10#$(ver_cut 2) )))_linux_aarch64.tar.xz )
	arm? ( https://www.reaper.fm/files/$(ver_cut 1).x/reaper$(ver_cut 1)$(printf %02d $(( 10#$(ver_cut 2) )))_linux_armv7l.tar.xz )
	https://github.com/justinfrankel/WDL/archive/${WDL_COMMIT}.tar.gz -> WDL-${WDL_COMMIT}.tar.gz
"

LICENSE="Cockos"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
RESTRICT="mirror"

IUSE="+jack pulseaudio mp3 ffmpeg"

RDEPEND="
	${DEPEND}
	media-libs/alsa-lib
	media-libs/libglvnd
	jack? ( virtual/jack )
	pulseaudio? ( media-libs/libpulse )
	mp3? ( media-sound/lame )
	ffmpeg? ( media-video/ffmpeg )
"

DEPEND="
	x11-libs/gtk+:3[X]
	x11-libs/libX11
	x11-libs/libXi
	media-libs/fontconfig
	media-libs/freetype
"

S="${WORKDIR}"

src_prepare() {
	default
	cd "WDL-${WDL_COMMIT}" || die
	eapply "${FILESDIR}"/libSwell-makefile-cflags.patch
}

src_compile() {
	emake -C "WDL-${WDL_COMMIT}/WDL/swell" \
		PRELOAD_GDK=1
}

QA_PREBUILT="*/*.so */reaper */reaper_host_*"

src_install() {
	cd "reaper_linux_"* || die
	mv -fv "../WDL-${WDL_COMMIT}/WDL/swell/libSwell.so" REAPER/ || die

	./install-reaper.sh --install "${D}"/opt || die
	rm -f "${D}"/opt/REAPER/uninstall-reaper.sh

	dosym ../../opt/REAPER/reaper /usr/bin/reaper

	# The following is pulled out of install-reaper.sh to match desktop.eclass.
	cd REAPER || die

	newicon -s 256 Resources/main.png cockos-reaper.png
	doicon -s 256 Resources/cockos-reaper-backup.png
	doicon -s 256 Resources/cockos-reaper-document.png
	doicon -s 256 Resources/cockos-reaper-theme.png
	doicon -s 256 Resources/cockos-reaper-peak.png
	doicon -s 256 Resources/cockos-reaper-template.png
	doicon -s 256 Resources/cockos-reaper-template2.png

	cat > cockos-reaper.desktop <<-EOF
	[Desktop Entry]
	Encoding=UTF-8
	Type=Application
	Name=REAPER
	Comment=REAPER
	Categories=Audio;Video;AudioVideo;AudioVideoEditing;Recorder;
	Exec="/usr/bin/reaper" %F
	Icon=cockos-reaper
	MimeType=application/x-reaper-project;application/x-reaper-project-backup;application/x-reaper-theme
	StartupWMClass=REAPER
	EOF
	domenu cockos-reaper.desktop

	cat > application-x-reaper.xml <<-EOF
	<?xml version="1.0" encoding="UTF-8"?>
	<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
	  <mime-type type="application/x-reaper-project">
		<sub-class-of type="text/plain"/>
		<comment xml:lang="en">REAPER project</comment>
		<icon name="cockos-reaper-document"/>
		<glob pattern="*.rpp"/>
	  </mime-type>
	  <mime-type type="application/x-reaper-project-backup">
		<sub-class-of type="text/plain"/>
		<comment xml:lang="en">REAPER project backup</comment>
		<icon name="cockos-reaper-backup"/>
		<glob pattern="*.rpp-bak"/>
	  </mime-type>
	  <mime-type type="application/x-reaper-config">
		<sub-class-of type="text/plain"/>
		<icon name="cockos-reaper"/>
		<comment xml:lang="en">REAPER configuration</comment>
		<glob pattern="reaper*.ini"/>
	  </mime-type>
	  <mime-type type="application/x-reaper-fxchain">
		<sub-class-of type="text/plain"/>
		<comment xml:lang="en">REAPER fx chain</comment>
		<icon name="cockos-reaper-template"/>
		<glob pattern="*.rfxchain"/>
	  </mime-type>
	  <mime-type type="application/x-reaper-tracktemplate">
		<sub-class-of type="text/plain"/>
		<comment xml:lang="en">REAPER track template</comment>
		<icon name="cockos-reaper-template2"/>
		<glob pattern="*.RTrackTemplate"/>
	  </mime-type>
	  <mime-type type="application/x-reaper-theme">
		<comment xml:lang="en">REAPER theme</comment>
		<icon name="cockos-reaper-theme"/>
		<glob pattern="*.ReaperTheme"/>
		<glob pattern="*.ReaperThemeZip"/>
	  </mime-type>
	  <mime-type type="application/x-reaper-undo">
		<icon name="cockos-reaper-backup"/>
		<comment xml:lang="en">REAPER undo</comment>
		<glob pattern="*.rpp-undo"/>
	  </mime-type>
	  <mime-type type="application/x-reaper-bak-undo">
		<icon name="cockos-reaper-backup"/>
		<comment xml:lang="en">REAPER undo backup</comment>
		<glob pattern="*.rpp-bak-undo"/>
	  </mime-type>
	  <mime-type type="application/x-reaper-peak">
		<comment xml:lang="en">REAPER peak file</comment>
		<icon name="cockos-reaper-peak"/>
		<glob pattern="*.reapeaks"/>
	  </mime-type>
	  <mime-type type="application/x-reaper-proxy">
		<icon name="cockos-reaper-peak"/>
		<comment xml:lang="en">REAPER proxy</comment>
		<glob pattern="*.rpp-prox"/>
	  </mime-type>
	</mime-info>
	EOF
	insopts -m 0644
	insinto /usr/share/mime
	doins application-x-reaper.xml
}