-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathwindows-package
executable file
·211 lines (179 loc) · 10.2 KB
/
windows-package
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#!/bin/sh
APP_NAME=$1
APP_BUNDLE=$APP_NAME.app
DEST_DIR=/c/Users/${USER}/OneDrive/Desktop
APP_DIR=$DEST_DIR/$APP_NAME
GS_CONF_MASTER=windows-GNUstep.conf
GS_CONF=
MSYS_BASE=/mingw64
echo "== Packaging ${APP_BUNDLE}"
echo " "
echo "Removing old package"
rm -rf 2> /dev/null ${APP_DIR}
echo "Make ${APP_DIR}..."
mkdir -p ${APP_DIR}
echo "== Creating GNUstep.conf file..."
cat > $APP_DIR/GNUstep.conf << EOF
GNUSTEP_USER_CONFIG_FILE=.GNUstep.conf
GNUSTEP_USER_DIR=GNUstep
GNUSTEP_USER_DEFAULTS_DIR=GNUstep/Defaults
GNUSTEP_SYSTEM_APPS=./GNUstep/System/Applications
GNUSTEP_SYSTEM_ADMIN_APPS=./GNUstep/System/Applications
GNUSTEP_SYSTEM_TOOLS=./GNUstep/System/Tools
GNUSTEP_SYSTEM_ADMIN_TOOLS=./GNUstep/System/Tools
GNUSTEP_SYSTEM_LIBRARY=./GNUstep/System/Library
GNUSTEP_SYSTEM_HEADERS=./GNUstep/System/Library/Headers
GNUSTEP_SYSTEM_LIBRARIES=./GNUstep/System/Library/Libraries
GNUSTEP_SYSTEM_DOC=./GNUstep/System/Library/Documentation
GNUSTEP_SYSTEM_DOC_MAN=./GNUstep/System/Library/Documentation/man
GNUSTEP_SYSTEM_DOC_INFO=./GNUstep/System/Library/Documentation/info
GNUSTEP_LOCAL_APPS=./GNUstep/Local/Applications
GNUSTEP_LOCAL_ADMIN_APPS=./GNUstep/Local/Applications
GNUSTEP_LOCAL_TOOLS=./GNUstep/Local/Tools
GNUSTEP_LOCAL_ADMIN_TOOLS=./GNUstep/Local/Tools
GNUSTEP_LOCAL_LIBRARY=./GNUstep/Local/Library
GNUSTEP_LOCAL_HEADERS=./GNUstep/Local/Library/Headers
GNUSTEP_LOCAL_LIBRARIES=./GNUstep/Local/Library/Libraries
GNUSTEP_LOCAL_DOC=./GNUstep/Local/Library/Documentation
GNUSTEP_LOCAL_DOC_MAN=./GNUstep/Local/Library/Documentation/man
GNUSTEP_LOCAL_DOC_INFO=./GNUstep/Local/Library/Documentation/info
EOF
echo "Creating Self-contained package for Windows for $APP_NAME"
echo "Copying $APP_BUNDLE contents into $APP_DIR"
cp 2> /dev/null -r $APP_BUNDLE/* "$APP_DIR"
echo "Copying DLLs from /bin and ${MSYS_BASE}/bin"
cp 2> /dev/null $(find /bin -name *.dll) "$APP_DIR"
cp 2> /dev/null $(find ${MSYS_BASE}/bin -name *.dll) "$APP_DIR"
cp 2> /dev/null $(find /usr/local -name *.dll) "$APP_DIR"
echo "Copying the GNUstep Directory into $APP_NAME"
mkdir -p "$APP_DIR"/GNUstep
cp 2> /dev/null -R /usr/GNUstep/* "${APP_DIR}/GNUstep/"
# cp 2> /dev/null -R /usr/GNUstep/* ${APP_DIR}/GNUstep/
echo "Cleaning up configuration management files"
find "$APP_DIR" -name .svn -print0 | xargs -0 rm -r
find "$APP_DIR" -name .cvs -print0 | xargs -0 rm -r
find "$APP_DIR" -name .git -print0 | xargs -0 rm -r
echo "Cleaning up other files"
find "$APP_DIR" -name stamp.make -print0 | xargs -0 rm
echo "Copying GNUstep.conf file"
cp 2> /dev/null $GS_CONF_MASTER "$APP_DIR"/GNUstep.conf
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/etc
# echo "Copying Windows manifest"
# cp 2> /dev/null $APP_NAME.exe.manifest $APP_DIR
echo "Moving Library DLLs from the GNUstep tree to $APP_BUNDLE"
mv "$APP_DIR"/GNUstep/Local/Tools/*.dll "$APP_DIR"/
mv "$APP_DIR"/GNUstep/System/Tools/*.dll "$APP_DIR"/
echo "Removing Network folder..."
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Network
echo "Removing Headers"
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Headers
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Headers
find "$APP_DIR"/GNUstep -name Headers -print0 | xargs -0 rm -r
echo "Removing installed applications..."
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Applications
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Applications
echo "Removing Fonts"
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Fonts
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Fonts
echo "Removing Documentation"
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/man
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Documentation
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Documentation
echo "Removing Makefiles"
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Makefiles
# Check that your app doesn't use one of these!
echo "Removing unused frameworks and its libraries"
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Frameworks/RSSKit.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Libraries/libRSSKit*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Frameworks/SimpleWebKit.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Libraries/libSimpleWebKit*
rm -rf 2> /dev/null "$APP_DIR"/SimpleWebKit*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Frameworks/SimpleWebKit.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Cynthiune
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/ApplicationSupport/GSTest
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Bundles/libgmodel.bundle
echo "Removing known Application and Developer tool traces"
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Frameworks/AddressView.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Frameworks/AddressView.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Frameworks/Addresses.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Frameworks/Addresses.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Frameworks/PreferencePanes.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Frameworks/PreferencePanes.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Bundles/*.prefPane
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/*.prefPane
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/SystemPreferences
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Libraries/libPreferencePanes.*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Frameworks/ProjectCenter.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Frameworks/ProjectCenter.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Libraries/libProjectCenter*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Libraries/libProjectCenter*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/ProjectCenter
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Libraries/libGorm*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Libraries/libGorm*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/Gorm
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Tools/fswatcher.exe
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/fswatcher.exe
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Tools/ddbd.exe
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/ddbd.exe
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Services/thumbnailer.service
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Services/thumbnailer.service
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Libraries/libFSNode*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Libraries/libFSNode*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Libraries/libInspector*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Libraries/libInspector*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Libraries/libOperation*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Libraries/libOperation*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Bundles/ImageThumbnailer.thumb
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/ImageThumbnailer.thumb
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Bundles/ImageViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/ImageViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Bundles/FModule*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/FModule*
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Bundles/NSTIFFViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/NSTIFFViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Bundles/NSRTFViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/NSRTFViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Frameworks/Operation.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Frameworks/Operation.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Frameworks/FSNode.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Frameworks/FSNode.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Library/Frameworks/Inspector.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Frameworks/Inspector.framework
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/AppViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/FolderViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/IBViewViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/SoundViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/RtfViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/NSColorViewer.inspector
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/Role.extinfo
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Bundles/MDModuleAnnotations.mdm
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Tools/Recycler
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/Recycler
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/wopen.exe
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/searchtool.exe
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/GWorkspace
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Library/Libraries/libDBKit.*
rm -rf 2> /dev/null "$APP_DIR"/libsvn*.dll
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/share
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/debugapp
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/autogsdoc.exe
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/make_strings.exe
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/plparse.exe
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/System/Tools/sfparse.exe
echo "Removing specific libraries"
rm -rf 2> /dev/null "$APP_DIR"/Gorm*.dll
rm -rf 2> /dev/null "$APP_DIR"/Addresses*.dll
rm -rf 2> /dev/null "$APP_DIR"/AddressView*.dll
rm -rf 2> /dev/null "$APP_DIR"/Operation*.dll
rm -rf 2> /dev/null "$APP_DIR"/ProjectCenter*.dll
rm -rf 2> /dev/null "$APP_DIR"/PreferencePanes*.dll
rm -rf 2> /dev/null "$APP_DIR"/RSSKit*.dll
rm -rf 2> /dev/null "$APP_DIR"/Cynthiune*.dll
rm -rf 2> /dev/null "$APP_DIR"/FSNode*.dll
rm -rf 2> /dev/null "$APP_DIR"/Inspector*.dll
rm -rf 2> /dev/null "$APP_DIR"/DBKit*.dll
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Tools/AClock
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Tools/AddressManager
rm -rf 2> /dev/null "$APP_DIR"/GNUstep/Local/Tools/GFractal
echo " "
echo "== Done."