1 ################################################################################
3 # rox.cygclass - functions for building ROX Desktop packages
5 # Part of cygport - Cygwin packaging application
6 # Copyright (C) 2006-2020 Cygport authors
7 # Provided by the Cygwin project <https://cygwin.com/>
9 # cygport is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # cygport is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with cygport. If not, see <https://www.gnu.org/licenses/>.
22 ################################################################################
24 #****ih* Cygclasses/rox.cygclass
28 # The ROX Desktop is based on RISC OS. The desktop revolves around
29 # the file manager and drag-and-drop is used instead of Open/Save file
32 # ROX applications are standalone application directories (AppDirs) which
33 # can be run from anywhere without installation. Most applications are
34 # written in Python with ROX-Lib2 and some are written in C with ROX-CLib;
35 # either way, GTK+ is used as the underlying toolkit.
37 # This cygclass handles the building and installing of ROX packages.
38 # AppDirs are installed under /usr/lib/rox.
43 # cross-compiling is not (yet?) supported
44 __cross_compiling_error
48 ORIG_PN=${ORIG_PN:-${PN#rox-}}
50 #****io* rox.cygclass/CATEGORY (rox)
54 #****io* rox.cygclass/SUMMARY (rox)
56 SUMMARY="ROX Desktop ${ORIG_PN} component"
58 #****io* rox.cygclass/DESCRIPTION (rox)
60 DESCRIPTION="ROX is a fast, user friendly desktop based on RISC OS which makes
61 extensive use of drag-and-drop. The interface revolves around the file manager,
62 or filer, following the traditional Unix view that 'everything is a file' rather
63 than trying to hide the filesystem beneath start menus, wizards, or druids."
65 #****io* rox.cygclass/HOMEPAGE (rox)
67 HOMEPAGE="http://rox.sourceforge.net/desktop/"
70 DEPS_PATH="/usr/lib/ROX-Lib2/python"
72 #****iv* rox.cygclass/ROX_APP
74 # The name of the directory containing the AppRun script. This variable
77 # Often this directory is the toplevel of the tarball, in which case
78 # SRC_DIR must be set to '.'.
81 #****iv* rox.cygclass/ROX_WRAPPER
83 # Due to the DnD nature of the ROX desktop, most applications are not
84 # usable outside the filer. For the exceptions (e.g. OroboROX window
85 # manager) or for the filer (rox) and session manager (rox-session) which
86 # need to be launched from the command line (or in .xinitrc), define
87 # ROX_WRAPPER to the name of the wrapper script. This wrapper will be
88 # installed in /usr/bin.
91 #****iC* rox.cygclass/rox_autoreconf
93 # Runs autoconf, the only autotool which is generally used in ROX C
94 # packages, in order to pick up any patches to configure.{ac,in}.
99 if [ ! -e configure.in ]
101 error "not in src directory"
104 __config_set with_autoconf 1
107 autoconf --force || error "autoconf failed"
110 #****iC* rox.cygclass/rox_compile
112 # This function builds a ROX C package through the AppRun script.
114 # Be aware that some AppRun scripts create the executable in a
115 # platform-specific subdir, named based on uname(1) output. Because
116 # Cygwin's `uname -s` also contains the Windows version, applications
117 # compiled on one computer will not be found on another if their underlying
118 # Windows versions differ. To avoid this, change the definition of PLATFORM
119 # in AppRun (and AppletRun, if it exists) from
120 # PLATFORM=`uname -s`-$ARCH
122 # PLATFORM=CYGWIN-$ARCH
123 # This will allow the application to run on all Cygwin installations.
128 error "AppRun: not found"
131 ./AppRun --compile || error "compile failed"
134 #****iI* rox.cygclass/rox_install
136 # Install the (possibly compiled) AppDir into ${D}/usr/lib/rox,
137 # removes extraneous files (e.g. sources), compiles Python modules, and
138 # creates the wrapper script if ROX_WRAPPER is defined.
141 local wrapper=${ROX_WRAPPER:-none}
143 if [ ! -d ${ROX_APP} ]
145 error "${ROX_APP}: directory not found"
149 cp -LR ${ROX_APP} ${D}/usr/lib/rox/
150 rm -fr ${D}/usr/lib/rox/${ROX_APP}/{=build,build,src,.cvsignore}
152 python_optimize /usr/lib/rox/${ROX_APP}
154 if [ "${wrapper}" != "none" ]
157 cat > ${D}/usr/bin/${wrapper} <<-_EOF
159 exec /usr/lib/rox/${ROX_APP}/AppRun "\$@"
161 chmod 0755 ${D}/usr/bin/${wrapper}
164 dodoc ${ROX_APP}/Help/{COPYING,Changes,README}
167 #****io* rox.cygclass/src_compile (rox)
171 if [ -d ${S}/${ROX_APP}/src ]
173 cd ${B}/${ROX_APP}/src
181 #****io* rox.cygclass/src_install (rox)
189 readonly -f rox_autoreconf rox_compile rox_install