Skip to content

Commit

Permalink
Build pkg-config as 64bit only, libtiff as universal and remove gtk-q…
Browse files Browse the repository at this point in the history
…uartz-engine.py

We hit troubles (mono/mono#13804) which are apparently related to lipo'ing so move the three packages that use it away from it.

- pkg-config doesn't build as universal since the internal glib doesn't build because of 32/64bit configure mismatches (we'd need to do similar patches to what we do in glib.py) so just make it 64bit only.

- libtiff also runs into the 32/64bit configure mismatch but we can fix it with a simple patch.
  I tested it works by running the repro from https://xamarin.github.io/bugzilla-archives/39/39865/bug.html .

- gtk-quartz-engine.py is no longer used by MD/VSMac according to the team so remove it completely.
  • Loading branch information
akoeplinger committed Aug 29, 2019
1 parent 1d8d36b commit 4693825
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 16 deletions.
5 changes: 4 additions & 1 deletion bockbuild/package.py
Expand Up @@ -44,10 +44,11 @@ def __init__(self, name, version=None, organization=None, configure_flags=None,
# fat binary parameters. On a 64-bit Darwin profile (m64 = True)
# each package must decide if it will a) perform a multi-arch (64/32) build
# b) request two builds that are lipoed at the end or c) request a 32-bit
# build only.
# build only or d) request a 64-bit build only.

self.needs_lipo = False
self.m32_only = False
self.m64_only = False
self.build_dependency = False
self.dont_clean = False
self.needs_build = None
Expand Down Expand Up @@ -514,6 +515,8 @@ def start_build(self, arch, dest, stage):
stagedir_x32, package_stage, 'bin', '32', '64')
elif arch == 'toolchain':
package_stage = self.do_build('darwin-64')
elif self.m64_only:
package_stage = self.do_build('darwin-64')
elif self.m32_only:
package_stage = self.do_build('darwin-32')
else:
Expand Down
13 changes: 0 additions & 13 deletions packages/gtk-quartz-engine.py

This file was deleted.

13 changes: 12 additions & 1 deletion packages/libtiff.py
Expand Up @@ -7,7 +7,18 @@ def __init__(self):
sources=[
'http://download.osgeo.org/libtiff/tiff-%{version}.tar.gz',
])
self.sources.extend([
'patches/tiff/patch-tiffconf.diff',
'patches/tiff/patch-tif_config.diff'
])

self.needs_lipo = True
def build(self):
if Package.profile.name == 'darwin':
Package.configure(self)
for p in range(1, len(self.local_sources)):
self.sh('patch -p0 < "%{local_sources[' + str(p) + ']}"')
Package.make(self)
else:
Package.build(self)

LibTiffPackage()
81 changes: 81 additions & 0 deletions packages/patches/tiff/patch-tif_config.diff
@@ -0,0 +1,81 @@
--- libtiff/tif_config.h.orig 2019-08-29 15:36:35.000000000 +0200
+++ libtiff/tif_config.h 2019-08-29 15:08:43.000000000 +0200
@@ -255,7 +255,11 @@
#define SIZEOF_SIGNED_INT 4

/* The size of `signed long', as computed by sizeof. */
+#ifdef __LP64__
#define SIZEOF_SIGNED_LONG 8
+#else
+#define SIZEOF_SIGNED_LONG 4
+#endif

/* The size of `signed long long', as computed by sizeof. */
#define SIZEOF_SIGNED_LONG_LONG 8
@@ -264,16 +268,28 @@
#define SIZEOF_SIGNED_SHORT 2

/* The size of `size_t', as computed by sizeof. */
+#ifdef __LP64__
#define SIZEOF_SIZE_T 8
+#else
+#define SIZEOF_SIZE_T 4
+#endif

/* The size of `unsigned char *', as computed by sizeof. */
+#ifdef __LP64__
#define SIZEOF_UNSIGNED_CHAR_P 8
+#else
+#define SIZEOF_UNSIGNED_CHAR_P 4
+#endif

/* The size of `unsigned int', as computed by sizeof. */
#define SIZEOF_UNSIGNED_INT 4

/* The size of `unsigned long', as computed by sizeof. */
+#ifdef __LP64__
#define SIZEOF_UNSIGNED_LONG 8
+#else
+#define SIZEOF_UNSIGNED_LONG 4
+#endif

/* The size of `unsigned long long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG_LONG 8
@@ -307,10 +323,18 @@
#define TIFF_INT32_T signed int

/* Signed 64-bit type formatter */
+#ifdef __LP64__
#define TIFF_INT64_FORMAT "%ld"
+#else
+#define TIFF_INT64_FORMAT "%lld"
+#endif

/* Signed 64-bit type */
+#ifdef __LP64__
#define TIFF_INT64_T signed long
+#else
+#define TIFF_INT64_T signed long long
+#endif

/* Signed 8-bit type */
#define TIFF_INT8_T signed char
@@ -343,10 +367,18 @@
#define TIFF_UINT32_T unsigned int

/* Unsigned 64-bit type formatter */
+#ifdef __LP64__
#define TIFF_UINT64_FORMAT "%lu"
+#else
+#define TIFF_UINT64_FORMAT "%llu"
+#endif

/* Unsigned 64-bit type */
+#ifdef __LP64__
#define TIFF_UINT64_T unsigned long
+#else
+#define TIFF_UINT64_T unsigned long long
+#endif

/* Unsigned 8-bit type */
#define TIFF_UINT8_T unsigned char
26 changes: 26 additions & 0 deletions packages/patches/tiff/patch-tiffconf.diff
@@ -0,0 +1,26 @@
--- libtiff/tiffconf.h.orig 2019-08-29 15:37:19.000000000 +0200
+++ libtiff/tiffconf.h 2019-08-29 15:38:25.000000000 +0200
@@ -15,7 +15,11 @@
#define TIFF_INT32_T signed int

/* Signed 64-bit type */
+#ifdef __LP64__
#define TIFF_INT64_T signed long
+#else
+#define TIFF_INT64_T signed long long
+#endif

/* Signed 8-bit type */
#define TIFF_INT8_T signed char
@@ -27,7 +31,11 @@
#define TIFF_UINT32_T unsigned int

/* Unsigned 64-bit type */
+#ifdef __LP64__
#define TIFF_UINT64_T unsigned long
+#else
+#define TIFF_UINT64_T unsigned long long
+#endif

/* Unsigned 8-bit type */
#define TIFF_UINT8_T unsigned char
3 changes: 2 additions & 1 deletion packages/pkg-config.py
@@ -1,4 +1,5 @@
package = FreeDesktopPackage('%{name}', 'pkg-config', '0.27',
configure_flags=["--with-internal-glib"])

package.needs_lipo = True
if package.profile.name == 'darwin':
package.m64_only = True

0 comments on commit 4693825

Please sign in to comment.