Skip to content

Commit

Permalink
di: Try to fix build on OS X 10.11 and earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandesign committed Feb 7, 2025
1 parent f02adc4 commit 0330f15
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 16 deletions.
8 changes: 3 additions & 5 deletions sysutils/di/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ name di
version 5.0.0
revision 1
categories sysutils
platforms darwin
maintainers {mps @Schamschula} openmaintainer
license zlib
description disk information utility
Expand All @@ -26,11 +25,10 @@ depends_build path:bin/cmake:cmake \

depends_lib port:gettext-runtime

patchfiles patch-Makefile.diff
patchfiles CMakeLists.txt.patch

post-patch {
reinplace "s|%PREFIX%|${prefix}|g" ${worksrcpath}/Makefile
}
makefile.override-append \
PREFIX

livecheck.type regex
livecheck.url https://sourceforge.net/projects/diskinfo-di/files/
Expand Down
44 changes: 44 additions & 0 deletions sysutils/di/files/CMakeLists.txt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Don't force the deployment target to 10.10.

Include sys/types.h before including sys/quota.h, for OS X 10.11 and earlier.

https://sourceforge.net/p/diskinfo-di/tickets/11/

--- CMakeLists.txt.orig 2025-02-03 20:06:07.000000000 -0600
+++ CMakeLists.txt 2025-02-06 17:57:07.000000000 -0600
@@ -148,8 +148,6 @@
# 10.14 = Mojave, 10.15 = Catalina
# 11 = Big Sur, 12 = Monterey, 13 = Ventura, 14 = Sonoma
# 15 = Sequoia
- add_compile_options (-mmacosx-version-min=10.10)
- add_link_options (-mmacosx-version-min=10.10)
# not universal binary, I don't have universal libintl installed.
# set (CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
endif()
@@ -532,7 +530,7 @@

# openbsd, dragonflybsd, freeb
check_include_files ("sys/types.h;sys/mount.h" _sys_mount)
-check_include_file (sys/quota.h _sys_quota)
+check_include_files ("sys/types.h;sys/quota.h" _sys_quota)
check_include_file (sys/stat.h _sys_stat)
check_include_file (sys/statfs.h _sys_statfs)
check_include_file (sys/statvfs.h _sys_statvfs)
@@ -745,7 +743,7 @@
set (QUOTA_HDR "sys/types.h;unistd.h;ufs/ufs/quota.h")
endif()
if (_sys_quota)
- set (QUOTA_HDR "sys/quota.h")
+ set (QUOTA_HDR "sys/types.h;sys/quota.h")
endif()
if (_hdr_ufs_quota)
set (QUOTA_HDR "ufs/quota.h")
@@ -876,7 +874,7 @@
check_prototype_definition (quotactl
"int quotactl (int a, const char * b, uid_t c, void * d)"
0
- ${QUOTA_HDR}
+ "${QUOTA_HDR}"
_npt_quotactl
)
if (_npt_quotactl)
11 changes: 0 additions & 11 deletions sysutils/di/files/patch-Makefile.diff

This file was deleted.

1 comment on commit 0330f15

@Schamschula
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ryan, Thanks for looking into this!

Please sign in to comment.