Files
BMLFS/build-scripts/libuv.build
2024-05-28 09:22:58 -05:00

67 lines
1.9 KiB
Bash

#! /bin/bash
# libUV
# Source: https://dist.libuv.org/dist/v1.48.0/libuv-v1.48.0.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: None
# Optional: None
# LTO: Tested with LLVM
# If optimizing, use these flags
# Recommended to not use LTO
export CFLAGS="-march=native -mtune=native -pipe "
export CFLAGS+="-O3 -ffat-lto-objects -flto=4 "
export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed "
# Sometimes, autogen.sh fails with a petty error. Just
# hardcode it.
#patch -Np1 -i ../patches/libuv-mlfs/autogen-hardcode.patch
export LDFLAGS+=" -pthread"
NOCONFIGURE=1 ./autogen.sh &&
./configure --prefix=/usr --disable-static $BUILDTRUPLE
read -p "Press Enter to compile" &&
make -j2 &&
unset LDFLAGS
read -p "Press Enter to install" &&
# if not using a package manager:
# make install
# if using pkgtools from Slackware, then:
sudo -E -S make DESTDIR=$BUILD install
read -p "Press Enter to create pakage description."
cd $BUILD && sudo mkdir -v install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in. You must make
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
libuv: libuv
libuv:
libuv: The libuv package is a multi-platform support library with a focus
libuv: on asynchronous I/O.
libuv:
libuv: Homepage: https://dist.libuv.org
libuv:
libuv:
libuv:
libuv:
libuv:
EOF
sudo mv /tmp/slack-desc install/ &&
read -p "Enter to build package" &&
sudo makepkg -l y -c n $PKGS/libuv-1.48.0-$PSUFFIX &&
sudo rm -rf $BUILD/*