Skip to content

Commit

Permalink
FIX: install location pkgconfig and cmake configs
Browse files Browse the repository at this point in the history
When using `./configure.py --prefix=` with a relative path, this did apply
the prefix to the install path twice. Both the pkgconfig and the cmake config
ended up in the wrong install location.

closes randombit#4231
  • Loading branch information
reneme committed Jul 19, 2024
1 parent 2b62712 commit 44db416
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/scripts/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def copy_executable(src, dst):
bin_dir = cfg['bindir']
lib_dir = cfg['libdir']
target_include_dir = cfg['installed_include_dir']
pkgconfig_dir = 'pkgconfig'
cmake_dir = 'cmake'
pkgconfig_dir = os.path.join(lib_dir, 'pkgconfig')
cmake_dir = os.path.join(lib_dir, 'cmake', 'Botan-%s' % cfg["version"])

prefix = cfg['prefix']

Expand Down Expand Up @@ -205,13 +205,11 @@ def copy_executable(src, dst):
copy_executable(cfg['cli_exe'], prepend_destdir(os.path.join(bin_dir, cfg['cli_exe_name'])))

if 'botan_pkgconfig' in cfg:
pkgconfig_dir = os.path.join(prefix, lib_dir, pkgconfig_dir)
makedirs(prepend_destdir(pkgconfig_dir))
copy_file(cfg['botan_pkgconfig'],
prepend_destdir(os.path.join(pkgconfig_dir, os.path.basename(cfg['botan_pkgconfig']))))

if 'botan_cmake_config' in cfg and 'botan_cmake_version_config' in cfg:
cmake_dir = os.path.join(prefix, lib_dir, cmake_dir, 'Botan-%s' % cfg["version"])
makedirs(prepend_destdir(cmake_dir))
copy_file(cfg['botan_cmake_config'],
prepend_destdir(os.path.join(cmake_dir, os.path.basename(cfg['botan_cmake_config']))))
Expand Down

0 comments on commit 44db416

Please sign in to comment.