diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-07-07 13:10:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-07 13:10:22 +0300 |
commit | 4dc97a910ef0b9026048b71a020feb74fcc302af (patch) | |
tree | f1be59b96c262c312d6f4d492d532c0f2d669804 /mesonbuild/scripts | |
parent | 9bc9e9f306d6418c61e3bc602c3ced60a698c37d (diff) | |
parent | 62a46a9b6ec042ab624dc3563b3c777371bb3ab6 (diff) | |
download | meson-4dc97a910ef0b9026048b71a020feb74fcc302af.zip meson-4dc97a910ef0b9026048b71a020feb74fcc302af.tar.gz meson-4dc97a910ef0b9026048b71a020feb74fcc302af.tar.bz2 |
Merge pull request #3763 from noverby/wip/noverby/jar-linking-manifest
java: support for linking jar files (using manifest)
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r-- | mesonbuild/scripts/depfixer.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py index 40f47c0..d3d3028 100644 --- a/mesonbuild/scripts/depfixer.py +++ b/mesonbuild/scripts/depfixer.py @@ -396,11 +396,25 @@ def fix_darwin(fname, new_rpath, final_path, install_name_mappings): raise sys.exit(0) +def fix_jar(fname): + subprocess.check_call(['jar', 'xfv', fname, 'META-INF/MANIFEST.MF']) + with open('META-INF/MANIFEST.MF', 'r+') as f: + lines = f.readlines() + f.seek(0) + for line in lines: + if not line.startswith('Class-Path:'): + f.write(line) + f.truncate() + subprocess.check_call(['jar', 'ufm', fname, 'META-INF/MANIFEST.MF']) + def fix_rpath(fname, new_rpath, final_path, install_name_mappings, verbose=True): # Static libraries never have rpaths if fname.endswith('.a'): return try: + if fname.endswith('.jar'): + fix_jar(fname) + return fix_elf(fname, new_rpath, verbose) return except SystemExit as e: |