diff --git a/NuGet/Readme.md b/NuGet/Readme.md index a9764bdb9..3c34a23c0 100644 --- a/NuGet/Readme.md +++ b/NuGet/Readme.md @@ -25,7 +25,7 @@ pacman -S mingw-w64-x86_64-pango mingw-w64-x86_64-atk mingw-w64-x86_64-gtk3 And installed the executor python module ``` -C:\Python35\Scripts\pip.exe install executor +C:\Python35\Scripts\pip.exe install executor yattag vsgen ``` ### Running Build @@ -48,7 +48,7 @@ sudo apt-get install libglib2.0-dev libpango1.0-dev libatk1.0-dev libgtk-3-dev Then install the executor python module ``` -pip3 install executor +pip3 install executor yattag vsgen ``` The version of Nuget needs to be the latest for linux diff --git a/NuGet/build.py b/NuGet/build.py index 0fbb81679..3ba9363bb 100644 --- a/NuGet/build.py +++ b/NuGet/build.py @@ -1,21 +1,20 @@ #!/usr/bin/python3 """Script to build out the .Net dll's and package them into a Nuget Package for gtksharp3""" import os, sys -from pybuild.GtkSharp_Builder import GtkSharp_Builder -from pybuild.Gtk_Builder import Gtk_Builder -from pybuild.Helper import Helper as helpers +from pybuild.profiles.GtkSharp import GtkSharp +from pybuild.profiles.GtkSharp_Core import GtkSharp_Core +from pybuild.profiles.Glue_Win32 import Glue_Win32 +from pybuild.profiles.Glue_Win64 import Glue_Win64 +from pybuild.profiles.Gtk_Win32 import Gtk_Win32 +from pybuild.profiles.Gtk_Win64 import Gtk_Win64 -# Ideally I'd like to see the GtkSharp Build system redone via .Net Core or something other than make +# Ideally I'd like to see the GtkSharp Build system redone via the build system of .Net core (dotnet cli tool) +# and using Scons / Cuppa for the glue libraries # For now though we rely on the use of make to build the .Net dll's # under linux we run this natively, under windows we can use MSYS2 class Build(object): - # Class Init - def __init__(self): - self.GtkSharp_Builder = GtkSharp_Builder() - self.Gtk_Builder = Gtk_Builder() - # Clean the Build directory def clean(self): """Clean the build dir""" @@ -26,34 +25,62 @@ class Build(object): def usage(self): print ("Please use GtkSharp3_Build.py where is one of") print (" clean to clean the output directory: ./build") - print (" gtksharp_net45 to build ,Net libs for GtkSharp, via .Net 4.5") - print (" gtksharp_nuget_net45 to build Nuget Packages for GtkSharp, via .Net 4.5") - print (" gtk_nuget_win32 to build the Nuget package for GtkSharp.Win32") - print (" gtk_nuget_win64 to build the Nuget package for GtkSharp.Win64") - print (" all to make all") + + print (" gtksharp to build .Net libs for GtkSharp, via .Net 4.5") + print (" gtksharp_core to build .Net libs for GtkSharp, via .Net 4.5 using the dotnet cli tool") + + print (" gtk_win32 to build the Nuget package for GtkSharp.Win32") + print (" gtk_win64 to build the Nuget package for GtkSharp.Win64") + print (" all to make all") def main(self): if len(sys.argv) != 2: self.usage() return - if sys.argv[1] == "gtksharp_net45": - self.GtkSharp_Builder.build_net45() - if sys.argv[1] == "gtksharp_nuget_net45": - self.GtkSharp_Builder.build_nuget_net45() - if sys.argv[1] == "gtk_nuget_win32": - self.Gtk_Builder.build_nuget_win32() - if sys.argv[1] == "gtk_nuget_win64": - self.Gtk_Builder.build_nuget_win64() + if sys.argv[1] == 'all': + self.runbuild('gtksharp') + self.runbuild('gtk_win32') + self.runbuild('gtk_win64') + return - if sys.argv[1] == "all": - self.GtkSharp_Builder.build_net45() - self.GtkSharp_Builder.build_nuget_net45() - self.Gtk_Builder.build_nuget_win32() - self.Gtk_Builder.build_nuget_win64() + self.runbuild(sys.argv[1]) - if sys.argv[1] == "clean": + + def runbuild(self, build_type): + + if build_type == 'clean': self.clean() + elif build_type == 'gtksharp': + profile = GtkSharp() + profile.clean() + profile.build() + profile.copy() + profile.build_nuget() + + elif build_type == 'gtksharp_core': + profile = GtkSharp_Core() + profile.clean() + profile.build() + profile.copy_dll() + profile.build_nuget() + + elif build_type == 'gtk_win32': + profile_glue = Glue_Win32() + profile_glue.clean() + profile_glue.build() + profile_gtk = Gtk_Win32() + profile_gtk.build() + profile_gtk.build_nuget() + + elif build_type == 'gtk_win64': + profile_glue = Glue_Win64() + profile_glue.clean() + profile_glue.build() + profile = Gtk_Win64() + profile.build() + profile.build_nuget() + if __name__ == "__main__": Build().main() diff --git a/NuGet/misc/GtkSharp.nuspec b/NuGet/misc/GtkSharp.nuspec index 3583ea169..70cc70bee 100644 --- a/NuGet/misc/GtkSharp.nuspec +++ b/NuGet/misc/GtkSharp.nuspec @@ -3,7 +3,7 @@ GBD.GtkSharp 3.22.0 - Ric Westell + Grbd grbd https://github.com/mono/gtk-sharp/blob/master/COPYING https://github.com/mono/gtk-sharp diff --git a/NuGet/pybuild/GtkSharp_Builder.py b/NuGet/pybuild/GtkSharp_Builder.py deleted file mode 100644 index 62d8f47f7..000000000 --- a/NuGet/pybuild/GtkSharp_Builder.py +++ /dev/null @@ -1,85 +0,0 @@ -#! python3 -import os, shutil -from pybuild.Settings import Settings -from pybuild.Helper import Helper as helpers -from os.path import join -from xml.etree import ElementTree as et - -class GtkSharp_Builder(object): - - def __init__(self): - """Class Init""" - self.setts = Settings() - - def clean(self): - """Clean the build dir""" - helpers.emptydir('./build') - print ("Clean finished") - - def build_net45(self): - """Build the gtksharp binaries for .Net 4.5""" - self.clean() - os.makedirs(self.setts.BuildDir, exist_ok=True) - buildfile = join(self.setts.BuildDir, 'net45_build.sh') - - # run script via MSYS for windows, or shell for linux - if os.name == 'nt': - print("Building .Net GtkSharp using MSYS2") - with open(buildfile, 'w') as f: - f.write('PATH=$PATH:/c/Program\ Files\ \(x86\)/Microsoft\ SDKs/Windows/v10.0A/bin/NETFX\ 4.6\ Tools/\n') - f.write('PATH=$PATH:/c/Windows/Microsoft.NET/Framework/v4.0.30319/\n') - f.write('cd ' + helpers.winpath_to_msyspath(self.setts.SrcDir + '\n')) - f.write('./autogen.sh --prefix=/tmp/install\n') - f.write('make clean\n') - f.write('make\n') - cmds = [join(self.setts.msys2path, 'usr\\bin\\bash.exe'), '--login', buildfile] - cmd = helpers.run_cmd(cmds, self.setts.SrcDir) - - else: - print("Building using Linux shell") - with open(buildfile, 'w') as f: - f.write('cd ' + self.setts.SrcDir + '\n') - f.write('./autogen.sh --prefix=/tmp/install\n') - f.write('make clean\n') - f.write('make\n') - cmds = [self.setts.bashpath, buildfile] - cmd = helpers.run_cmd(cmds, self.setts.SrcDir) - - def build_nuget_net45(self): - """Package up a nuget file based on the default build""" - self.clean() - net45_build_dir = join(self.setts.BuildDir, 'build', 'net45') - net45_lib_dir = join(self.setts.BuildDir, 'lib', 'net45') - GtkVersion = helpers.get_gtksharp_version(self.setts.SrcDir) - - os.makedirs(self.setts.BuildDir, exist_ok=True) - os.makedirs(net45_build_dir, exist_ok=True) - os.makedirs(net45_lib_dir, exist_ok=True) - - print ('Copying Files') - shutil.copy('./misc/GtkSharp.nuspec', self.setts.BuildDir) - shutil.copy('./misc/GtkSharp.targets', net45_build_dir) - - dll_list = ['atk', 'cairo', 'gdk', 'gio', 'glib', 'gtk', 'pango'] - for item in dll_list: - shutil.copy(join(self.setts.SrcDir, item, item + "-sharp.dll"), net45_lib_dir) - if item != 'cairo': - shutil.copy(join(self.setts.SrcDir, item, item + '-sharp.dll.config'), net45_build_dir) - - # Edit the XML version / package name in the .nuspec file - nuspecfile = join(self.setts.BuildDir, 'GtkSharp.nuspec') - et.register_namespace('', 'http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd') - tree = et.parse(nuspecfile) - xmlns = {'nuspec': '{http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd}'} - tree.find('.//{nuspec}version'.format(**xmlns)).text = GtkVersion - tree.find('.//{nuspec}id'.format(**xmlns)).text = self.setts.Gtksharp_PackageName - tree.write(nuspecfile) - - # Run Nuget - helpers.run_cmd([self.setts.NuGetExe, 'pack', 'GtkSharp.nuspec'], self.setts.BuildDir) - - nugetfile = join(self.setts.BuildDir, self.setts.Gtksharp_PackageName + '.' + GtkVersion + '.nupkg') - os.makedirs(self.setts.NugetPkgs, exist_ok=True) - shutil.copy(nugetfile, self.setts.NugetPkgs) - - print ('Generation of Nuget package complete') diff --git a/NuGet/pybuild/Gtk_Builder.py b/NuGet/pybuild/Gtk_Builder.py deleted file mode 100644 index a549835ba..000000000 --- a/NuGet/pybuild/Gtk_Builder.py +++ /dev/null @@ -1,77 +0,0 @@ -#! python3 -import os, shutil -from pybuild.Settings import Settings -from pybuild.Helper import Helper as helpers -from os.path import join -from xml.etree import ElementTree as et - -# This script assumes the gtk libraries have already been installed via MSYS2 / MinGW32 / MinGW64 - -class Gtk_Builder(object): - - def __init__(self): - """Class Init""" - self.setts = Settings() - - def clean(self): - """Clean the build dir""" - helpers.emptydir('./build') - print ("Clean finished") - - def build_nuget_win32(self): - self.build_nuget('Win32') - - def build_nuget_win64(self): - self.build_nuget('Win64') - - def build_nuget(self, arch): - """Package up a nuget file based on the default build""" - - if os.name != 'nt': - print("Skipping Native Nuget package build, as this needs to be run on Windows") - return - - self.clean() - net45_build_dir = join(self.setts.BuildDir, 'build', 'net45') - if arch == 'Win32': - mingwdir = self.setts.mingwin32path - else: - mingwdir = self.setts.mingwin64path - - os.makedirs(self.setts.BuildDir, exist_ok=True) - os.makedirs(net45_build_dir, exist_ok=True) - - print ('Copying Files') - shutil.copy('./misc/GtkSharp.nuspec', self.setts.BuildDir) - shutil.copy('./misc/GtkSharp.Native.targets', join(net45_build_dir, 'GtkSharp.' + arch + '.targets')) - - # Copy dlls - dll_list = [] - dll_list += self.setts.get_native_win_dlls() - dll_list += self.setts.get_native_win_deps() - - for item in dll_list: - src = join(mingwdir, item) - helpers.copy_files(src, net45_build_dir) - - # Get version - GtkVersion = helpers.get_gtk_version(self.setts.msys2path) - - # Edit the XML version / package name in the .nuspec file - nuspecfile = join(self.setts.BuildDir, 'GtkSharp.nuspec') - et.register_namespace('', 'http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd') - tree = et.parse(nuspecfile) - xmlns = {'nuspec': '{http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd}'} - tree.find('.//{nuspec}version'.format(**xmlns)).text = GtkVersion - tree.find('.//{nuspec}id'.format(**xmlns)).text = self.setts.Gtksharp_PackageName + '.' + arch - tree.write(nuspecfile) - - # Run Nuget - helpers.run_cmd([self.setts.NuGetExe, 'pack', 'GtkSharp.nuspec'], self.setts.BuildDir) - - nugetfile = join(self.setts.BuildDir, self.setts.Gtksharp_PackageName + '.' + arch + '.' + GtkVersion + '.nupkg') - os.makedirs(self.setts.NugetPkgs, exist_ok=True) - shutil.copy(nugetfile, self.setts.NugetPkgs) - - print ('Generation of Nuget package complete') - diff --git a/NuGet/pybuild/Helper.py b/NuGet/pybuild/Helper.py index 32313de64..f54e51e85 100644 --- a/NuGet/pybuild/Helper.py +++ b/NuGet/pybuild/Helper.py @@ -1,4 +1,4 @@ -#! python3 +#!/usr/bin/python3 """Helper Functions""" import os, subprocess, shutil, sys @@ -57,7 +57,7 @@ class Helper(object): break return ret - def get_gtk_version(msyspath): + def get_gtk_version_msys(msyspath): ret = '' pacman_path = join(msyspath, 'usr\\bin\\pacman.exe') # pull version from msys2 / pacman @@ -72,7 +72,3 @@ class Helper(object): ret = ret[:-2] break return ret - - def copy_files(src_glob, dst_folder): - for fname in iglob(src_glob): - shutil.copy(fname, join(dst_folder, ntpath.basename(fname))) \ No newline at end of file diff --git a/NuGet/pybuild/ProfileBase.py b/NuGet/pybuild/ProfileBase.py new file mode 100644 index 000000000..317f3c062 --- /dev/null +++ b/NuGet/pybuild/ProfileBase.py @@ -0,0 +1,87 @@ +#!/usr/bin/python3 +"""Base class for Settings profiles""" + +import os, shutil +from os.path import abspath, join +from xml.etree import ElementTree as et +from pybuild.Helper import Helper + +class ProfileBase(object): + + def __init__(self): + """Class Init""" + self._NuGetPath = 'nuget.exe' + self._SrcDir = '../' + self._BuildDir = './build' + self._PackageDestination = './nupkg' + self._NuGet_PackageName = '' + self._MsysPath = 'C:\\msys64' + self._LinuxBashPath = '/bin/bash' + self._Version = '0.0.0' + + @property + def NuGetPath(self): + return self._NuGetPath + + @property + def SrcDir(self): + return abspath(self._SrcDir) + + @property + def BuildDir(self): + return abspath(self._BuildDir) + + @property + def Build_NugetDir(self): + return abspath(join(self._BuildDir, 'nuget')) + + @property + def PackageDestination(self): + return abspath(self._PackageDestination) + + @property + def NuGet_PackageName(self): + return self._NuGet_PackageName + + @property + def MsysPath(self): + return abspath(self._MsysPath) + + @property + def LinuxBashPath(self): + return abspath(self._LinuxBashPath) + + @property + def Version(self): + return self._Version + + + def clean(self): + """Clean the build dir""" + Helper.emptydir('./build') + print ("Clean finished") + + + def build_nuget(self): + """Package up a nuget file based on the default build""" + + # Copy Nuget Spec file + shutil.copy('./misc/GtkSharp.nuspec', self.Build_NugetDir) + + # Edit the XML version / package name in the .nuspec file + nuspecfile = join(self.Build_NugetDir, 'GtkSharp.nuspec') + et.register_namespace('', 'http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd') + tree = et.parse(nuspecfile) + xmlns = {'nuspec': '{http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd}'} + tree.find('.//{nuspec}version'.format(**xmlns)).text = self.Version + tree.find('.//{nuspec}id'.format(**xmlns)).text = self.NuGet_PackageName + tree.write(nuspecfile) + + # Run Nuget + Helper.run_cmd([self.NuGetPath, 'pack', 'GtkSharp.nuspec'], self.Build_NugetDir) + + # Copy Nuget files out of build directory + nugetfile = join(self.Build_NugetDir, self.NuGet_PackageName + '.' + self.Version + '.nupkg') + os.makedirs(self.PackageDestination, exist_ok=True) + shutil.copy(nugetfile, self.PackageDestination) + print ('Generation of Nuget package complete - ' + self.NuGet_PackageName) diff --git a/NuGet/pybuild/Settings.py b/NuGet/pybuild/Settings.py deleted file mode 100644 index 79a7d1860..000000000 --- a/NuGet/pybuild/Settings.py +++ /dev/null @@ -1,80 +0,0 @@ -#! python3 -"""Settings for scripts""" - -import os - -class Settings(object): - - def __init__(self): - """Class Init""" - - self.NuGetExe = 'nuget.exe' - self.Gtksharp_PackageName = 'GBD.GtkSharp' - - self.SrcDir = '../' - self.BuildDir = './build' - self.NugetPkgs = './nupkg' - self.SrcDir = os.path.abspath(self.SrcDir) - self.BuildDir = os.path.abspath(self.BuildDir) - self.NugetPkgs = os.path.abspath(self.NugetPkgs) - - self.msys2path = 'C:\\msys64' - self.msys2path = os.path.abspath(self.msys2path) - self.bashpath = '/bin/bash' - - self.mingwin32path = 'C:\\msys64\\mingw32\\bin' - self.mingwin32path = os.path.abspath(self.mingwin32path) - self.mingwin64path = 'C:\\msys64\\mingw64\\bin' - self.mingwin64path = os.path.abspath(self.mingwin64path) - - def get_native_win_dlls(self): - ret = [] - - # Gtk - ret.append('libgtk-3-0.dll') - ret.append('libgdk-3-0.dll') - - # atk - ret.append('libatk-1.0-0.dll') - - # cairo - ret.append('libcairo-2.dll') - ret.append('libcairo-gobject-2.dll') - - # gdk-pixbuf - ret.append('libgdk_pixbuf-2.0-0.dll') - - # glib2 - ret.append('libgio-2.0-0.dll') - ret.append('libglib-2.0-0.dll') - ret.append('libgmodule-2.0-0.dll') - ret.append('libgobject-2.0-0.dll') - - # pango - ret.append('libpango-1.0-0.dll') - ret.append('libpangocairo-1.0-0.dll') - ret.append('libpangoft2-1.0-0.dll') - ret.append('libpangowin32-1.0-0.dll') - return ret - - def get_native_win_deps(self): - ret = [] - # Determined by using PE Explorer - ret.append('libgcc_*.dll') - ret.append('libepoxy-0.dll') - ret.append('libintl-8.dll') - ret.append('libwinpthread-1.dll') - ret.append('libiconv-2.dll') - ret.append('libfontconfig-1.dll') - ret.append('libexpat-1.dll') - ret.append('libfreetype-6.dll') - ret.append('libpixman-1-0.dll') - ret.append('libpng16-16.dll') - ret.append('zlib1.dll') - ret.append('libpcre-1.dll') - ret.append('libffi-6.dll') - ret.append('libharfbuzz-0.dll') - ret.append('libgraphite2.dll') - ret.append('libstdc++-6.dll') - ret.append('libbz2-1.dll') - return ret \ No newline at end of file diff --git a/NuGet/pybuild/profiles/Glue_Win32.py b/NuGet/pybuild/profiles/Glue_Win32.py new file mode 100644 index 000000000..5fa72f141 --- /dev/null +++ b/NuGet/pybuild/profiles/Glue_Win32.py @@ -0,0 +1,51 @@ +#!/usr/bin/python3 + +import os, shutil, ntpath +from pybuild.ProfileBase import ProfileBase +from os.path import abspath, join +from glob import glob +from pybuild.Helper import Helper +from pybuild.profiles.GtkSharp import GtkSharp + +class Glue_Win32(ProfileBase): + + def __init__(self): + """Class Init""" + super().__init__() + self._NuGet_PackageName = 'GtkSharp.Win32.Glue' + self._Version = Helper.get_gtksharp_version(self.SrcDir) + self.MSYSTEM = 'MINGW32' + + def Get_Dlls_GtkSharp_Glue(self): + ret = [] + + # Gtksharp Glue libs + ret.append(['atk/glue/.libs/*atksharpglue-3.dll', 'atksharpglue-3.dl_']) + ret.append(['pango/glue/.libs/*pangosharpglue-3.dll', 'pangosharpglue-3.dl_']) + ret.append(['gio/glue/.libs/*giosharpglue-3.dll', 'giosharpglue-3.dl_']) + ret.append(['gtk/glue/.libs/*gtksharpglue-3.dll', 'gtksharpglue-3.dl_']) + return ret + + def build(self): + """Package up a nuget file based on the default build""" + + if os.name != 'nt': + print("Skipping Native Nuget package build, as this needs to be run on Windows") + return + + # Trigger build of gtksharp with specific bash for Mingw32 + builder = GtkSharp() + builder.MSYSTEM = self.MSYSTEM + builder.build() + + net45_build_dir = join(self.Build_NugetDir, 'build', 'net45') + os.makedirs(net45_build_dir, exist_ok=True) + + print ('Copying Files') + dll_list = self.Get_Dlls_GtkSharp_Glue() + + for item in dll_list: + src = glob(abspath(join(self.SrcDir, item[0])))[0] + f_basename, f_extension = os.path.splitext(ntpath.basename(src)) + dest = join(net45_build_dir, item[1]) + shutil.copy(src, dest) diff --git a/NuGet/pybuild/profiles/Glue_Win64.py b/NuGet/pybuild/profiles/Glue_Win64.py new file mode 100644 index 000000000..74938ac9f --- /dev/null +++ b/NuGet/pybuild/profiles/Glue_Win64.py @@ -0,0 +1,14 @@ +#!/usr/bin/python3 + +from pybuild.ProfileBase import ProfileBase +from pybuild.Helper import Helper +from pybuild.profiles.Glue_Win32 import Glue_Win32 + +class Glue_Win64(Glue_Win32): + + def __init__(self): + """Class Init""" + super().__init__() + self._NuGet_PackageName = 'GtkSharp.Win64.Glue' + self._Version = Helper.get_gtksharp_version(self.SrcDir) + self.MSYSTEM = 'MINGW64' diff --git a/NuGet/pybuild/profiles/GtkSharp.py b/NuGet/pybuild/profiles/GtkSharp.py new file mode 100644 index 000000000..f1a193e75 --- /dev/null +++ b/NuGet/pybuild/profiles/GtkSharp.py @@ -0,0 +1,71 @@ +#!/usr/bin/python3 +import os, shutil +from pybuild.ProfileBase import ProfileBase +from os.path import abspath, join +from pybuild.Helper import Helper + +class GtkSharp(ProfileBase): + + def __init__(self): + """Class Init""" + super().__init__() + self._NuGet_PackageName = 'GtkSharp' + self._Version = Helper.get_gtksharp_version(self.SrcDir) + self.MSYSTEM = 'MINGW64' + + @property + def Build_ScriptDir(self): + return abspath(join(self._BuildDir, 'scripts')) + + def build(self): + """Build the gtksharp binaries for .Net 4.5""" + os.makedirs(self.Build_ScriptDir, exist_ok=True) + buildfile = join(self.Build_ScriptDir, 'net45_build.sh') + buildbatch = join(self.Build_ScriptDir, 'net45_build.bat') + + # run script via MSYS for windows, or shell for linux + if os.name == 'nt': + print("Building .Net GtkSharp using MSYS2") + with open(buildfile, 'w') as f: + f.write('PATH=$PATH:/c/Program\ Files\ \(x86\)/Microsoft\ SDKs/Windows/v10.0A/bin/NETFX\ 4.6\ Tools/\n') + f.write('PATH=$PATH:/c/Windows/Microsoft.NET/Framework/v4.0.30319/\n') + f.write('cd ' + Helper.winpath_to_msyspath(self.SrcDir + '\n')) + f.write('./autogen.sh --prefix=/tmp/install\n') + f.write('make clean\n') + f.write('make\n') + + bashexe = join(self.MsysPath, 'usr\\bin\\bash.exe') + + with open(buildbatch, 'w') as f: + f.write('set MSYSTEM=' + self.MSYSTEM + '\n') + f.write(bashexe + ' --login ' + buildfile) + + cmds = ['C:\Windows\System32\cmd.exe', '/C', buildbatch] + cmd = Helper.run_cmd(cmds, self.SrcDir) + + else: + print("Building using Linux shell") + with open(buildfile, 'w') as f: + f.write('cd ' + self.SrcDir + '\n') + f.write('./autogen.sh --prefix=/tmp/install\n') + f.write('make clean\n') + f.write('make\n') + cmds = [self.LinuxBashPath, buildfile] + cmd = Helper.run_cmd(cmds, self.SrcDir) + + + def copy(self): + """Copy the .Net 4.5 dll's to the build dir""" + + net45_build_dir = join(self.Build_NugetDir, 'build', 'net45') + net45_lib_dir = join(self.Build_NugetDir, 'lib', 'net45') + + os.makedirs(net45_build_dir, exist_ok=True) + os.makedirs(net45_lib_dir, exist_ok=True) + shutil.copy('./misc/GtkSharp.targets', net45_build_dir) + + dll_list = ['atk', 'cairo', 'gdk', 'gio', 'glib', 'gtk', 'pango'] + for item in dll_list: + shutil.copy(join(self.SrcDir, item, item + "-sharp.dll"), net45_lib_dir) + if item != 'cairo': + shutil.copy(join(self.SrcDir, item, item + '-sharp.dll.config'), net45_build_dir) diff --git a/NuGet/pybuild/profiles/GtkSharp_Core.py b/NuGet/pybuild/profiles/GtkSharp_Core.py new file mode 100644 index 000000000..078f376e1 --- /dev/null +++ b/NuGet/pybuild/profiles/GtkSharp_Core.py @@ -0,0 +1,155 @@ +#!/usr/bin/python3 +import os, shutil +from pybuild.ProfileBase import ProfileBase +from pybuild.vsgenext.CoreVSProject import CoreVSProject +from os.path import abspath, join +from pybuild.Helper import Helper +from glob import glob +import vsgen + +# Note at this stage we can't complile GtkSharp using the .Net Core platform libraries, such as netstandard1.6 +# https://docs.microsoft.com/en-us/dotnet/articles/standard/library +# This is due to some small api changes in the platform that the Gtksharp code would need to be adjusted to + +# We can however use the newer dotnet build system specifying the net461 platform +# This is the same set of platform libs under the surface (using mono) but a step in the right direction +# with modernising the build system. One advantage to this newer build system is that we don't need to list all the .cs files +# Within the project files (see generated .xproj file and project.json) + +# TODO look into package for symbols, via NuGet -symbols + +class GtkSharp_Core(ProfileBase): + + def __init__(self): + """Class Init""" + super().__init__() + self._NuGet_PackageName = 'GtkSharp.Core' + self._Version = Helper.get_gtksharp_version(self.SrcDir) + self.Solution = None + self.BuildConfig = 'Release' + + @property + def Build_CoreDir(self): + return abspath(join(self._BuildDir, 'core')) + + @property + def Dotnet_BuildExe(self): + return 'dotnet.exe' + + + def Copy_CS_Files(self, csfiles): + srclist = glob(join(self.SrcDir, csfiles[0])) + destdir = join(self.Build_CoreDir, csfiles[1]) + os.makedirs(destdir, exist_ok=True) + for fname in srclist: + shutil.copy(fname, destdir) + + def SetupProject(self, projname): + proj = CoreVSProject() + proj.Name = projname + proj.RootNamespace=projname + proj.FileName = join(self.Build_CoreDir, projname, projname + '.xproj') + proj.Frameworks = {'net461': {}} + proj.Depends = {} + proj.BuildOptions = { "allowUnsafe": True , "outputName": projname + "-sharp"} + proj.Version = self._Version + self.Solution.Projects.append(proj) + self.Solution.write() + return proj + + def Build_Project(self, proj): + projdir = join(self.Build_CoreDir, proj.Name) + Helper.run_cmd([self.Dotnet_BuildExe, 'restore'], projdir) + Helper.run_cmd([self.Dotnet_BuildExe, 'build', + '--configuration', self.BuildConfig, + '--framework', 'net461', + '--output', join(self.Build_CoreDir, 'build')] + , projdir) + + + def build(self): + """Build the gtksharp binaries for .Net 4.5""" + os.makedirs(self.Build_CoreDir, exist_ok=True) + self.Solution = vsgen.solution.VSGSolution() + self.Solution.FileName = join(self.Build_CoreDir, 'GtkSharp.sln') + + # Build Glib + self.Copy_CS_Files(['glib/*.cs', 'glib/']) + proj = self.SetupProject('glib') + proj.write() + self.Build_Project(proj) + + # Build Gio + self.Copy_CS_Files(['gio/*.cs', 'gio/']) + self.Copy_CS_Files(['gio/generated/GLib/*.cs', 'gio/generated/GLib/']) + proj = self.SetupProject('gio') + proj.Depends = {'glib': self._Version} + proj.write() + self.Build_Project(proj) + + # Build Cairo + self.Copy_CS_Files(['cairo/*.cs', 'cairo/']) + proj = self.SetupProject('cairo') + proj.write() + self.Build_Project(proj) + + # Build Pango + self.Copy_CS_Files(['pango/*.cs', 'pango/']) + self.Copy_CS_Files(['pango/generated/Pango/*.cs', 'pango/generated/Pango/']) + proj = self.SetupProject('pango') + proj.Depends = {'glib': self._Version, + 'cairo': self._Version} + proj.write() + self.Build_Project(proj) + + # Build Atk + self.Copy_CS_Files(['atk/*.cs', 'atk/']) + self.Copy_CS_Files(['atk/generated/Atk/*.cs', 'atk/generated/Atk/']) + proj = self.SetupProject('atk') + proj.Depends = {'glib': self._Version} + proj.write() + self.Build_Project(proj) + + # Build Gdk + self.Copy_CS_Files(['gdk/*.cs', 'gdk/']) + self.Copy_CS_Files(['gdk/generated/Gdk/*.cs', 'gdk/generated/Gdk/']) + self.Copy_CS_Files(['gdk/generated/GLib/*.cs', 'gdk/generated/GLib/']) + proj = self.SetupProject('gdk') + proj.Depends = {'atk': self._Version, + 'cairo': self._Version, + 'gio': self._Version, + 'glib': self._Version, + 'pango': self._Version} + proj.write() + self.Build_Project(proj) + + # Build Gtk + self.Copy_CS_Files(['gtk/*.cs', 'gtk/']) + self.Copy_CS_Files(['gtk/generated/GLib/*.cs', 'gtk/generated/GLib/']) + self.Copy_CS_Files(['gtk/generated/Gtk/*.cs', 'gtk/generated/Gtk/']) + proj = self.SetupProject('gtk') + proj.Depends = {'gdk': self._Version, + 'glib': self._Version} + proj.write() + self.Build_Project(proj) + + + def copy_dll(self): + """Copy the .Net 4.5 dll's to the build dir""" + + net45_build_dir = join(self.Build_NugetDir, 'build', 'net45') + net45_lib_dir = join(self.Build_NugetDir, 'lib', 'net45') + + os.makedirs(net45_build_dir, exist_ok=True) + os.makedirs(net45_lib_dir, exist_ok=True) + shutil.copy('./misc/GtkSharp.targets', net45_build_dir) + + srclist = glob(join(self.Build_CoreDir, 'build', '*.dll')) + for item in srclist: + shutil.copy(item, net45_lib_dir) + + # Get the Config files + dll_list = ['atk', 'cairo', 'gdk', 'gio', 'glib', 'gtk', 'pango'] + for item in dll_list: + if item != 'cairo': + shutil.copy(join(self.SrcDir, item, item + '-sharp.dll.config'), net45_build_dir) \ No newline at end of file diff --git a/NuGet/pybuild/profiles/Gtk_Win32.py b/NuGet/pybuild/profiles/Gtk_Win32.py new file mode 100644 index 000000000..0c4fb1fad --- /dev/null +++ b/NuGet/pybuild/profiles/Gtk_Win32.py @@ -0,0 +1,102 @@ +#!/usr/bin/python3 +"""Build of GTK3 into a NuGet package - Windows 32bit""" + +import os, shutil, ntpath +from pybuild.ProfileBase import ProfileBase +from os.path import abspath, join +from glob import iglob +from pybuild.Helper import Helper + +class Gtk_Win32(ProfileBase): + + def __init__(self): + """Class Init""" + super().__init__() + self._NuGet_PackageName = 'GtkSharp.Win32' + self._MingwBinPath = join(self.MsysPath + '\\mingw32\\bin') + self.arch = 'Win32' + self._Version = Helper.get_gtk_version_msys(self.MsysPath) + + @property + def MingwBinPath(self): + return abspath(self._MingwBinPath) + + + def Get_Dlls_Native_GTK(self): + ret = [] + + # Gtk + ret.append('libgtk-3-0.dll') + ret.append('libgdk-3-0.dll') + + # atk + ret.append('libatk-1.0-0.dll') + + # cairo + ret.append('libcairo-2.dll') + ret.append('libcairo-gobject-2.dll') + + # gdk-pixbuf + ret.append('libgdk_pixbuf-2.0-0.dll') + + # glib2 + ret.append('libgio-2.0-0.dll') + ret.append('libglib-2.0-0.dll') + ret.append('libgmodule-2.0-0.dll') + ret.append('libgobject-2.0-0.dll') + + # pango + ret.append('libpango-1.0-0.dll') + ret.append('libpangocairo-1.0-0.dll') + ret.append('libpangoft2-1.0-0.dll') + ret.append('libpangowin32-1.0-0.dll') + return ret + + def Get_Dlls_Native_GTK_Deps(self): + ret = [] + # Determined by using PE Explorer + ret.append('libgcc_*.dll') + ret.append('libepoxy-0.dll') + ret.append('libintl-8.dll') + ret.append('libwinpthread-1.dll') + ret.append('libiconv-2.dll') + ret.append('libfontconfig-1.dll') + ret.append('libexpat-1.dll') + ret.append('libfreetype-6.dll') + ret.append('libpixman-1-0.dll') + ret.append('libpng16-16.dll') + ret.append('zlib1.dll') + ret.append('libpcre-1.dll') + ret.append('libffi-6.dll') + ret.append('libharfbuzz-0.dll') + ret.append('libgraphite2.dll') + ret.append('libstdc++-6.dll') + ret.append('libbz2-1.dll') + return ret + + + def build(self): + """Package up a nuget file based on the default build""" + + if os.name != 'nt': + print("Skipping Native Nuget package build, as this needs to be run on Windows") + return + + net45_build_dir = join(self.Build_NugetDir, 'build', 'net45') + os.makedirs(net45_build_dir, exist_ok=True) + + print ('Copying Files') + shutil.copy('./misc/GtkSharp.Native.targets', join(net45_build_dir, 'GtkSharp.' + self.arch + '.targets')) + + # Copy dlls + dll_list = [] + dll_list += self.Get_Dlls_Native_GTK() + dll_list += self.Get_Dlls_Native_GTK_Deps() + + for item in dll_list: + src = join(self.MingwBinPath, item) + + srclist = iglob(src) + for fname in srclist: + f_basename, f_extension = os.path.splitext(ntpath.basename(fname)) + shutil.copy(fname, join(net45_build_dir, f_basename + '.dl_')) diff --git a/NuGet/pybuild/profiles/Gtk_Win64.py b/NuGet/pybuild/profiles/Gtk_Win64.py new file mode 100644 index 000000000..998fc8252 --- /dev/null +++ b/NuGet/pybuild/profiles/Gtk_Win64.py @@ -0,0 +1,18 @@ +#!/usr/bin/python3 +"""Build of GTK3 into a NuGet package - Windows 64bit""" + +import os, shutil +from pybuild.ProfileBase import ProfileBase +from os.path import abspath, join +from pybuild.Helper import Helper +from pybuild.profiles.Gtk_Win32 import Gtk_Win32 + +class Gtk_Win64(Gtk_Win32): + + def __init__(self): + """Class Init""" + super().__init__() + self._NuGet_PackageName = 'GtkSharp.Win64' + self._MingwBinPath = join(self.MsysPath + '\\mingw64\\bin') + self.arch = 'Win64' + self._Version = Helper.get_gtk_version_msys(self.MsysPath) diff --git a/NuGet/pybuild/profiles/__init__.py b/NuGet/pybuild/profiles/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/NuGet/pybuild/vsgenext/CoreVSProject.py b/NuGet/pybuild/vsgenext/CoreVSProject.py new file mode 100644 index 000000000..520c0f763 --- /dev/null +++ b/NuGet/pybuild/vsgenext/CoreVSProject.py @@ -0,0 +1,144 @@ +#!/usr/bin/python3 + +import os, json +from vsgen.project import VSGProject +from xml.etree import ElementTree as et +from yattag import indent +from os.path import abspath, join +from collections import OrderedDict + +class CoreVSProject(VSGProject): + """ + CoreVSProject extends :class:`~vsgen.project.VSGProject` with data and logic needed to create a `.xproj` file. + :ivar str TargetFrameworkVersion: The target framework version. + :ivar str BaseIntermediateOutputPath: Intermediate path for building the output. + :ivar str ProjectXml: Override the xml within the .xproj file. + :ivar str ProjectJson: Override the json within the project.lock file. + """ + __project_type__ = 'netcore' + + __writable_name__ = "Visual Studio .Net Core Project" + + __registerable_name__ = "Visual Studio C# Compiler" + + def __init__(self, **kwargs): + """ + Constructor. + :param kwargs: List of arbitrary keyworded arguments to be processed as instance variable data + """ + super(CoreVSProject, self).__init__(**kwargs) + + def _import(self, datadict): + """ + Internal method to import instance variables data from a dictionary + :param dict datadict: The dictionary containing variables values. + """ + super(CoreVSProject, self)._import(datadict) + self.TargetFrameworkVersion = datadict.get('TargetFrameworkVersion', 'v4.6.1') + self.BaseIntermediateOutputPath = datadict.get('BaseIntermediateOutputPath', '.\obj') + self.ProjectXml = datadict.get('ProjectXml', None) + self.ProjectJson = datadict.get('ProjectJson', None) + self.Version = datadict.get('Version', '1.0.0-*') + self.Depends = datadict.get('Depends', {'NETStandard.Library': '1.6.0'}) + self.Frameworks = datadict.get('Frameworks', None) + self.BuildOptions = datadict.get('BuildOptions', None) + + def get_project_json(self): + """ + Get the json for use in Project.lock + """ + + data = OrderedDict() + ver = {'version': self.Version} + data.update(ver) + + depends = self.Depends + depends2 = {'dependencies': depends} + data.update(depends2) + + if self.Frameworks != None: + frameworks = {'frameworks': self.Frameworks} + else: + frameworks = {'frameworks': {'netstandard1.6': {'imports': 'dnxcore50'}}} + data.update(frameworks) + + if self.BuildOptions != None: + buildopts = {'buildOptions': self.BuildOptions} + data.update(buildopts) + + return data + + def get_project_xml(self): + """ + Get the xml for use in the xproj file + """ + + xml_projroot = et.Element('Project') + xml_projroot.set('ToolsVersion', '14.0') + xml_projroot.set('DefaultTargets', 'Build') + xml_projroot.set('xmlns', 'http://schemas.microsoft.com/developer/msbuild/2003') + + propgroup1 = et.SubElement(xml_projroot, 'PropertyGroup') + studiover = et.SubElement(propgroup1, 'VisualStudioVersion') + studiover.set('Condition', "'$(VisualStudioVersion)' == ''") + studiover.text = '14.0' + vstoolspath = et.SubElement(propgroup1, 'VSToolsPath') + vstoolspath.set('Condition', "'$(VSToolsPath)' == ''") + vstoolspath.text = r"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)" + + import1 = et.SubElement(xml_projroot, 'Import') + import1.set('Project', '$(VSToolsPath)\DotNet\Microsoft.DotNet.Props') + import1.set('Condition', "'$(VSToolsPath)' != ''") + + propgroup2 = et.SubElement(xml_projroot, 'PropertyGroup') + propgroup2.set('Label', 'Globals') + projguid = et.SubElement(propgroup2, 'ProjectGuid') + projguid.text = self.lower(self.GUID) + rootnamespace = et.SubElement(propgroup2, 'RootNamespace') + rootnamespace.text = self.RootNamespace + baseintermediateoutputpath = et.SubElement(propgroup2, 'BaseIntermediateOutputPath') + baseintermediateoutputpath.set('Condition', "'$(BaseIntermediateOutputPath)'=='' ") + baseintermediateoutputpath.text = self.BaseIntermediateOutputPath + targetframeworkversion = et.SubElement(propgroup2, 'TargetFrameworkVersion') + targetframeworkversion.text = self.TargetFrameworkVersion + + propgroup3 = et.SubElement(xml_projroot, 'PropertyGroup') + schemaver = et.SubElement(propgroup3, 'SchemaVersion') + schemaver.text = '2.0' + + import2 = et.SubElement(xml_projroot, 'Import') + import2.set('Project', '$(VSToolsPath)\DotNet\Microsoft.DotNet.targets') + import2.set('Condition', "'$(VSToolsPath)' != ''") + + etstr = et.tostring(xml_projroot, encoding='utf-8', method='xml').decode('utf-8') + outtxt = indent(etstr) + return outtxt + + + def write(self): + """ + Creates the project files. + """ + npath = os.path.normpath(self.FileName) + (filepath, filename) = os.path.split(npath) + os.makedirs(filepath, exist_ok=True) + + projectFileName = os.path.normpath(self.FileName) + projxml = '' + if self.ProjectXml == None: + projxml = self.get_project_xml() + else: + projxml = self.ProjectXml + with open(projectFileName, 'wt') as f: + f.write(projxml) + + jsonFileName = join(filepath, 'project.json') + + if self.ProjectJson == None: + projjson = self.get_project_json() + else: + projjson = self.ProjectJson + + with open(jsonFileName, 'w') as f: + txt = json.dumps(projjson, indent=2, separators=(',', ': ')) + f.write(txt) diff --git a/NuGet/pybuild/vsgenext/__init__.py b/NuGet/pybuild/vsgenext/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/NuGet/vs/GtkSharp-NugetBuild/GtkSharp-NugetBuild.pyproj b/NuGet/vs/GtkSharp-NugetBuild/GtkSharp-NugetBuild.pyproj index 262f9bcbe..6a9c1dcc7 100644 --- a/NuGet/vs/GtkSharp-NugetBuild/GtkSharp-NugetBuild.pyproj +++ b/NuGet/vs/GtkSharp-NugetBuild/GtkSharp-NugetBuild.pyproj @@ -7,7 +7,7 @@ ..\..\build.py - ..\..\;..\..\pybuild\ + ..\..\;..\..\pybuild\;..\..\pybuild\vsgen\ ..\..\ . GtkSharp-NugetBuild @@ -38,17 +38,38 @@ build.py - - pybuild\GtkSharp_Builder.py - - - pybuild\Gtk_Builder.py - pybuild\Helper.py - - pybuild\Settings.py + + pybuild\ProfileBase.py + + + pybuild\profiles\Glue_Win32.py + + + pybuild\profiles\Glue_Win64.py + + + pybuild\profiles\GtkSharp.py + + + pybuild\profiles\GtkSharp_Core.py + + + pybuild\profiles\Gtk_Win32.py + + + pybuild\profiles\Gtk_Win64.py + + + pybuild\profiles\__init__.py + + + pybuild\vsgenext\CoreVSProject.py + + + pybuild\vsgenext\__init__.py pybuild\__init__.py @@ -56,6 +77,8 @@ + + diff --git a/configure.ac b/configure.ac index d3c93f5f3..389304ee0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ -AC_INIT(gtk-sharp, 3.20.6) +AC_INIT(gtk-sharp, 3.22.1) AM_INIT_AUTOMAKE([1.10 no-dist-gzip dist-bzip2 tar-ustar foreign]) AC_CANONICAL_HOST diff --git a/sources/Generating-Sources.md b/sources/Generating-Sources.md new file mode 100644 index 000000000..708a1972d --- /dev/null +++ b/sources/Generating-Sources.md @@ -0,0 +1,112 @@ +# Generating Sources + +## Overview + +This is a quick overview of some of the commands to run when updating the sources for a new gtk version + +### Linux + +You may need to install the following package for generating the source under Linux +``` +sudo apt-get install libxml-libxml-perl +``` + +### Windows + +So far I've only managed to get this working in ubuntu, not Windows due to the way the .net app launches the perl script via libc +i.e. [DllImport ("libc")] + +It looks like we need to use the 32bit version of MinGW if we do try it this way. +The following path statements are needed in the console at the very least +``` +PATH=$PATH:/c/Program\ Files\ \(x86\)/Microsoft\ SDKs/Windows/v10.0A/bin/NETFX\ 4.6\ Tools/ +PATH=$PATH:/c/Windows/Microsoft.NET/Framework/v4.0.30319/ +``` + +Also the parser can be rebuilt via +``` +./autogen.sh --prefix=/tmp/install +cd parser +make clean +make +``` + +Also it's important to make sure MSYS2 is uptodate with +``` +pacman -Syuu +``` + +To search for a package that's been install (to see what version it is for example) +``` +pacman -Ss gtk3 +``` + + +## Editing Files for Downloaded Source + +### Configure.ac version number + +First change the version number in configure.ac to match that of the gtk version we're moving to +``` +AC_INIT(gtk-sharp, 3.22.1) +``` + +### Sources/Makefile.am + +Next change the version number in sources/Makefile.am to match +``` +TARGET_GTK_VERSION=3.22.1 +TARGET_GTK_API=3.22 +``` + +Next update the orher url's in Makefile.am, the version numbers should match those in use on the system (such as MSYS2) +``` +GTK_DOWNLOADS = \ + http://ftp.gnome.org/pub/GNOME/sources/glib/2.50/glib-2.50.0.tar.xz \ + http://ftp.gnome.org/pub/GNOME/sources/pango/1.40/pango-1.40.3.tar.xz \ + http://ftp.gnome.org/pub/GNOME/sources/atk/2.22/atk-2.22.0.tar.xz \ + http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.36/gdk-pixbuf-2.36.0.tar.xz \ + http://ftp.gnome.org/pub/GNOME/sources/gtk+/$(TARGET_GTK_API)/gtk+-$(TARGET_GTK_VERSION).tar.xz +``` + +### Patches + +As part of the source code download, some of the files will be patched +so you need to look at and check that all the patches apply correctly to the downloaded source when running make get-source-code + + +## Download the sources + +Next we're going to download the source +``` +./autogen.sh --prefix=/tmp/install +cd sources +make get-source-code +``` + +At this stage the sources should now be extracted within the sources sub directory + +### Update sources.xml + +One last file to update is the sources/sources.xml file +all directories in this file need to match the extracted directories + +## Generate the API Code + +### Generate the XML Files + +Next to generate the xml files needed for the generation of code +``` +make api +``` + +This should result in the following files + + * gdk/gdk-api.raw + * gio/gio-api.raw + * gtk/gtk-api.raw + * pango/pango-api.raw + +### Generate the API Code from the XML Files + +TODO we need to use generator/gapi_codegen.exe on each of the xml files to generate the .cs code within the generated sub directories diff --git a/sources/Makefile.am b/sources/Makefile.am index 2b9e8bd63..54a189d95 100644 --- a/sources/Makefile.am +++ b/sources/Makefile.am @@ -3,14 +3,14 @@ EXTRA_DIST = \ sources.xml \ gtk_tree_model_signal_fix.patch -TARGET_GTK_VERSION=3.20.6 -TARGET_GTK_API=3.20 +TARGET_GTK_VERSION=3.22.1 +TARGET_GTK_API=3.22 GTK_DOWNLOADS = \ - http://ftp.gnome.org/pub/GNOME/sources/glib/2.48/glib-2.48.0.tar.xz \ - http://ftp.gnome.org/pub/GNOME/sources/pango/1.40/pango-1.40.1.tar.xz \ - http://ftp.gnome.org/pub/GNOME/sources/atk/2.20/atk-2.20.0.tar.xz \ - http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.34/gdk-pixbuf-2.34.0.tar.xz \ + http://ftp.gnome.org/pub/GNOME/sources/glib/2.50/glib-2.50.0.tar.xz \ + http://ftp.gnome.org/pub/GNOME/sources/pango/1.40/pango-1.40.3.tar.xz \ + http://ftp.gnome.org/pub/GNOME/sources/atk/2.22/atk-2.22.0.tar.xz \ + http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.36/gdk-pixbuf-2.36.0.tar.xz \ http://ftp.gnome.org/pub/GNOME/sources/gtk+/$(TARGET_GTK_API)/gtk+-$(TARGET_GTK_VERSION).tar.xz api: @@ -21,9 +21,8 @@ get-source-code: wget $$i --output-document=- | tar -xJ ; \ done; ln -f -s gtkfilechooserprivate.h gtk+-$(TARGET_GTK_VERSION)/gtk/gtkfilechooserpriv.h - patch -p0 gtk+-$(TARGET_GTK_VERSION)/gtk/gtktreemodel.c < gtk_tree_model_signal_fix.patch + patch -p1 -d gtk+-$(TARGET_GTK_VERSION) < patches/gtk_tree_model_signal_fix.patch echo "typedef struct _GtkClipboard GtkClipboard;" >> gtk+-$(TARGET_GTK_VERSION)/gtk/gtkclipboard.h echo "typedef struct _GtkClipboardClass GtkClipboardClass;" >> gtk+-$(TARGET_GTK_VERSION)/gtk/gtkclipboard.h - patch -p0 gtk+-$(TARGET_GTK_VERSION)/gtk/gtktextattributes.h < gtktextattributes-gi-scanner.patch - patch -p0 glib-2.48.0/gio/gwin32registrykey.h < gwin32registrykey-little-endian.patch - + patch -p0 gtk+-$(TARGET_GTK_VERSION)/gtk/gtktextattributes.h < patches/gtktextattributes-gi-scanner.patch + patch -p0 glib-2.50.0/gio/gwin32registrykey.h < patches/gwin32registrykey-little-endian.patch diff --git a/sources/gtk_tree_model_signal_fix.patch b/sources/patches/gtk_tree_model_signal_fix.patch similarity index 80% rename from sources/gtk_tree_model_signal_fix.patch rename to sources/patches/gtk_tree_model_signal_fix.patch index be9c74eee..31ec6a014 100644 --- a/sources/gtk_tree_model_signal_fix.patch +++ b/sources/patches/gtk_tree_model_signal_fix.patch @@ -1,6 +1,7 @@ ---- gtk+-2.14.3/gtk/gtktreemodel.c 2009-01-04 11:52:01.000000000 -0600 -+++ gtktreemodel.c 2009-01-04 12:03:58.000000000 -0600 -@@ -193,14 +193,15 @@ +diff -Naur gtk+-3.22.1.orig/gtk/gtktreemodel.c gtk+-3.22.1/gtk/gtktreemodel.c +--- gtk+-3.22.1.orig/gtk/gtktreemodel.c 2016-08-29 18:20:43.000000000 +0100 ++++ gtk+-3.22.1/gtk/gtktreemodel.c 2016-10-17 13:57:41.204889300 +0100 +@@ -395,14 +395,15 @@ closure = g_closure_new_simple (sizeof (GClosure), NULL); g_closure_set_marshal (closure, row_inserted_marshal); tree_model_signals[ROW_INSERTED] = @@ -19,7 +20,7 @@ /** * GtkTreeModel::row-has-child-toggled: -@@ -242,14 +243,14 @@ +@@ -441,14 +442,14 @@ closure = g_closure_new_simple (sizeof (GClosure), NULL); g_closure_set_marshal (closure, row_deleted_marshal); tree_model_signals[ROW_DELETED] = @@ -30,14 +31,14 @@ - closure, + G_STRUCT_OFFSET (GtkTreeModelIface, row_deleted), NULL, NULL, - _gtk_marshal_VOID__BOXED, + NULL, G_TYPE_NONE, 1, - row_deleted_params); + GTK_TYPE_TREE_PATH); /** - * GtkTreeModel::rows-reordered: -@@ -268,14 +269,15 @@ + * GtkTreeModel::rows-reordered: (skip) +@@ -471,14 +472,15 @@ closure = g_closure_new_simple (sizeof (GClosure), NULL); g_closure_set_marshal (closure, rows_reordered_marshal); tree_model_signals[ROWS_REORDERED] = @@ -51,8 +52,8 @@ _gtk_marshal_VOID__BOXED_BOXED_POINTER, G_TYPE_NONE, 3, - rows_reordered_params); -+ GTK_TYPE_TREE_PATH | G_SIGNAL_TYPE_STATIC_SCOPE, -+ GTK_TYPE_TREE_ITER, G_TYPE_POINTER); ++ GTK_TYPE_TREE_PATH | G_SIGNAL_TYPE_STATIC_SCOPE, ++ GTK_TYPE_TREE_ITER, G_TYPE_POINTER); initialized = TRUE; } } diff --git a/sources/gtktextattributes-gi-scanner.patch b/sources/patches/gtktextattributes-gi-scanner.patch similarity index 100% rename from sources/gtktextattributes-gi-scanner.patch rename to sources/patches/gtktextattributes-gi-scanner.patch diff --git a/sources/gwin32registrykey-little-endian.patch b/sources/patches/gwin32registrykey-little-endian.patch similarity index 100% rename from sources/gwin32registrykey-little-endian.patch rename to sources/patches/gwin32registrykey-little-endian.patch diff --git a/sources/sources.xml b/sources/sources.xml index 996b8fc66..a67a511a5 100644 --- a/sources/sources.xml +++ b/sources/sources.xml @@ -2,7 +2,7 @@ - + gasynchelper.h gcontenttypeprivate.h gdelayedsettingsbackend.h @@ -91,14 +91,14 @@ - atk-2.20.0/atk + atk-2.22.0/atk - + pangoatsui.c pangoatsui.h pangoatsui-fontmap.h @@ -140,17 +140,17 @@ - + gdkalias.h gdkwindowimpl.h keyname-table.h - + - + io-gdip-native.h io-gdip-propertytags.h io-gdip-utils.h @@ -165,7 +165,7 @@ - + gtkalias.h gtkappchooseronline.h @@ -263,7 +263,7 @@ gtkcomposetable.c gtkcomposetable.h - +