Mercurial > hgrepos > Python2 > PyMuPDF
changeset 14:59f1bd90b2a0
Use "soname" on FreeBSD also.
FreeBSD and Linux are now handled identical with regard
to soname and library naming and packaging.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 17 Sep 2025 20:35:45 +0200 |
| parents | d6cbc8049ab0 |
| children | 393e55ef9200 |
| files | mupdf-source/Makerules mupdf-source/scripts/pipcl.py mupdf-source/scripts/wrap/__main__.py pipcl.py |
| diffstat | 4 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mupdf-source/Makerules Wed Sep 17 20:31:46 2025 +0200 +++ b/mupdf-source/Makerules Wed Sep 17 20:35:45 2025 +0200 @@ -139,6 +139,8 @@ LDFLAGS += -sTOTAL_MEMORY=48MB else ifeq ($(OS),Linux) LIB_LDFLAGS = -shared -Wl,-soname,$(notdir $@) + else ifeq ($(OS),FreeBSD) + LIB_LDFLAGS = -shared -Wl,-soname,$(notdir $@) else LIB_LDFLAGS = -shared endif
--- a/mupdf-source/scripts/pipcl.py Wed Sep 17 20:31:46 2025 +0200 +++ b/mupdf-source/scripts/pipcl.py Wed Sep 17 20:35:45 2025 +0200 @@ -1860,6 +1860,10 @@ def openbsd(): return platform.system() == 'OpenBSD' +def freebsd(): + return platform.system() == 'FreeBSD' + + class PythonFlags: ''' Compile/link flags for the current python, for example the include path @@ -2309,7 +2313,7 @@ return `path`. Useful if Linux shared libraries have been created with `-Wl,-soname,...`, where we need to embed the versioned library. ''' - if linux() and os.path.islink(path): + if (linux() or freebsd()) and os.path.islink(path): path2 = os.path.realpath(path) if subprocess.run(f'objdump -p {path2}|grep SONAME', shell=1, check=0).returncode == 0: return path2
--- a/mupdf-source/scripts/wrap/__main__.py Wed Sep 17 20:31:46 2025 +0200 +++ b/mupdf-source/scripts/wrap/__main__.py Wed Sep 17 20:35:45 2025 +0200 @@ -1674,7 +1674,7 @@ elif 'shared' in dir_so_flags: link_soname_arg = '' - if state.state_.linux and so_version: + if (state.state_.linux or state.state_.freebsd) and so_version: link_soname_arg = f'-Wl,-soname,{os.path.basename(libmupdfcpp)}' command = ( textwrap.dedent( f'''
--- a/pipcl.py Wed Sep 17 20:31:46 2025 +0200 +++ b/pipcl.py Wed Sep 17 20:35:45 2025 +0200 @@ -2317,6 +2317,9 @@ def openbsd(): return platform.system() == 'OpenBSD' +def freebsd(): + return platform.system() == 'FreeBSD' + def show_system(): ''' @@ -2863,7 +2866,7 @@ return `path`. Useful if Linux shared libraries have been created with `-Wl,-soname,...`, where we need to embed the versioned library. ''' - if linux() and os.path.islink(path): + if (linux() or freebsd()) and os.path.islink(path): path2 = os.path.realpath(path) if subprocess.run(f'objdump -p {path2}|grep SONAME', shell=1, check=0).returncode == 0: return path2
