diff --git a/sysutils/toybox/Makefile b/sysutils/toybox/Makefile index 42b2adbc1d42..41c8fa141cf5 100644 --- a/sysutils/toybox/Makefile +++ b/sysutils/toybox/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ PORTNAME= toybox -PORTVERSION= 0.8.2 +PORTVERSION= 0.8.3 CATEGORIES= sysutils MAINTAINER= vidar@karlsen.tech @@ -17,11 +17,14 @@ LIB_DEPENDS= libinotify.so:devel/libinotify USES= gmake shebangfix -SHEBANG_FILES= scripts/change.sh scripts/findglobals.sh \ +SHEBANG_FILES= scripts/bloatcheck scripts/mcm-buildall.sh \ + scripts/change.sh scripts/findglobals.sh \ scripts/genconfig.sh scripts/install.sh \ - scripts/make.sh scripts/minicom.sh \ - scripts/portability.sh scripts/runtest.sh \ - scripts/single.sh scripts/test.sh configure + scripts/make.sh scripts/mkroot.sh \ + scripts/portability.sh scripts/record-commands \ + scripts/runtest.sh scripts/single.sh \ + scripts/test.sh configure \ + tests/* PLIST_FILES= bin/toybox @@ -29,11 +32,12 @@ USE_GITHUB= yes GH_ACCOUNT= landley post-patch: - @${REINPLACE_CMD} -e 's||"${LOCALBASE}/include/sys/inotify.h"|' \ + ${REINPLACE_CMD} -e 's||"${LOCALBASE}/include/sys/inotify.h"|' \ ${WRKSRC}/lib/portability.c + ${REINPLACE_CMD} -e 's|sed|gsed|' ${WRKSRC}/scripts/single.sh do-configure: - cd ${WRKSRC} && ${GMAKE} bsd_defconfig + cd ${WRKSRC} && HOSTCC=${CC} ${GMAKE} bsd_defconfig do-install: ${INSTALL_PROGRAM} ${WRKSRC}/toybox ${STAGEDIR}${PREFIX}/bin diff --git a/sysutils/toybox/distinfo b/sysutils/toybox/distinfo index 84abd6d5331b..d928633b73c0 100644 --- a/sysutils/toybox/distinfo +++ b/sysutils/toybox/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1574378247 -SHA256 (landley-toybox-0.8.2_GH0.tar.gz) = 9d8a9b00a6c93da5b472d8a4c7d9549339ed050d1578c557a20add100172b0f5 -SIZE (landley-toybox-0.8.2_GH0.tar.gz) = 1057417 +TIMESTAMP = 1589273785 +SHA256 (landley-toybox-0.8.3_GH0.tar.gz) = 5e5a89888aa04b536a848b701f3abb92eb11ad108f39a41c588247a45412f929 +SIZE (landley-toybox-0.8.3_GH0.tar.gz) = 1106455 diff --git a/sysutils/toybox/files/patch-lib_portability.c b/sysutils/toybox/files/patch-lib_portability.c new file mode 100644 index 000000000000..f0a219644daa --- /dev/null +++ b/sysutils/toybox/files/patch-lib_portability.c @@ -0,0 +1,57 @@ +--- lib/portability.c.orig 2020-05-11 18:23:26 UTC ++++ lib/portability.c +@@ -6,6 +6,10 @@ + + #include "toys.h" + ++#if defined(__FreeBSD__) ++#include ++#endif ++ + // We can't fork() on nommu systems, and vfork() requires an exec() or exit() + // before resuming the parent (because they share a heap until then). And no, + // we can't implement our own clone() call that does the equivalent of fork() +@@ -522,6 +526,8 @@ int dev_minor(int dev) + return ((dev&0xfff00000)>>12)|(dev&0xff); + #elif defined(__APPLE__) + return dev&0xffffff; ++#elif defined(__FreeBSD__) ++ return minor(dev); + #else + #error + #endif +@@ -533,6 +539,8 @@ int dev_major(int dev) + return (dev&0xfff00)>>8; + #elif defined(__APPLE__) + return (dev>>24)&0xff; ++#elif defined(__FreeBSD__) ++ return major(dev); + #else + #error + #endif +@@ -544,6 +552,8 @@ int dev_makedev(int major, int minor) + return (minor&0xff)|((major&0xfff)<<8)|((minor&0xfff00)<<12); + #elif defined(__APPLE__) + return (minor&0xffffff)|((major&0xff)<<24); ++#elif defined(__FreeBSD__) ++ return makedev(major, minor); + #else + #error + #endif +@@ -593,5 +603,16 @@ int get_block_device_size(int fd, unsigned long long* + int get_block_device_size(int fd, unsigned long long* size) + { + return (ioctl(fd, BLKGETSIZE64, size) >= 0); ++} ++#elif defined(__FreeBSD__) ++#include ++int get_block_device_size(int fd, unsigned long long* size) ++{ ++ off_t sz = 0; ++ if (ioctl(fd, DIOCGMEDIASIZE, &sz) >= 0) { ++ *size = sz; ++ return 1; ++ } ++ return 0; + } + #endif