Commit 9b421decb6ec2466926c0b83f3f72a8d88a96c8f
Exists in
develop
Merge branch 'master' into macos
Showing
4 changed files
with
41 additions
and
25 deletions
Show diff stats
Makefile.in
@@ -301,7 +301,7 @@ install-macos-application: \ | @@ -301,7 +301,7 @@ install-macos-application: \ | ||
301 | $(DESTDIR)$(bindir)/$(PRODUCT_NAME)@EXEEXT@ | 301 | $(DESTDIR)$(bindir)/$(PRODUCT_NAME)@EXEEXT@ |
302 | 302 | ||
303 | install-windows-application: \ | 303 | install-windows-application: \ |
304 | - branding/$(PRODUCT_NAME).png \ | 304 | + $(srcdir)/branding/$(PRODUCT_NAME).png \ |
305 | strip | 305 | strip |
306 | 306 | ||
307 | @$(MKDIR) \ | 307 | @$(MKDIR) \ |
@@ -315,11 +315,11 @@ install-windows-application: \ | @@ -315,11 +315,11 @@ install-windows-application: \ | ||
315 | $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME) | 315 | $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME) |
316 | 316 | ||
317 | @$(INSTALL_DATA) \ | 317 | @$(INSTALL_DATA) \ |
318 | - branding/$(PRODUCT_NAME).png \ | 318 | + $(srcdir)/branding/$(PRODUCT_NAME).png \ |
319 | $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/$(PRODUCT_NAME).png | 319 | $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/$(PRODUCT_NAME).png |
320 | 320 | ||
321 | @$(INSTALL_DATA) \ | 321 | @$(INSTALL_DATA) \ |
322 | - CHANGELOG \ | 322 | + $(srcdir)/CHANGELOG \ |
323 | $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/$(PACKAGE_NAME).changes | 323 | $(DESTDIR)$(datarootdir)/$(PRODUCT_NAME)/$(PACKAGE_NAME).changes |
324 | 324 | ||
325 | install-icons: | 325 | install-icons: |
branding/Makefile.in
@@ -24,9 +24,9 @@ APPLICATION_ID=@APPLICATION_ID@ | @@ -24,9 +24,9 @@ APPLICATION_ID=@APPLICATION_ID@ | ||
24 | 24 | ||
25 | prefix=@prefix@ | 25 | prefix=@prefix@ |
26 | exec_prefix=@exec_prefix@ | 26 | exec_prefix=@exec_prefix@ |
27 | +srcdir=@srcdir@ | ||
27 | datarootdir=@datarootdir@ | 28 | datarootdir=@datarootdir@ |
28 | bindir=@bindir@ | 29 | bindir=@bindir@ |
29 | -srcdir=@srcdir@ | ||
30 | 30 | ||
31 | BUILDDIR=@BUILDDIR@ | 31 | BUILDDIR=@BUILDDIR@ |
32 | BINDIR=$(BUILDDIR)/.bin | 32 | BINDIR=$(BUILDDIR)/.bin |
@@ -156,7 +156,7 @@ install-windows: \ | @@ -156,7 +156,7 @@ install-windows: \ | ||
156 | @$(MKDIR) $(DESTDIR)$(bindir) | 156 | @$(MKDIR) $(DESTDIR)$(bindir) |
157 | 157 | ||
158 | @$(INSTALL_DATA) \ | 158 | @$(INSTALL_DATA) \ |
159 | - $(PRODUCT_NAME).ico \ | 159 | + $(srcdir)/$(PRODUCT_NAME).ico \ |
160 | $(DESTDIR)$(bindir)/$(PRODUCT_NAME).ico | 160 | $(DESTDIR)$(bindir)/$(PRODUCT_NAME).ico |
161 | 161 | ||
162 | 162 |
@@ -5,7 +5,7 @@ set -Eeuo pipefail | @@ -5,7 +5,7 @@ set -Eeuo pipefail | ||
5 | check_dependencies() { | 5 | check_dependencies() { |
6 | local unavailable=() | 6 | local unavailable=() |
7 | for dependency in "${@:-$(</dev/stdin)}"; do | 7 | for dependency in "${@:-$(</dev/stdin)}"; do |
8 | - if [[ ! -x "$(command -v ${dependency})" ]]; then unavailable+=("${dependency}"); fi | 8 | + if [[ ! -x "$(command -v "${dependency}")" ]]; then unavailable+=("${dependency}"); fi |
9 | done | 9 | done |
10 | if [[ ${#unavailable[@]} == 1 ]]; then | 10 | if [[ ${#unavailable[@]} == 1 ]]; then |
11 | echo "Dependency '${unavailable[*]}' not found." | 11 | echo "Dependency '${unavailable[*]}' not found." |
@@ -18,7 +18,7 @@ check_dependencies() { | @@ -18,7 +18,7 @@ check_dependencies() { | ||
18 | 18 | ||
19 | find_lib() { | 19 | find_lib() { |
20 | # https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/UsingDynamicLibraries.html | 20 | # https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/UsingDynamicLibraries.html |
21 | - local libs_path="${HOME}/lib /usr/local/lib /usr/lib" | 21 | + local libs_path="${HOME}/lib $(brew --prefix)/lib /usr/lib" |
22 | for lib in "${@:-$(</dev/stdin)}"; do | 22 | for lib in "${@:-$(</dev/stdin)}"; do |
23 | local found="" | 23 | local found="" |
24 | if [[ -f "${lib}" ]]; then | 24 | if [[ -f "${lib}" ]]; then |
@@ -73,17 +73,25 @@ bundle_cp() { | @@ -73,17 +73,25 @@ bundle_cp() { | ||
73 | cp "${source}" "${target}" | 73 | cp "${source}" "${target}" |
74 | chmod u+w "${target}" | 74 | chmod u+w "${target}" |
75 | 75 | ||
76 | - if [[ "${id}" != "" ]]; then install_name_tool -id "${id}" "${target}"; fi | ||
77 | - install_name_tool -add_rpath "@executable_path/../Frameworks" "${target}" | 76 | + if [[ "${id}" != "" ]]; then install_name_tool -id "${id}" "${target}" 2> /dev/null; fi |
77 | + install_name_tool -add_rpath "@executable_path/../Frameworks" "${target}" 2> /dev/null | ||
78 | 78 | ||
79 | for old_install_name in $(otool -L "${target}" | grep '^\t' | cut -c 2- | sed -n "s/\(.*\) (.*)/\1/p"); do | 79 | for old_install_name in $(otool -L "${target}" | grep '^\t' | cut -c 2- | sed -n "s/\(.*\) (.*)/\1/p"); do |
80 | if [[ "${old_install_name}" == "${id}" ]]; then continue; fi | 80 | if [[ "${old_install_name}" == "${id}" ]]; then continue; fi |
81 | - local lib="$(find_lib "${old_install_name}")" | 81 | + if [[ "${old_install_name}" =~ ${system_libs} ]]; then continue; fi |
82 | + local lib | ||
83 | + if [[ "${old_install_name}" =~ ^@loader_path.* ]]; then | ||
84 | + lib="$(find_lib "$(dirname "${source}")/${old_install_name//@loader_path/}")" | ||
85 | + else | ||
86 | + lib="$(find_lib "${old_install_name}")" | ||
87 | + fi | ||
82 | local new_install_name="$(bundle_cp "${lib}")" | 88 | local new_install_name="$(bundle_cp "${lib}")" |
83 | if [[ "${new_install_name}" != "" ]]; then | 89 | if [[ "${new_install_name}" != "" ]]; then |
84 | - install_name_tool -change "${old_install_name}" "${new_install_name}" "${target}" | 90 | + install_name_tool -change "${old_install_name}" "${new_install_name}" "${target}" 2> /dev/null |
85 | fi | 91 | fi |
86 | done | 92 | done |
93 | + # https://stackoverflow.com/a/71753248/6910609 | ||
94 | + codesign --force -s - "${target}" 2> /dev/null | ||
87 | echo >&2 "${target}" | 95 | echo >&2 "${target}" |
88 | done | 96 | done |
89 | } | 97 | } |
@@ -113,9 +121,9 @@ bundle_cache() { | @@ -113,9 +121,9 @@ bundle_cache() { | ||
113 | check_dependencies otool grep cut sed greadlink qlmanage sips iconutil | 121 | check_dependencies otool grep cut sed greadlink qlmanage sips iconutil |
114 | 122 | ||
115 | # Creates temporary directory | 123 | # Creates temporary directory |
116 | -echo "Creating temporary directory" | 124 | +echo "* Creating temporary directory" |
117 | tmp="$(mktemp -d)" | 125 | tmp="$(mktemp -d)" |
118 | -trap 'echo "Removing temporary directory \"${tmp}\""; rm -rf "${tmp}"' EXIT | 126 | +trap 'echo "* Removing temporary directory \"${tmp}\""; rm -rf "${tmp}"' EXIT |
119 | 127 | ||
120 | bundle="pw3270.app" | 128 | bundle="pw3270.app" |
121 | bundle_path="${bundle}/Contents" | 129 | bundle_path="${bundle}/Contents" |
@@ -129,17 +137,15 @@ mkdir -p "${bundle_path}" | @@ -129,17 +137,15 @@ mkdir -p "${bundle_path}" | ||
129 | cp "Info.plist" "${bundle_path}" | 137 | cp "Info.plist" "${bundle_path}" |
130 | 138 | ||
131 | mkdir -p "${res_path}" | 139 | mkdir -p "${res_path}" |
132 | -cp -r "../ui" "${res_path}" | 140 | +cp -r "../ui/macos.ui.xml" "${res_path}/pw3270.ui.xml" |
133 | cp -r "$(brew --prefix)/share/pw3270/remap" "${res_path}" | 141 | cp -r "$(brew --prefix)/share/pw3270/remap" "${res_path}" |
134 | cp "$(brew --prefix)/share/pw3270/colors.conf" "${res_path}" | 142 | cp "$(brew --prefix)/share/pw3270/colors.conf" "${res_path}" |
135 | 143 | ||
136 | # Bundle GLib schemas | 144 | # Bundle GLib schemas |
137 | -echo "Bundling GLib schemas" | 145 | +echo "* Bundling GLib schemas" |
138 | mkdir -p "${tmp}/schemas" | 146 | mkdir -p "${tmp}/schemas" |
139 | - | ||
140 | -cp "../schemas/*.gschema.xml" "${tmp}/schemas" | 147 | +cp "../schemas/"*".gschema.xml" "${tmp}/schemas" |
141 | cp "$(pkg-config gtk+-3.0 --variable=prefix)/share/glib-2.0/schemas/org.gtk.Settings."*".gschema.xml" "${tmp}/schemas" | 148 | cp "$(pkg-config gtk+-3.0 --variable=prefix)/share/glib-2.0/schemas/org.gtk.Settings."*".gschema.xml" "${tmp}/schemas" |
142 | - | ||
143 | glib-compile-schemas --targetdir="${res_path}" "${tmp}/schemas" | 149 | glib-compile-schemas --targetdir="${res_path}" "${tmp}/schemas" |
144 | 150 | ||
145 | # Create the GTK settings file | 151 | # Create the GTK settings file |
@@ -152,7 +158,7 @@ gtk-print-preview-command="open -b com.apple.Preview %f" | @@ -152,7 +158,7 @@ gtk-print-preview-command="open -b com.apple.Preview %f" | ||
152 | EOF | 158 | EOF |
153 | 159 | ||
154 | # Make icon bundle | 160 | # Make icon bundle |
155 | -echo "Creating app icon bundle" | 161 | +echo "* Creating app icon bundle" |
156 | iconset="${tmp}/pw3270.iconset" | 162 | iconset="${tmp}/pw3270.iconset" |
157 | rm -fr "${iconset}" | 163 | rm -fr "${iconset}" |
158 | mkdir -p "${iconset}" | 164 | mkdir -p "${iconset}" |
@@ -168,34 +174,41 @@ iconutil -c icns -o "${res_path}/pw3270.icns" "${iconset}" | @@ -168,34 +174,41 @@ iconutil -c icns -o "${res_path}/pw3270.icns" "${iconset}" | ||
168 | 174 | ||
169 | 175 | ||
170 | # Copy icons | 176 | # Copy icons |
177 | +echo "* Copying icons" | ||
171 | mkdir -p "${res_path}/icons" | 178 | mkdir -p "${res_path}/icons" |
172 | cp -r "$(brew --prefix adwaita-icon-theme)/share/icons/" "${res_path}/icons" | 179 | cp -r "$(brew --prefix adwaita-icon-theme)/share/icons/" "${res_path}/icons" |
173 | cp -r "$(brew --prefix hicolor-icon-theme)/share/icons/" "${res_path}/icons" | 180 | cp -r "$(brew --prefix hicolor-icon-theme)/share/icons/" "${res_path}/icons" |
174 | mogrify -format png -path "${res_path}" -background transparent "../branding/*.svg" | 181 | mogrify -format png -path "${res_path}" -background transparent "../branding/*.svg" |
175 | 182 | ||
176 | # Copy themes | 183 | # Copy themes |
184 | +echo "* Copying themes" | ||
177 | mkdir -p "${res_path}/themes" | 185 | mkdir -p "${res_path}/themes" |
178 | cp -a "$(brew --prefix gtk+3)/share/themes/Mac" "${res_path}/themes" | 186 | cp -a "$(brew --prefix gtk+3)/share/themes/Mac" "${res_path}/themes" |
179 | 187 | ||
180 | # Copy mime database | 188 | # Copy mime database |
189 | +echo "* Copying mime database" | ||
181 | mkdir -p "${res_path}/mime" | 190 | mkdir -p "${res_path}/mime" |
182 | cp "$(pkg-config shared-mime-info --variable=prefix)/share/mime/mime.cache" "${res_path}/mime" | 191 | cp "$(pkg-config shared-mime-info --variable=prefix)/share/mime/mime.cache" "${res_path}/mime" |
183 | 192 | ||
184 | # Copy executables | 193 | # Copy executables |
194 | +echo "* Copying executables" | ||
185 | mkdir -p "${exe_path}" | 195 | mkdir -p "${exe_path}" |
186 | bundle_cp "../.bin/Release/pw3270" | 196 | bundle_cp "../.bin/Release/pw3270" |
187 | cp "launcher.sh" "${exe_path}" | 197 | cp "launcher.sh" "${exe_path}" |
188 | 198 | ||
189 | # Bundle GdkPixbuf Image Loader Modules | 199 | # Bundle GdkPixbuf Image Loader Modules |
200 | +echo "* Bundling GdkPixbuf Image Loader Modules" | ||
190 | gdk-pixbuf-query-loaders | bundle_cache > "${res_path}/gdk-loaders.cache" | 201 | gdk-pixbuf-query-loaders | bundle_cache > "${res_path}/gdk-loaders.cache" |
191 | 202 | ||
192 | # Bundle GTK+ Input Method Modules | 203 | # Bundle GTK+ Input Method Modules |
204 | +echo "* Bundling GTK+ Input Method Modules" | ||
193 | gtk_prefix="$(pkg-config gtk+-3.0 --variable prefix)" | 205 | gtk_prefix="$(pkg-config gtk+-3.0 --variable prefix)" |
194 | gtk-query-immodules-3.0 | bundle_cache \ | 206 | gtk-query-immodules-3.0 | bundle_cache \ |
195 | | sed "s|${gtk_prefix}/share/locale|@executable_path/../Resources/locale|g" \ | 207 | | sed "s|${gtk_prefix}/share/locale|@executable_path/../Resources/locale|g" \ |
196 | > "${res_path}/gtk.immodules" | 208 | > "${res_path}/gtk.immodules" |
197 | 209 | ||
198 | # Bundle print backends | 210 | # Bundle print backends |
211 | +echo "* Bundling print backends" | ||
199 | mkdir -p "${lib_path}/printbackends" | 212 | mkdir -p "${lib_path}/printbackends" |
200 | for backend in "$(pkg-config gtk+-3.0 --variable=prefix)/lib/gtk-3.0/$(pkg-config gtk+-3.0 --variable=gtk_binary_version)/printbackends/"*.so; do | 213 | for backend in "$(pkg-config gtk+-3.0 --variable=prefix)/lib/gtk-3.0/$(pkg-config gtk+-3.0 --variable=gtk_binary_version)/printbackends/"*.so; do |
201 | bundle_cp "${backend}" | 214 | bundle_cp "${backend}" |
@@ -206,7 +219,8 @@ done | @@ -206,7 +219,8 @@ done | ||
206 | # TODO: gerar o Info.plist com a versão do macOS $(sw_vers -productVersion) | 219 | # TODO: gerar o Info.plist com a versão do macOS $(sw_vers -productVersion) |
207 | 220 | ||
208 | # Bundle locale | 221 | # Bundle locale |
222 | +echo "* Bundling locale" | ||
209 | mkdir -p "${res_path}/locale" | 223 | mkdir -p "${res_path}/locale" |
210 | cp -r "../.bin/locale/" "${res_path}/locale" | 224 | cp -r "../.bin/locale/" "${res_path}/locale" |
211 | -cp "$(brew --prefix)/share/locale/pt_BR/LC_MESSAGES/lib3270.mo" "${res_path}/locale/pt_BR/LC_MESSAGES" | ||
212 | -cp "$(brew --prefix)/share/locale/pt_BR/LC_MESSAGES/libv3270.mo" "${res_path}/locale/pt_BR/LC_MESSAGES" | 225 | +cp "$(brew --prefix)/share/locale/pt_BR/LC_MESSAGES/lib3270"*".mo" "${res_path}/locale/pt_BR/LC_MESSAGES" |
226 | +cp "$(brew --prefix)/share/locale/pt_BR/LC_MESSAGES/libv3270"*".mo" "${res_path}/locale/pt_BR/LC_MESSAGES" |
src/include/config.h.in
@@ -24,12 +24,12 @@ | @@ -24,12 +24,12 @@ | ||
24 | /* do we have malloc.h? */ | 24 | /* do we have malloc.h? */ |
25 | #undef HAVE_MALLOC_H | 25 | #undef HAVE_MALLOC_H |
26 | 26 | ||
27 | -/* Define to 1 if you have the <memory.h> header file. */ | ||
28 | -#undef HAVE_MEMORY_H | ||
29 | - | ||
30 | /* Define to 1 if you have the <stdint.h> header file. */ | 27 | /* Define to 1 if you have the <stdint.h> header file. */ |
31 | #undef HAVE_STDINT_H | 28 | #undef HAVE_STDINT_H |
32 | 29 | ||
30 | +/* Define to 1 if you have the <stdio.h> header file. */ | ||
31 | +#undef HAVE_STDIO_H | ||
32 | + | ||
33 | /* Define to 1 if you have the <stdlib.h> header file. */ | 33 | /* Define to 1 if you have the <stdlib.h> header file. */ |
34 | #undef HAVE_STDLIB_H | 34 | #undef HAVE_STDLIB_H |
35 | 35 | ||
@@ -105,7 +105,9 @@ | @@ -105,7 +105,9 @@ | ||
105 | /* The schema path */ | 105 | /* The schema path */ |
106 | #undef PRODUCT_PATH | 106 | #undef PRODUCT_PATH |
107 | 107 | ||
108 | -/* Define to 1 if you have the ANSI C header files. */ | 108 | +/* Define to 1 if all of the C90 standard headers exist (not just the ones |
109 | + required in a freestanding environment). This macro is provided for | ||
110 | + backward compatibility; new code need not use it. */ | ||
109 | #undef STDC_HEADERS | 111 | #undef STDC_HEADERS |
110 | 112 | ||
111 | /* Version number of package */ | 113 | /* Version number of package */ |