Skip to content

Instantly share code, notes, and snippets.

@the-eater
Created August 31, 2019 23:17
Show Gist options
  • Save the-eater/4d2ad42afdc6b86b6cad6f9ec66fdd5d to your computer and use it in GitHub Desktop.
Save the-eater/4d2ad42afdc6b86b6cad6f9ec66fdd5d to your computer and use it in GitHub Desktop.
pkgname = musl
license = MIT
maintainer = eater <=@eater.me>
short-desc = Musl C library
homepage = http://www.musl-libc.org/
files.source = `http://www.musl-libc.org/releases/musl-${version}.tar.gz`
build-style = gnu-configure
configure-args = --prefix=/usr --disable-gcc-wrapper
build.post {
$CC $CFLAGS $LDFLAGS -fpie `${FILESDIR}/getent.c` -o getent
$CC $CFLAGS $LDFLAGS -fpie `${FILESDIR}/getconf.c` -o getconf
$CC $CFLAGS $LDFLAGS -fpie `${FILESDIR}/iconv.c` -o iconv
}
install {
# Move everything to /usr.
vmkdir usr/lib
ln -sfr ${DESTDIR}/usr/lib ${DESTDIR}/lib
make DESTDIR=${DESTDIR} install
rm ${DESTDIR}/lib
# provide ldd
vmkdir usr/bin
ln -s /usr/lib/libc.so ${DESTDIR}/usr/bin/ldd
# additional utils from Alpine/NetBSD
vbin iconv
vbin getent
vman ${FILESDIR}/getent.1
vbin getconf
vman ${FILESDIR}/getconf.1
# Fake ldconfig
ln -s true ${DESTDIR}/usr/bin/ldconfig
# Create xbps.d(5) arch override file
vmkdir usr/share/xbps.d
echo "architecture=${XBPS_TARGET_MACHINE}" > ${DESTDIR}/usr/share/xbps.d/musl-arch.conf
vlicense COPYRIGHT
}
version 1.1.23 {
hash.source = 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
}
version 1.1.23 rev 2 {
install.post {
echo "Hello world" > /etc/motd
}
}
package `${pkgname}-devel` since 1.1.23 {
depends = "kernel-libc-headers ${sourcepkg}-${version}_${revision}"
short-desc += - development files
install {
vmove usr/include
vmove usr/lib/*.a
vmove usr/lib/*.o
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment