+git-quick-stats+libbsd+libmd+util-linux (#153)

* +git-quick-stats

* +libbsd+util-linux+libmd

* Update package.yml

* fix tests
This commit is contained in:
Jacob Heider 2023-01-30 03:00:29 -05:00 committed by GitHub
parent a1242a0085
commit 6b4c77cc10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 226 additions and 0 deletions

View file

@ -0,0 +1,32 @@
distributable:
url: https://libbsd.freedesktop.org/releases/libbsd-{{version}}.tar.xz
strip-components: 1
versions:
github: freedesktop/libbsd/tags
provides:
- bin/column
build:
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
hadrons.org/libmd: '*'
script: |
if test "{{hw.platform}}" != "linux"; then
echo "libbsd is only supported on Linux"
touch {{prefix}}/linux-only
exit 0
fi
./configure --prefix={{prefix}}
make --jobs {{hw.concurrency}} install
test:
dependencies:
gnu.org/binutils: '*'
script: |
if test "{{hw.platform}}" = "linux"; then
nm {{prefix}}/lib/libbsd.so.{{version.major}} | grep strtonum
fi

View file

@ -0,0 +1,28 @@
distributable:
url: https://github.com/arzzen/git-quick-stats/archive/refs/tags/{{ version }}.tar.gz
strip-components: 1
versions:
github: arzzen/git-quick-stats
strip: /^Version /
provides:
- bin/git-quick-stats
dependencies:
git-scm.org: '*'
gnu.org/bash: '*'
linux:
# bin/column
github.com/util-linux/util-linux: '*'
build:
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
script: make PREFIX={{prefix}} install
test: make test
test: |
git clone https://github.com/teaxyz/cli
git -C cli quick-stats -T

View file

@ -0,0 +1,106 @@
distributable:
url: https://github.com/util-linux/util-linux/archive/refs/tags/v{{ version }}.tar.gz
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
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: '*'
script: |
if test "{{hw.platform}}" != "linux"; then
echo "glibc is only supported on Linux"
touch {{prefix}}/linux-only
exit 0
fi
./autogen.sh
./configure $ARGS
make --jobs {{hw.concurrency}} install
env:
ARGS:
- --prefix={{prefix}}
- --disable-makeinstall-chown
- --disable-makeinstall-setuid
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

View file

@ -0,0 +1,47 @@
distributable:
url: https://archive.hadrons.org/software/libmd/libmd-{{ version }}.tar.xz
strip-components: 1
versions:
github: guillemj/libmd/tags
build:
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
gnu.org/patch: '*'
script: |
# Combats "error: aliases are not supported on darwin"
patch -p1 <props/patch-symbol-alias.diff
./configure --prefix={{prefix}}
make --jobs {{hw.concurrency}} install
test:
dependencies:
tea.xyz/gx/cc: c99
script: |
mv $FIXTURE test.c
cc test.c -lmd -o test
test $(./test) = "900150983cd24fb0d6963f7d28e17f72"
fixture: |
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <md5.h>
int main() {
MD5_CTX ctx;
uint8_t results[MD5_DIGEST_LENGTH];
char *buf;
buf = "abc";
int n;
n = strlen(buf);
MD5Init(&ctx);
MD5Update(&ctx, (uint8_t *)buf, n);
MD5Final(results, &ctx);
for (n = 0; n < MD5_DIGEST_LENGTH; n++)
printf("%02x", results[n]);
putchar('\n');
return EXIT_SUCCESS;
}

View file

@ -0,0 +1,13 @@
--- a/src/local-link.h 2021-01-02 16:26:30.000000000 +0100
+++ b/src/local-link.h 2021-04-10 22:30:38.000000000 +0200
@@ -39,9 +39,9 @@
* Instead we use normal function wrapper in those cases, which are way more
* maintainable.
*/
-#ifndef _MSC_VER
+#if !defined(_MSC_VER) && !defined(__APPLE__)
#define libmd_alias(alias, symbol) \
extern __typeof(symbol) alias __attribute__((__alias__(#symbol)))
#endif
#ifdef __ELF__