fix linux-utils on mac (#835)

* fix linux-utils on mac

Closes #831

* wip

* wip

* wip

* fix up headers

* stupid. $INCLUDE means something to clang

---------

Co-authored-by: Jacob Heider <jacob@tea.xyz>
This commit is contained in:
Max Howell 2023-03-30 18:47:37 -04:00 committed by GitHub
parent ff58686c65
commit 91e05e5e88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 139 additions and 80 deletions

View file

@ -0,0 +1,25 @@
--- lib/procfs.c 2022-02-17 05:28:41.000000000 -0500
+++ lib/procfs.c 2022-04-07 19:10:05.000000000 -0400
@@ -6,7 +6,9 @@
*/
#include <ctype.h>
#include <unistd.h>
-#include <sys/vfs.h>
+//#include <sys/vfs.h>
+#include <sys/param.h>
+#include <sys/mount.h>
#include <errno.h>
#include "c.h"
--- include/statfs_magic.h 2021-02-02 10:41:37.000000000 -0500
+++ include/statfs_magic.h 2021-02-21 23:43:37.000000000 -0500
@@ -1,7 +1,7 @@
#ifndef UTIL_LINUX_STATFS_MAGIC_H
#define UTIL_LINUX_STATFS_MAGIC_H
-#include <sys/statfs.h>
+//#include <sys/statfs.h>
/*
* If possible then don't depend on internal libc __SWORD_TYPE type.

View file

@ -1,106 +1,140 @@
distributable:
url: https://github.com/util-linux/util-linux/archive/refs/tags/v{{ version }}.tar.gz
url: https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v{{version.marketing}}/util-linux-{{version.raw}}.tar.xz
strip-components: 1
versions:
github: util-linux/util-linux/tags
strip: /^v/
provides:
- bin/cal
- bin/chmem
- bin/choom
- bin/chrt
- bin/col
- bin/colcrt
- bin/colrm
- bin/column
- bin/dmesg
- bin/eject
- bin/fallocate
- bin/fincore
- bin/findmnt
- bin/flock
- bin/getopt
- bin/hardlink
- bin/hexdump
- bin/ionice
- bin/ipcmk
- bin/ipcrm
- bin/ipcs
- bin/isosize
- bin/kill
- bin/last
- bin/lastb
- bin/linux32
- bin/linux64
- bin/logger
- bin/look
- bin/lsblk
- bin/lscpu
- bin/lsfd
- bin/lsipc
- bin/lsirq
- bin/lslocks
- bin/lslogins
- bin/lsmem
- bin/lsns
- bin/mcookie
- bin/mesg
- bin/mount
- bin/mountpoint
- bin/namei
- bin/nsenter
- bin/prlimit
- bin/rename
- bin/renice
- bin/rev
- bin/script
- bin/scriptlive
- bin/scriptreplay
- bin/setarch
- bin/setsid
- bin/taskset
- bin/uclampset
- bin/umount
- bin/uname26
- bin/unshare
- bin/utmpdump
- bin/uuidgen
- bin/uuidparse
- bin/wall
- bin/wdctl
- bin/whereis
darwin:
- bin/cal
- bin/col
- bin/colcrt
- bin/colrm
- bin/column
- bin/flock
- bin/getopt
- bin/hardlink
- bin/hexdump
- bin/isosize
- bin/logger
- bin/look
- bin/mcookie
- bin/mesg
- bin/namei
- bin/rename
- bin/renice
- bin/rev
- bin/scriptreplay
- bin/setsid
- bin/uuidgen
- bin/uuidparse
- bin/wall
- bin/whereis
linux:
- bin/cal
- bin/chmem
- bin/choom
- bin/chrt
- bin/col
- bin/colcrt
- bin/colrm
- bin/column
- bin/dmesg
- bin/eject
- bin/fallocate
- bin/fincore
- bin/findmnt
- bin/flock
- bin/getopt
- bin/hardlink
- bin/hexdump
- bin/ionice
- bin/ipcmk
- bin/ipcrm
- bin/ipcs
- bin/isosize
- bin/kill
- bin/last
- bin/lastb
- bin/linux32
- bin/linux64
- bin/logger
- bin/look
- bin/lsblk
- bin/lscpu
- bin/lsfd
- bin/lsipc
- bin/lsirq
- bin/lslocks
- bin/lslogins
- bin/lsmem
- bin/lsns
- bin/mcookie
- bin/mesg
- bin/mount
- bin/mountpoint
- bin/namei
- bin/nsenter
- bin/prlimit
- bin/rename
- bin/renice
- bin/rev
- bin/script
- bin/scriptlive
- bin/scriptreplay
- bin/setarch
- bin/setsid
- bin/taskset
- bin/uclampset
- bin/umount
- bin/uname26
- bin/unshare
- bin/utmpdump
- bin/uuidgen
- bin/uuidparse
- bin/wall
- bin/wdctl
- bin/whereis
dependencies:
gnu.org/gettext: ^0
build:
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
gnu.org/autoconf: '*'
gnu.org/automake: '*'
gnu.org/gettext: '*'
gnu.org/libtool: '*'
gnu.org/bison: '*'
gnu.org/m4: '*'
freedesktop.org/pkg-config: '*'
gnu.org/patch: '*'
script: |
if test "{{hw.platform}}" != "linux"; then
echo "glibc is only supported on Linux"
touch {{prefix}}/linux-only
exit 0
if test darwin = {{hw.platform}}; then
patch -p0 <props/macports.patch # thanks to MacPorts
fi
./autogen.sh
./configure $ARGS
make --jobs {{hw.concurrency}} install
cd "{{prefix}}/include"
for x in $HEADERS; do
mv "$x/$x.h" .
ln -s "../$x.h" "$x/"
done
env:
ARGS:
- --prefix={{prefix}}
- --disable-makeinstall-chown
- --disable-makeinstall-setuid
HEADERS:
- blkid
- libfdisk
- libsmartcols
- uuid
linux:
HEADERS:
- libmount
test:
dependencies:
stedolan.github.io/jq: '*'
script: |
if test "{{hw.platform}}" = "linux"; then
test "$(echo 5 6 7 | column -tJN first,second,third | jq .table[0].second)" = '"6"'
fi
script:
test "$(echo 5 6 7 | column -tJN first,second,third | jq .table[0].second)" = '"6"'