Skip to content

Commit

Permalink
Fix single architecture bits of jhbuildrc.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Sep 9, 2017
1 parent 767d753 commit 5b3d168
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 10 additions & 4 deletions jhbuildrc.in
Expand Up @@ -32,6 +32,8 @@ def add_to_path_var(var, path):

_basedir = "@-BASE_DIR-@"
_download_dir = "@-DOWNLOAD_DIR-@"
_arch = "@-ARCH-@"

_config_dir = os.path.dirname(os.path.realpath(__file__))
prefix = os.path.join(_basedir, 'inst')
checkoutroot = os.path.join(_basedir, 'src')
Expand All @@ -40,21 +42,25 @@ tarballdir = os.path.join(_download_dir)
moduleset = os.path.join(_config_dir, 'gnucash.modules')
modules = ["meta-gnucash"]

_mingw_includes = os.path.join(_basedir, 'msys2', 'mingw32', 'include')
_mingw_libs = os.path.join(_basedir, 'msys2', 'mingw32', 'lib')
_mingw_includes = os.path.join(_basedir, 'msys2', $_arch, 'include')
_mingw_libs = os.path.join(_basedir, 'msys2', $_arch, 'lib')
_usr_include = os.path.join('/usr', 'include')
_usr_lib = os.path.join('/usr', 'lib')
environ_append('CPPFLAGS', '-I%s -I%s' % (_mingw_includes, _usr_include))
environ_append('LDFLAGS', '-L%s -L%s' % (_mingw_libs, _usr_lib))
add_to_path_var('PKG_CONFIG_PATH', os.path.join(_mingw_libs, 'pkgconfig'))
add_to_path_var('PATH', os.path.join(_basedir, 'msys2', 'mingw32', 'bin'))
add_to_path_var('PATH', os.path.join(_basedir, 'msys2', $_arch, 'bin'))

os.environ['SRCROOT'] = checkoutroot
os.environ['PREFIX'] = prefix
os.environ['MSYS2ROOT'] = os.path.join(_basedir, 'msys2')
#os.environ['GUILE_LOAD_PATH'] = os.path.join(prefix, 'share', 'guile', '2.0')
#os.environ['GUILE_LOAD_BINARY_PATH'] = os.path.join(prefix, 'lib', 'guile', '2.0', 'ccache')
autogenargs = "--build=i686-w64-mingw32"
if ($_arch == 'mingw32':
autogenargs = "--build=i686-w64-mingw32"
else:
autogenargs = "--build=x86_64-w64-mingw64"

#autogenargs = 'CPPFLAGS="-I%s"' % _sys_includes

append_autogenargs("libofx", "--with-opensp-includes=" + prefix + "/include/OpenSP --with-opensp-libs=" + prefix + "/lib")
Expand Down
3 changes: 3 additions & 0 deletions setup-mingw64.ps1
Expand Up @@ -63,12 +63,14 @@ if ($x86_64) {
$mingw_path = "/mingw64"
$mingw_bin = "/mingw64/bin"
$env:MSYSTEM = "MINGW64"
$arch = "mingw64"
}
else {
$mingw_prefix = "mingw32/mingw-w64-i686-"
$mingw_path = "/mingw32"
$mingw_bin = "/mingw32/bin"
$env:MSYSTEM = "MINGW32"
$arch = "mingw32"
}

if (!(test-path -path $target_dir)) {
Expand Down Expand Up @@ -264,6 +266,7 @@ bash-command -command "/usr/bin/patch -d/ -p0 -i $target_unix/src/gnucash-on-win
$jhbuildrc = get-content "$target_dir\\src\\gnucash-on-windows.git\\jhbuildrc.in" |
%{$_ -replace "@-BASE_DIR-@", "$target_unix"} |
%{$_ -replace "@-DOWNLOAD_DIR-@", "$download_unix"}
%{$_ -replace "@-ARCH-@", "$arch"}
[IO.File]::WriteAllLines("$target_dir\\src\\gnucash-on-windows.git\\jhbuildrc", $jhbuildrc)

Write-Host @"
Expand Down

0 comments on commit 5b3d168

Please sign in to comment.