aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiclas Moeslund Overby <noverby@prozum.dk>2018-07-02 23:19:52 +0200
committerNiclas Moeslund Overby <noverby@prozum.dk>2018-07-03 22:12:17 +0200
commitc70a051e9352639440532ad969d9b7c215a3e699 (patch)
treede86a3cedb76fe38c05a0a5247514f6ead6e8a7f
parentbc8239ded025d05d924e0e09b359941505e729b5 (diff)
downloadmeson-c70a051e9352639440532ad969d9b7c215a3e699.zip
meson-c70a051e9352639440532ad969d9b7c215a3e699.tar.gz
meson-c70a051e9352639440532ad969d9b7c215a3e699.tar.bz2
java: remove manifest classpath from installed jar
-rw-r--r--mesonbuild/scripts/depfixer.py14
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: