1 ################################################################################
3 # gnustep.cygclass - functions for building GNUstep 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/gnustep.cygclass
26 # GNUstep is an open-source implementation of the NeXT/OpenStep and Apple's
27 # Cocoa API frameworks, written in Objective-C. A number of additional
28 # libraries (known as Frameworks) and programs, both console and GUI are
29 # available, including some ported from Mac OS X. GNUstep packages are built
30 # with GNUmakefiles which use templates included in the gnustep-make package.
32 # This cygclass builds packages which use the GNUstep framework and build system.
39 # cross-compiling is not (yet?) supported
40 __cross_compiling_error
42 check_prog_req gnustep-config gnustep-make
45 *.app|*.bundle|*.framework|*.tool)
46 ORIG_PN=${ORIG_PN:-${PN%.*}}
50 #****io* gnustep.cygclass/CATEGORY (gnustep)
54 #****io* gnustep.cygclass/SUMMARY (gnustep)
56 SUMMARY="GNUstep ${ORIG_PN:-${PN#gnustep-}} component"
58 #****io* gnustep.cygclass/HOMEPAGE (gnustep)
60 HOMEPAGE="http://www.gnustep.org/"
63 #****io* gnustep.cygclass/SVN_URI (gnustep)
65 # svn.cygclass must be inherit()ed last for this to have any effect.
67 SVN_URI="svn://svn.gna.org/svn/gnustep"
72 # Returns the full path to the given GNUstep directory type.
76 error "__gnustep_dir: requires exactly one argument"
83 BUNDLES) d="SYSTEM_LIBRARY"; suffix="/Bundles" ;;
84 FONTS) d="SYSTEM_LIBRARY"; suffix="/Fonts" ;;
85 FRAMEWORKS) d="SYSTEM_LIBRARY"; suffix="/Frameworks" ;;
87 SERVICES) d="SYSTEM_LIBRARY"; suffix="/Services" ;;
88 APPS|DOC|HEADERS|LIBRARIES|TOOLS) d="SYSTEM_${d}" ;;
89 *) error "__gnustep_dir: unknown directory type: ${d}"
93 eval $(grep "^${var}=" /etc/GNUstep/GNUstep.conf)
94 echo -n ${!var#/}${suffix}
97 #for dvar in APPS BUNDLES DOC FONTS FRAMEWORKS HEADERS LIBRARIES MAKEFILES SERVICES TOOLS
99 # declare GNUSTEP_${dvar}=$(__gnustep_dir ${dvar})
103 #****if* gnustep.cygclass/gnustep_env
105 # Loads the GNUstep environment variables. This must be run before calling
106 # gnustep_compile or gnustep_install.
109 local mf=$(gnustep-config --variable=GNUSTEP_MAKEFILES)
110 . ${mf}/GNUstep-reset.sh
114 #****iC* gnustep.cygclass/gnustep_compile
117 # gnustep_compile [MAKEFILE_ARGUMENTS]
119 # Builds a GNUstep package with the following steps:
120 # - cygconf, if a configure script is present (usually not).
122 # - cygmake in the Documentation directory, if present.
123 # Arguments to gnustep_compile are passed to both cygmake calls.
125 # gnustep_env must be called before gnustep_compile.
128 if ! defined GNUSTEP_HOST
130 error "gnustep_env must be called first"
135 cygconf --with-installation-domain=SYSTEM
138 cygmake GNUSTEP_INSTALLATION_DOMAIN=SYSTEM ${@}
140 if [ -e Documentation/GNUmakefile ]
142 cygmake -C Documentation GNUSTEP_INSTALLATION_DOMAIN=SYSTEM ${@}
146 #****iI* gnustep.cygclass/gnustep_install
149 # gnustep_install [MAKEFILE_ARGUMENTS]
151 # Installs a GNUstep package under $D. Arguments to gnustep_install are
152 # passed to cyginstall.
154 # gnustep_env must be called before gnustep_install.
157 if ! defined GNUSTEP_HOST
159 error "gnustep_env must be called first"
162 cyginstall GNUSTEP_INSTALLATION_DOMAIN=SYSTEM ${@}
164 if [ -e Documentation/GNUmakefile ]
166 cyginstall -C Documentation GNUSTEP_INSTALLATION_DOMAIN=SYSTEM ${@}
170 #****if* gnustep.cygclass/gnustep_pkg_apps
172 # gnustep_pkg_apps APP_NAME [APP_NAME] ...
174 # Create a binary subpackage $APP_NAME.app containing the given application(s).
183 PKG_NAMES+=" ${an}.app"
184 export ${an}_app_CONTENTS="usr/bin/${an} $(__gnustep_dir APPS)/${an}.app/"
188 #****if* gnustep.cygclass/gnustep_pkg_frameworks
190 # gnustep_pkg_frameworks FRAMEWORK_NAME:VERSION [FRAMEWORK_NAME:VERSION] ...
192 # Create binary subpackages lib$FRAMEWORK_NAME$VERSION and lib$FRAMEWORK_NAME-devel
193 # containing the runtime and development components of the given frameworks(s).
195 gnustep_pkg_frameworks() {
196 local fd fn fv f_v _v
203 fd=$(__gnustep_dir FRAMEWORKS)/${fn}.framework
205 PKG_NAMES+=" lib${fn}${fv} lib${fn}-devel"
206 export lib${fn}${_v}_CONTENTS="usr/bin/cyg${fn}-${_v}.dll \
208 ${fd}/Versions/${fv}/Resources/ \
209 ${fd}/Versions/${fv}/cyg${fn}-${_v}.dll \
210 ${fd}/Versions/Current"
211 export lib${fn}_devel_CONTENTS="$(__gnustep_dir HEADERS)/${fn}/ \
214 ${fd}/Versions/${fv}/Headers \
215 ${fd}/Versions/${fv}/${fn} \
216 ${fd}/Versions/${fv}/lib${fn}.dll.a \
217 ${fd}/lib${fn}.dll.a \
218 usr/lib/lib${fn}.dll.a"
222 #****io* gnustep.cygclass/src_compile (gnustep)
232 #****io* gnustep.cygclass/src_install (gnustep)
241 readonly -f __gnustep_dir gnustep_env gnustep_compile gnustep_install \
242 gnustep_pkg_apps gnustep_pkg_frameworks