From 2a846109b86a26f8233bdc67527845a36d24cc05 Mon Sep 17 00:00:00 2001 From: Eric Hocking Date: Fri, 5 May 2023 16:32:42 +0000 Subject: [PATCH] fix building on freebsd 13 --- lib/libalpm/diskspace.c | 4 ++++ meson.build | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index f0d1499d..90d81649 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -162,7 +162,11 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle) for(; entries-- > 0; fsp++) { CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(handle, ALPM_ERR_MEMORY, NULL)); +#if __APPLE__ STRDUP(mp->mount_dir, fsp->f_mntonname, free(mp); RET_ERR(handle, ALPM_ERR_MEMORY, NULL)); +#else + STRDUP(mp->mount_dir, mp->mount_dir, free(mp); RET_ERR(handle, ALPM_ERR_MEMORY, NULL)); +#endif mp->mount_dir_len = strlen(mp->mount_dir); memcpy(&(mp->fsp), fsp, sizeof(FSSTATSTYPE)); #if defined(HAVE_GETMNTINFO_STATVFS) && defined(HAVE_STRUCT_STATVFS_F_FLAG) diff --git a/meson.build b/meson.build index dbc599ea..0a21eb87 100644 --- a/meson.build +++ b/meson.build @@ -28,7 +28,12 @@ LIBMAKEPKGDIR = join_paths(PREFIX, DATAROOTDIR, 'makepkg') PKGDATADIR = join_paths(PREFIX, DATAROOTDIR, meson.project_name()) KEYRINGDIR = join_paths(PREFIX, DATAROOTDIR, get_option('keyringdir')) +os = host_machine.system() +if os.contains('bsd') +PYTHON = import('python').find_installation('python3.9') +else PYTHON = import('python').find_installation('python3') +endif LDCONFIG = get_option('ldconfig') MESON_MAKE_SYMLINK = join_paths(meson.project_source_root(), 'build-aux/meson-make-symlink.sh') @@ -243,7 +248,6 @@ if file_seccomp.enabled() or ( file_seccomp.auto() and filever.version_compare(' filecmd = 'file -S' endif -os = host_machine.system() if os.startswith('darwin') inodecmd = '/usr/bin/stat -f \'%i %N\'' strip_binaries = ''