#! /bin/bash # LibXML2 # Source: https://download.gnome.org/sources/libxml2/2.14/libxml2-2.14.3.tar.xz # # $BUILD = Directory to temporarily install # $PKGS = Directory to store built packages # # DEPS # Required: NONE # Recommended: NONE # Optional: Python2, ICU, Valgrind # LTO: Tested with LLVM # If optimizing, use these flags export CFLAGS="-march=native -mtune=native -pipe " export CFLAGS+="-O3 -falign-functions=32 -ffat-lto-objects -flto=4 " export CFLAGS+="-fno-math-errno -fno-semantic-interposition " export CFLAGS+="-fno-trapping-math -fstack-protector-strong -fzero-call-used-regs=used " export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed " # Optimize with PGO -- need refinement, more research #export FCFLAGS="$FFLAGS -O3 -falign-functions=32 -ffat-lto-objects -flto=4 " #export FCFLAGS+="-fno-math-errno -fno-semantic-interposition -fno-trapping-math " #export FCFLAGS+="-fstack-protector-strong -fzero-call-used-regs=used " #export FFLAGS="$FCFLAGS" #export CFLAGS_GENERATE="$CFLAGS -fprofile-generate -fprofile-dir=/var/tmp/pgo " #export CFLAGS_GENERATE+="-fprofile-update=atomic " #export FCFLAGS_GENERATE="$CFLAGS_GENERATE" #export FFLAGS_GENERATE="$CFLAGS_GENERATE" #export CXXFLAGS_GENERATE="$$CFLAGS_GENERATE" #export LDFLAGS_GENERATE="$LDFLAGS -fprofile-generate -fprofile-dir=/var/tmp/pgo " #export LDFLAGS_GENERATE+="-fprofile-update=atomic " #export CFLAGS_USE="$CFLAGS -fprofile-use -fprofile-dir=/var/tmp/pgo -fprofile-correction " #export FCFLAGS_USE="$FCFLAGS -fprofile-use -fprofile-dir=/var/tmp/pgo -fprofile-correction " #export FFLAGS_USE="$FFLAGS -fprofile-use -fprofile-dir=/var/tmp/pgo -fprofile-correction " #export CXXFLAGS_USE="$CXXFLAGS -fprofile-use -fprofile-dir=/var/tmp/pgo -fprofile-correction " #export LDFLAGS_USE="$LDFLAGS -fprofile-use -fprofile-dir=/var/tmp/pgo -fprofile-correction " export PVER="2.14.3" #CFLAGS="${CFLAGS_GENERATE}" \ #CXXFLAGS="${CXXFLAGS_GENERATE}" \ #FFLAGS="${FFLAGS_GENERATE}" \ #FCFLAGS="${FCFLAGS_GENERATE}" \ #LDFLAGS="${LDFLAGS_GENERATE}" \ ./configure --prefix=/usr \ --disable-static \ --with-history \ --with-python=/usr/bin/python3 \ --with-icu --with-threads $BUILDTRUPLE && read -p "Compile?" && make -j2 && # If not using any package manager: #read -p "Install?" && sudo -S make install sudo -S make DESTDIR=${BUILD} install && sudo -S mkdir -pv ${BUILD}/install && cd $BUILD && 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------------------------------------------------------| libxml2: libxml2 (XML parser library) libxml2: libxml2: Libxml2 is the XML C parser library and toolkit. XML itself is a libxml2: metalanguage to design markup languages -- i.e. a text language where libxml2: structures are added to the content using extra "markup" information libxml2: enclosed between angle brackets. HTML is the most well-known markup libxml2: language. Though the library is written in C, a variety of language libxml2: bindings make it available in other environments. libxml2: libxml2: libxml2: EOF sudo -S mv -v /tmp/slack-desc install/ && sudo mkdir -pv /BMAN/install sudo mkdir -pv /BMAN/usr/share 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------------------------------------------------------| libxml2-doc: Manuals for libxml2 (XML parser library) libxml2-doc: libxml2-doc: Libxml2 is the XML C parser library and toolkit. XML itself is a libxml2-doc: metalanguage to design markup languages -- i.e. a text language where libxml2-doc: structures are added to the content using extra "markup" information libxml2-doc: enclosed between angle brackets. HTML is the most well-known markup libxml2-doc: language. Though the library is written in C, a variety of language libxml2-doc: bindings make it available in other environments. libxml2-doc: libxml2-doc: EOF sudo -S mv -v /tmp/slack-desc /BMAN/install/ sudo mv usr/share/doc /BMAN/usr/share/ sudo mv usr/share/gtk-doc /BMAN/usr/share/ sudo mv usr/share/man /BMAN/usr/share/ sudo -S makepkg -l y -c n $PKGS/libxml2-$PVER-${PSUFFIX} && cd /BMAN sudo -S makepkg -l y -c n $PKGS/libxml2-doc-$PVER-${NOPSUFFIX} sudo -S rm -rf ${BUILD}/* unset PVER