Files
BMLFS/build-scripts/libusb.build
2025-07-22 17:19:22 -05:00

54 lines
1.7 KiB
Bash

#! /bin/bash
# libusb
# Source: https://github.com/libusb/libusb/releases/download/v1.0.29/libusb-1.0.29.tar.bz2
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: Doxygen
# If coptimizing:
export CFLAGS="-march=native -mtune=native -pipe "
export CFLAGS+="-O3 -Os -fdata-sections -ffat-lto-objects "
export CFLAGS+="-ffunction-sections -flto=4 -fno-semantic-interposition "
export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed "
sed -i "s/^PROJECT_LOGO/#&/" doc/doxygen.cfg.in &&
export PVER="1.0.29"
./configure --prefix=/usr --disable-static $BUILDTRUPLE &&
read -p "Compile?" && make -j1 &&
sudo -S make DESTDIR=$BUILD install &&
cd $BUILD && sudo -S mkdir -v ${BUILD}/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 ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
libusb: libusb (USB library)
libusb:
libusb: This is libusb, a library which allows userspace application access
libusb: to USB devices. It is used to connect to USB devices like scanners
libusb: and printers.
libusb:
libusb: http://libusb.org
libusb:
libusb:
libusb:
libusb:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libusb-$PVER-$PSUFFIX &&
sudo -S rm -rf ${BUILD}/*