diff options
author | Eric Hameleers <alien@slackware.com> | 2023-03-06 21:55:56 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2023-03-06 21:55:56 +0000 |
commit | 1116323a66104723c78dd699ed3ff0a67e63e1a5 (patch) | |
tree | 145b109a6e0149197c1d69abf9b42420128d820a /chromium | |
parent | e7b5929d0df32d4905f4a606791cdc0486436cc2 (diff) | |
download | asb-1116323a66104723c78dd699ed3ff0a67e63e1a5.tar.gz asb-1116323a66104723c78dd699ed3ff0a67e63e1a5.tar.xz |
Initial revision
Diffstat (limited to 'chromium')
-rw-r--r-- | chromium/build/google-clang.build | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/chromium/build/google-clang.build b/chromium/build/google-clang.build new file mode 100644 index 00000000..8117495e --- /dev/null +++ b/chromium/build/google-clang.build @@ -0,0 +1,81 @@ +# $Id$ +# Copyright 2023 Eric Hameleers, Eindhoven, NL +# All rights reserved. +# +# Permission to use, copy, modify, and distribute this software for +# any purpose with or without fee is hereby granted, provided that +# the above copyright notice and this permission notice appear in all +# copies. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# ----------------------------------------------------------------------------- +# Extract the custom-built clang into its own package; +# this script must be sourced from within chromium.SlackBuild. +# ----------------------------------------------------------------------------- + +# Determine clang and associated chromium major versions: +CLANGMAJ=$(grep "^ *RELEASE_VERSION *=" $TMP/tmp-$PRGNAM/$SRCNAM-$VERSION/tools/clang/scripts/update.py |cut -d= -f2 |tr -d "' ") +CHRMAJ=$(echo $VERSION |cut -d. -f1) + +# Name and version of our packaged compiler: +PRGNAM2="google-clang" +VERSION2="${CLANGMAJ}_chromium${CHRMAJ}" + +CURDIR="$(pwd)" + +# We need these directories: +mkdir -p $TMP/package-${PRGNAM2}/{etc/profile.d,install} +mkdir -p $TMP/package-${PRGNAM2}/opt/$PRGNAM2-$VERSION2/{include,lib} + +# Copy the binaries to the package directory: +rsync -a $TMP/tmp-$PRGNAM/$SRCNAM-$VERSION/third_party/llvm-build/Release+Asserts/bin $TMP/package-${PRGNAM2}/opt/$PRGNAM2-$VERSION2/ +rsync -a $TMP/tmp-$PRGNAM/$SRCNAM-$VERSION/third_party/llvm-build/Release+Asserts/include/llvm $TMP/package-${PRGNAM2}/opt/$PRGNAM2-$VERSION2/include/ +rsync -a $TMP/tmp-$PRGNAM/$SRCNAM-$VERSION/third_party/llvm-build/Release+Asserts/lib/*.a $TMP/package-${PRGNAM2}/opt/$PRGNAM2-$VERSION2/lib/ +rsync -a $TMP/tmp-$PRGNAM/$SRCNAM-$VERSION/third_party/llvm-build/Release+Asserts/lib/*.so* $TMP/package-${PRGNAM2}/opt/$PRGNAM2-$VERSION2/lib/ + +# Add a package description: +cat <<EOT > $TMP/package-${PRGNAM2}/install/slack-desc +# 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------------------------------------------------------| +google-clang: google-clang (LLVM compiler toolkit) +google-clang: +google-clang: google-clang is a custom LLVM ${CLANGMAJ} clang compiler +google-clang: patched by Google and the only supported compiler +google-clang: for building Chromium ${CHRMAJ}. +google-clang: +google-clang: +google-clang: See: +google-clang: https://chromium.googlesource.com/chromium/src/+/main/docs/clang.md +google-clang: LLVM homepage: http://llvm.org/ +google-clang: +EOT +cat <<EOT > $TMP/package-${PRGNAM2}/etc/profile.d/${PRGNAM2}.sh +#!/bin/sh +export PATH="/opt/$PRGNAM2-$VERSION2/bin:\${PATH}" +EOT +chmod 0644 $TMP/package-${PRGNAM2}/etc/profile.d/${PRGNAM2}.sh + +# Create the package: +cd $TMP/package-${PRGNAM2}/ +/sbin/makepkg --linkadd y --chown n $TMP/$PRGNAM2-$VERSION2-$ARCH-1alien.txz + +# Back to original directory: +cd "${CURDIR}" |