diff --git a/win32libs/glib/disable-docs-tests.diff b/win32libs/glib/disable-docs-tests.diff new file mode 100644 index 00000000..012cde17 --- /dev/null +++ b/win32libs/glib/disable-docs-tests.diff @@ -0,0 +1,59 @@ +diff -Nrub -x '*~' -x '*\.rej' -x '*\.orig' -x'*\.o' -x '*\.pyc' glib-2.49.4.orig/Makefile.in glib-2.49.4/Makefile.in +--- glib-2.49.4.orig/Makefile.in 2016-07-21 02:54:00.000000000 +0200 ++++ glib-2.49.4/Makefile.in 2018-03-15 00:52:46.000000000 +0100 +@@ -834,7 +834,7 @@ + + @ENABLE_INSTALLED_TESTS_TRUE@installed_test_meta_DATA = $(installed_testcases:=.test) + ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS} +-SUBDIRS = . m4macros glib gmodule gthread gobject gio po docs tests ++SUBDIRS = . m4macros glib gmodule gthread gobject gio po + DIST_SUBDIRS = $(SUBDIRS) build + bin_SCRIPTS = glib-gettextize + AM_CPPFLAGS = \ +diff -Nrub -x '*~' -x '*\.rej' -x '*\.orig' -x'*\.o' -x '*\.pyc' glib-2.49.4.orig/gio/Makefile.in glib-2.49.4/gio/Makefile.in +--- glib-2.49.4.orig/gio/Makefile.in 2016-07-21 02:54:01.000000000 +0200 ++++ glib-2.49.4/gio/Makefile.in 2018-03-15 00:53:12.000000000 +0100 +@@ -912,7 +912,7 @@ + *) \ + b='$*';; \ + esac +-DIST_SUBDIRS = gdbus-2.0/codegen xdgmime inotify kqueue win32 . tests \ ++DIST_SUBDIRS = gdbus-2.0/codegen xdgmime inotify kqueue win32 . \ + fam + am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/gio.rc.in \ + $(srcdir)/gnetworking.h.in \ +@@ -1296,7 +1296,7 @@ + + @ENABLE_INSTALLED_TESTS_TRUE@installed_test_meta_DATA = $(installed_testcases:=.test) + SUBDIRS = gdbus-2.0/codegen $(am__append_15) $(am__append_19) \ +- $(am__append_22) $(am__append_25) . tests $(am__append_28) ++ $(am__append_22) $(am__append_25) . $(am__append_28) + @MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@install_ms_lib_cmd = $(INSTALL) gio-2.0.lib $(DESTDIR)$(libdir) + @MS_LIB_AVAILABLE_TRUE@@OS_WIN32_AND_DLL_COMPILATION_TRUE@uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gio-2.0.lib + AM_CPPFLAGS = \ +diff -Nrub -x '*~' -x '*\.rej' -x '*\.orig' -x'*\.o' -x '*\.pyc' glib-2.49.4.orig/glib/Makefile.in glib-2.49.4/glib/Makefile.in +--- glib-2.49.4.orig/glib/Makefile.in 2016-07-21 02:54:02.000000000 +0200 ++++ glib-2.49.4/glib/Makefile.in 2018-03-15 00:53:40.000000000 +0100 +@@ -1008,8 +1008,8 @@ + @HAVE_GOOD_PRINTF_FALSE@PRINTF_SUBDIR = gnulib + @HAVE_GOOD_PRINTF_FALSE@printf_la = gnulib/libgnulib.la + @USE_SYSTEM_PCRE_FALSE@MAYBE_PCRE = pcre +-SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests +-DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests ++SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . ++DIST_SUBDIRS = libcharset gnulib pcre update-pcre + AM_CPPFLAGS = \ + $(glib_INCLUDES) \ + $(pcre_inc) \ +diff -Nrub -x '*~' -x '*\.rej' -x '*\.orig' -x'*\.o' -x '*\.pyc' glib-2.49.4.orig/gobject/Makefile.in glib-2.49.4/gobject/Makefile.in +--- glib-2.49.4.orig/gobject/Makefile.in 2016-07-21 02:54:04.000000000 +0200 ++++ glib-2.49.4/gobject/Makefile.in 2018-03-15 00:54:09.000000000 +0100 +@@ -892,7 +892,7 @@ + # GObject - GLib Type, Object, Parameter and Signal Library + # Copyright (C) 1997,98,99,2000 Tim Janik and Red Hat, Inc. + # +-SUBDIRS = . tests ++SUBDIRS = . + AM_CPPFLAGS = \ + -DG_LOG_DOMAIN=\"GLib-GObject\" \ + $(glib_INCLUDES) \ diff --git a/win32libs/glib/glib.py b/win32libs/glib/glib.py index 4bdafdd2..4ca9e61b 100644 --- a/win32libs/glib/glib.py +++ b/win32libs/glib/glib.py @@ -1,76 +1,95 @@ import info from Package.MSBuildPackageBase import MSBuildPackageBase class subinfo(info.infoclass): def setTargets(self): for ver in ["2.49.4"]: - self.targets[ver] = "https://github.com/winlibs/glib/archive/glib-%s.tar.gz" % ver - self.archiveNames[ver] = "glib-glib%s.tar.gz" % ver - self.targetInstSrc[ver] = "glib-glib-%s" % ver - self.patchToApply[ver] = [("glib-glib-2.49.4-20161114.diff", 1), + if OsUtils.isWin(): + self.targets[ver] = f"https://github.com/winlibs/glib/archive/glib-{ver}.tar.gz" + self.archiveNames[ver] = f"glib-glib{ver}.tar.gz" + self.targetInstSrc[ver] = f"glib-glib-{ver}" + else: + majorMinorStr = '.'.join(ver.split('.')[0:2]) + self.targets[ver] = f"https://ftp.gnome.org/pub/gnome/sources/glib/{majorMinorStr}/glib-{ver}.tar.xz" + self.targetInstSrc[ver] = f"glib-{ver}" + + if OsUtils.isWin(): + self.patchToApply['2.49.4'] = [("glib-glib-2.49.4-20161114.diff", 1), ("fix-libname.diff", 1)] - self.targetDigests['2.49.4'] = (['936e124d1d147226acd95def54cb1bea5d19dfc534532b85de6727fa68bc310f'], CraftHash.HashAlgorithm.SHA256) + self.targetDigests['2.49.4'] = (['936e124d1d147226acd95def54cb1bea5d19dfc534532b85de6727fa68bc310f'], CraftHash.HashAlgorithm.SHA256) + else: + self.patchToApply['2.49.4'] = [("disable-docs-tests.diff", 1)] + self.targetDigests['2.49.4'] = (['9e914f9d7ebb88f99f234a7633368a7c1133ea21b5cac9db2a33bc25f7a0e0d1'], CraftHash.HashAlgorithm.SHA256) self.defaultTarget = "2.49.4" def setDependencies(self): self.buildDependencies["virtual/base"] = "default" self.runtimeDependencies["win32libs/libffi"] = "default" self.runtimeDependencies["win32libs/pcre"] = "default" self.runtimeDependencies["win32libs/zlib"] = "default" self.runtimeDependencies["win32libs/gettext"] = "default" if CraftCore.compiler.isMinGW(): self.buildDependencies["dev-util/msys"] = "default" class PackageCMake(MSBuildPackageBase): def __init__(self, **args): MSBuildPackageBase.__init__(self) self.toolset = "vs14" self.subinfo.options.configure.args = "/p:useenv=true" self.subinfo.options.configure.projectFile = \ os.path.join(self.sourceDir(), "build", "win32", self.toolset, "glib.sln") def make(self): with utils.ScopedEnv({ "LIB" : f"{os.environ['LIB']};{os.path.join(CraftStandardDirs.craftRoot() , 'lib')}", "INCLUDE" : f"{os.environ['INCLUDE']};{os.path.join(CraftStandardDirs.craftRoot() , 'include')}"}): return MSBuildPackageBase.make(self) def install(self): self.cleanImage() arch = "win32" if CraftCore.compiler.isX64(): arch = "x64" utils.mergeTree( os.path.join(self.sourceDir(), "..", self.toolset, arch, "lib", "glib-2.0", "include"), os.path.join(self.sourceDir(), "..", self.toolset, arch, "include", "glib-2.0")) utils.copyDir(os.path.join(self.sourceDir(), "..", self.toolset, arch), self.imageDir(), False) return True from Package.AutoToolsPackageBase import * -class PackageMSys(AutoToolsPackageBase): +class PackageAutoTools(AutoToolsPackageBase): def __init__(self): AutoToolsPackageBase.__init__(self) - self.subinfo.options.configure.args = "--enable-shared --disable-static --with-pcre=internal" + + def configure(self): + root = self.shell.toNativePath(CraftCore.standardDirs.craftRoot()) + + with utils.ScopedEnv({ + "LIBFFI_LIBS" : f"-L{os.path.join(root, 'lib')} -lffi", + "LIBFFI_CFLAGS" : f"-I{os.path.join(root, 'include', 'libffi')}"}): + self.subinfo.options.configure.cflags = "-Wno-format-nonliteral" + self.subinfo.options.configure.args = "--enable-shared --disable-static --with-pcre=internal" + return AutoToolsPackageBase.configure(self) def install(self): if not AutoToolsBuildSystem.install(self): return False utils.copyFile(os.path.join(self.buildDir(), "glib", "glibconfig.h"), os.path.join(self.imageDir(), "include", "glib-2.0", "glibconfig.h"), False) return True -if CraftCore.compiler.isMinGW(): - class Package(PackageMSys): +if OsUtils.isWin() and CraftCore.compiler.isMinGW(): + class Package(PackageCMake): pass else: - class Package(PackageCMake): + class Package(PackageAutoTools): pass