gnucash-on-windows master: Get jhbuild from gitlab.gnome.org
John Ralls
jralls at code.gnucash.org
Tue May 26 14:45:34 EDT 2020
Updated via https://github.com/Gnucash/gnucash-on-windows/commit/5efdb8b1 (commit)
from https://github.com/Gnucash/gnucash-on-windows/commit/2785a680 (commit)
commit 5efdb8b126b9f4207c2972f662d27d5a66841646
Author: John Ralls <jralls at ceridwen.us>
Date: Tue May 26 10:20:49 2020 -0700
Get jhbuild from gitlab.gnome.org
MinGW-w64 dropped the packaged jhbuild, so rewire setup_mingw64 to
clone the gnome repository, patch it to disable DESTDIR, and make
a command file.
Also don't patch FindSWIG.cmake when it's already been patched.
diff --git a/jhbuild.in b/jhbuild.in
new file mode 100644
index 0000000..f93a47d
--- /dev/null
+++ b/jhbuild.in
@@ -0,0 +1,23 @@
+#!/usr/bin/env python2
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+
+if sys.version_info[0] == 2:
+ import __builtin__ as builtins
+else:
+ import builtins
+
+sys.path.insert(0, '@-BASE_DIR-@/src/jhbuild.git')
+pkgdatadir = None
+datadir = None
+import jhbuild
+srcdir = os.path.abspath(os.path.join(os.path.dirname(jhbuild.__file__), '..'))
+
+builtins.__dict__['PKGDATADIR'] = pkgdatadir
+builtins.__dict__['DATADIR'] = datadir
+builtins.__dict__['SRCDIR'] = srcdir
+
+import jhbuild.main
+jhbuild.main.main(sys.argv[1:])
diff --git a/patches/jhbuild.patch b/patches/jhbuild.patch
index 542a896..461c3ed 100644
--- a/patches/jhbuild.patch
+++ b/patches/jhbuild.patch
@@ -1,20 +1,8 @@
---- /usr/lib/python2.7/site-packages/jhbuild/modtypes/cmake.py~ 2017-09-05 16:58:18.206528300 -0700
-+++ /usr/lib/python2.7/site-packages/jhbuild/modtypes/cmake.py 2017-09-05 16:59:24.172738500 -0700
-@@ -159,10 +159,9 @@
- if self.use_ninja:
- self.ensure_ninja_binary()
- extra_env = self.extra_env or {}
-- extra_env['DESTDIR'] = destdir
- buildscript.execute(self.ninja_binary + ' install', cwd=builddir, extra_env=extra_env)
- else:
-- self.make(buildscript, 'install DESTDIR={}'.format(destdir))
-+ self.make(buildscript, 'install')
- self.process_install(buildscript, self.get_revision())
- do_install.depends = [PHASE_BUILD]
-
---- /usr/lib/python2.7/site-packages/jhbuild/modtypes/__init__.py~ 2017-06-01 12:15:14.000000000 -0700
-+++ /usr/lib/python2.7/site-packages/jhbuild/modtypes/__init__.py 2017-09-05 17:44:27.556524900 -0700
-@@ -313,14 +313,16 @@
+diff --git a/jhbuild/modtypes/__init__.py b/jhbuild/modtypes/__init__.py
+index 2919a9f9..8b5f915f 100644
+--- a/jhbuild/modtypes/__init__.py
++++ b/jhbuild/modtypes/__init__.py
+@@ -314,13 +314,15 @@ them into the prefix."""
save_broken_tree = False
broken_name = destdir + '-broken'
destdir_prefix = os.path.join(destdir, stripped_prefix)
@@ -23,7 +11,6 @@
errors = []
+ num_copied = 0
if os.path.isdir(destdir_prefix):
- destdir_install = True
logging.info(_('Moving temporary DESTDIR %r into build prefix') % (destdir, ))
num_copied = self._process_install_files(destdir, destdir_prefix,
buildscript.config.prefix,
@@ -32,7 +19,7 @@
# Now the destdir should have a series of empty directories:
# $JHBUILD_PREFIX/_jhbuild/root-foo/$JHBUILD_PREFIX
-@@ -345,7 +347,8 @@
+@@ -345,7 +347,8 @@ them into the prefix."""
# Even if there are some files outside the DESTDIR, count that as success for now; we just warn
install_succeeded = True
else:
@@ -42,3 +29,19 @@
if save_broken_tree:
if os.path.exists(broken_name):
+diff --git a/jhbuild/modtypes/cmake.py b/jhbuild/modtypes/cmake.py
+index 1bd44e32..4064faaa 100644
+--- a/jhbuild/modtypes/cmake.py
++++ b/jhbuild/modtypes/cmake.py
+@@ -143,9 +143,9 @@ class CMakeModule(MakeModule, NinjaModule, DownloadableModule):
+ buildscript.set_action(_('Installing'), self)
+ destdir = self.prepare_installroot(buildscript)
+ if self.use_ninja:
+- self.ninja(buildscript, 'install', env={'DESTDIR': destdir})
++ self.ninja(buildscript, 'install')
+ else:
+- self.make(buildscript, 'install DESTDIR={}'.format(destdir))
++ self.make(buildscript, 'install')
+ self.process_install(buildscript, self.get_revision())
+ do_install.depends = [PHASE_BUILD]
+
diff --git a/setup-mingw64.ps1 b/setup-mingw64.ps1
index 585e5fe..3c3ffe0 100644
--- a/setup-mingw64.ps1
+++ b/setup-mingw64.ps1
@@ -235,7 +235,7 @@ bash-command -command "pacman -Syyuu --noconfirm"
# Set up aliases for the parts of msys-devtools and mingw-w64-toolchain that
# we need:
-$devel = "asciidoc autoconf autoconf2.13 autogen automake-wrapper automake1.10 automake1.11 automake1.12 automake1.13 automake1.14 automake1.15 automake1.6 automake1.7 automake1.8 automake1.9 bison diffstat diffutils dos2unix file flex gawk gettext gettext-devel gperf grep groff intltool libtool m4 make man-db pacman pactoys-git patch patchutils perl pkg-config rsync2 sed swig texinfo texinfo-tex wget xmlto git jhbuild-git texinfo"
+$devel = "asciidoc autoconf autoconf2.13 autogen automake-wrapper bison diffstat diffutils dos2unix file flex gawk gettext gettext-devel gperf grep groff intltool libtool m4 make man-db pacman pactoys-git patch patchutils perl pkg-config rsync2 sed swig texinfo texinfo-tex wget xmlto git texinfo"
$toolchain = "binutils cmake crt-git gcc gcc-libs gdb headers-git libmangle-git libtool libwinpthread-git make pkg-config tools-git winpthreads-git"
@@ -314,8 +314,7 @@ Clone the gnucash-on-windows repository into the target source directory, patch
if (!(test-path -path "$target_dir\\src")) {
New-Item $target_dir\\src -type directory
-}
-if (!(test-path -path "$target_dir\\src\\gnucash-on-windows.git")) {
+}if (!(test-path -path "$target_dir\\src\\gnucash-on-windows.git")) {
bash-command -command "git clone https://github.com/gnucash/gnucash-on-windows.git $target_unix/src/gnucash-on-windows.git"
}
if (!(test-path -path "$target_dir\\src\\gnucash-on-windows.git")) {
@@ -323,8 +322,23 @@ if (!(test-path -path "$target_dir\\src\\gnucash-on-windows.git")) {
exit
}
-bash-command -command "/usr/bin/patch -f -d/ -p0 -i $target_unix/src/gnucash-on-windows.git/patches/jhbuild.patch"
-bash-command -command "/usr/bin/patch -f -d `$(dirname `$(/usr/bin/find /$arch/share/cmake* -name FindSWIG.cmake) ) -p1 -i $target_unix/src/gnucash-on-windows.git/patches/FindSWIG.patch"
+if (!(test-path -path "$target_dir\\src\\jhbuild.git")) {
+ bash-command -command "git clone https://gitlab.gnome.org/GNOME/jhbuild $target_unix/src/jhbuild.git"
+ bash-command -command "/usr/bin/patch -f -d $target_unix/src/jhbuild.git -p1 -i $target_unix/src/gnucash-on-windows.git/patches/jhbuild.patch"
+}
+if (!(test-path -path "$target_dir\\src\\jhbuild.git")) {
+ write-host "Failed to clone the jhbuild repo, exiting."
+ exit
+}
+if (!(test-path -path "$target_dir\\msys2\\usr\\bin\\jhbuild")) {
+ $jhbuild = get-content "$target_dir\\src\\gnucash-on-windows.git\\jhbuild.in" |
+ %{$_ -replace "@-BASE_DIR-@", "$target_unix"}
+ [IO.File]::WriteAllLines("$target_dir\\msys2\\usr\\bin\\jhbuild", $jhbuild)
+}
+
+if (!(get-childitem -path $target_dir\\msys2\\mingw32\\share -recurse -include FindSWIG.cmake.orig -name)) {
+ bash-command -command "/usr/bin/patch -b -f -d `$(dirname `$(/usr/bin/find /$arch/share/cmake* -name FindSWIG.cmake) ) -p1 -i $target_unix/src/gnucash-on-windows.git/patches/FindSWIG.patch"
+}
$jhbuildrc = get-content "$target_dir\\src\\gnucash-on-windows.git\\jhbuildrc.in" |
%{$_ -replace "@-BASE_DIR-@", "$target_unix"} |
Summary of changes:
jhbuild.in | 23 +++++++++++++++++++++++
patches/jhbuild.patch | 41 ++++++++++++++++++++++-------------------
setup-mingw64.ps1 | 24 +++++++++++++++++++-----
3 files changed, 64 insertions(+), 24 deletions(-)
create mode 100644 jhbuild.in
More information about the gnucash-changes
mailing list