-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathrox.cygclass
189 lines (167 loc) · 5.39 KB
/
rox.cygclass
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
################################################################################
#
# rox.cygclass - functions for building ROX Desktop packages
#
# Part of cygport - Cygwin packaging application
# Copyright (C) 2006-2020 Cygport authors
# Provided by the Cygwin project <https://cygwin.com/>
#
# cygport is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cygport is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cygport. If not, see <https://www.gnu.org/licenses/>.
#
################################################################################
#****ih* Cygclasses/rox.cygclass
# SYNOPSIS
# inherit rox
# DESCRIPTION
# The ROX Desktop is based on RISC OS. The desktop revolves around
# the file manager and drag-and-drop is used instead of Open/Save file
# dialogs.
#
# ROX applications are standalone application directories (AppDirs) which
# can be run from anywhere without installation. Most applications are
# written in Python with ROX-Lib2 and some are written in C with ROX-CLib;
# either way, GTK+ is used as the underlying toolkit.
#
# This cygclass handles the building and installing of ROX packages.
# AppDirs are installed under /usr/lib/rox.
# INHERITS
# python.cygclass
#****
# cross-compiling is not (yet?) supported
__cross_compiling_error
inherit python
ORIG_PN=${ORIG_PN:-${PN#rox-}}
#****io* rox.cygclass/CATEGORY (rox)
# DEFINITION
CATEGORY="ROX"
#****
#****io* rox.cygclass/SUMMARY (rox)
# DEFINITION
SUMMARY="ROX Desktop ${ORIG_PN} component"
#****
#****io* rox.cygclass/DESCRIPTION (rox)
# DEFINITION
DESCRIPTION="ROX is a fast, user friendly desktop based on RISC OS which makes
extensive use of drag-and-drop. The interface revolves around the file manager,
or filer, following the traditional Unix view that 'everything is a file' rather
than trying to hide the filesystem beneath start menus, wizards, or druids."
#****
#****io* rox.cygclass/HOMEPAGE (rox)
# DEFINITION
HOMEPAGE="http://rox.sourceforge.net/desktop/"
#****
DEPS_PATH="/usr/lib/ROX-Lib2/python"
#****iv* rox.cygclass/ROX_APP
# DESCRIPTION
# The name of the directory containing the AppRun script. This variable
# is required.
# NOTE
# Often this directory is the toplevel of the tarball, in which case
# SRC_DIR must be set to '.'.
#****
#****iv* rox.cygclass/ROX_WRAPPER
# DESCRIPTION
# Due to the DnD nature of the ROX desktop, most applications are not
# usable outside the filer. For the exceptions (e.g. OroboROX window
# manager) or for the filer (rox) and session manager (rox-session) which
# need to be launched from the command line (or in .xinitrc), define
# ROX_WRAPPER to the name of the wrapper script. This wrapper will be
# installed in /usr/bin.
#****
#****iC* rox.cygclass/rox_autoreconf
# DESCRIPTION
# Runs autoconf, the only autotool which is generally used in ROX C
# packages, in order to pick up any patches to configure.{ac,in}.
# REQUIRES
# autoconf
#****
rox_autoreconf() {
if [ ! -e configure.in ]
then
error "not in src directory"
fi
__config_set with_autoconf 1
rm -f configure
autoconf --force || error "autoconf failed"
}
#****iC* rox.cygclass/rox_compile
# DESCRIPTION
# This function builds a ROX C package through the AppRun script.
# NOTE
# Be aware that some AppRun scripts create the executable in a
# platform-specific subdir, named based on uname(1) output. Because
# Cygwin's `uname -s` also contains the Windows version, applications
# compiled on one computer will not be found on another if their underlying
# Windows versions differ. To avoid this, change the definition of PLATFORM
# in AppRun (and AppletRun, if it exists) from
# PLATFORM=`uname -s`-$ARCH
# to
# PLATFORM=CYGWIN-$ARCH
# This will allow the application to run on all Cygwin installations.
#****
rox_compile() {
if [ ! -e AppRun ]
then
error "AppRun: not found"
fi
./AppRun --compile || error "compile failed"
}
#****iI* rox.cygclass/rox_install
# DESCRIPTION
# Install the (possibly compiled) AppDir into ${D}/usr/lib/rox,
# removes extraneous files (e.g. sources), compiles Python modules, and
# creates the wrapper script if ROX_WRAPPER is defined.
#****
rox_install() {
local wrapper=${ROX_WRAPPER:-none}
if [ ! -d ${ROX_APP} ]
then
error "${ROX_APP}: directory not found"
fi
dodir /usr/lib/rox
cp -LR ${ROX_APP} ${D}/usr/lib/rox/
rm -fr ${D}/usr/lib/rox/${ROX_APP}/{=build,build,src,.cvsignore}
python_optimize /usr/lib/rox/${ROX_APP}
if [ "${wrapper}" != "none" ]
then
dodir /usr/bin
cat > ${D}/usr/bin/${wrapper} <<-_EOF
#! /bin/sh
exec /usr/lib/rox/${ROX_APP}/AppRun "\$@"
_EOF
chmod 0755 ${D}/usr/bin/${wrapper}
fi
dodoc ${ROX_APP}/Help/{COPYING,Changes,README}
}
#****io* rox.cygclass/src_compile (rox)
# DEFINITION
src_compile() {
lndirs
if [ -d ${S}/${ROX_APP}/src ]
then
cd ${B}/${ROX_APP}/src
rox_autoreconf
cd ${B}/${ROX_APP}
rox_compile
fi
}
#****
#****io* rox.cygclass/src_install (rox)
# DEFINITION
src_install() {
cd ${B}
rox_install
}
#****
readonly -f rox_autoreconf rox_compile rox_install