]> git.t-rg.ws Git - slackbuilds.git/commitdiff
buf: added as a dependency for dart-sass
authorfsLeg <fsleg@t-rg.ws>
Sat, 7 Jun 2025 12:36:17 +0000 (15:36 +0300)
committerfsLeg <fsleg@t-rg.ws>
Sat, 7 Jun 2025 12:36:17 +0000 (15:36 +0300)
buf/README [new file with mode: 0644]
buf/buf.SlackBuild [new file with mode: 0644]
buf/buf.info [new file with mode: 0644]
buf/slack-desc [new file with mode: 0644]

diff --git a/buf/README b/buf/README
new file mode 100644 (file)
index 0000000..3d82064
--- /dev/null
@@ -0,0 +1,11 @@
+The buf CLI is the best tool for working with Protocol Buffers. It
+provides:
+
+- A linter that enforces good API design choices and structure.
+- A breaking change detector that enforces compatibility at the source
+  code or wire level.
+- A generator that invokes your plugins based on configuration files.
+- A formatter that formats your Protobuf files in accordance with
+  industry standards.
+- Integration with the Buf Schema Registry, including full dependency
+  management. 
diff --git a/buf/buf.SlackBuild b/buf/buf.SlackBuild
new file mode 100644 (file)
index 0000000..7e0ab63
--- /dev/null
@@ -0,0 +1,118 @@
+#!/bin/bash
+
+# Slackware build script for buf
+
+# Copyright 2025 Vladislav 'fsLeg' Borisov, Moscow, Russia
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS 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 AUTHOR 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.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=buf
+VERSION=${VERSION:-1.54.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+  case "$( uname -m )" in
+    i?86) ARCH=i586 ;;
+    arm*) ARCH=arm ;;
+       *) ARCH=$( uname -m ) ;;
+  esac
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+  echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+  exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+  SLKCFLAGS="-O2 -fPIC"
+elif [ "$ARCH" = "aarch64" ]; then
+  SLKCFLAGS="-O2 -fPIC"
+else
+  SLKCFLAGS="-O2"
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+
+tar xf $CWD/$PRGNAM-$VERSION-vendored-sources.tar.xz
+mkdir build
+CGO_CPPFLAGS="${SLKCFLAGS}" \
+CGO_CFLAGS="${SLKCFLAGS}" \
+CGO_CXXFLAGS="${SLKCFLAGS}" \
+GOPATH=$(pwd)/cache \
+go build -v \
+  -buildmode=pie \
+  -mod=readonly \
+  -mod=vendor \
+  -modcacherw \
+  -ldflags "-compressdwarf=false \
+            -linkmode external \
+            -extldflags '${LDFLAGS}'" \
+  -o build \
+  ./cmd/...
+
+# generate manpages
+mkdir -p build/manpages
+./build/buf manpages build/manpages
+
+install -vDm755 -t "$PKG/usr/bin" build/{buf,protoc-gen-buf-lint,protoc-gen-buf-breaking}
+install -vDm644 -t "$PKG/usr/man/man1" build/manpages/*
+
+# Strip binaries and libraries
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+  CHANGELOG.md LICENSE README.md \
+  $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+# Copy the slack-desc into ./install
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+# Make the package
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/buf/buf.info b/buf/buf.info
new file mode 100644 (file)
index 0000000..9cdc27b
--- /dev/null
@@ -0,0 +1,12 @@
+PRGNAM="buf"
+VERSION="1.54.0"
+HOMEPAGE="https://buf.build/"
+DOWNLOAD="https://github.com/bufbuild/buf/archive/v1.54.0/buf-1.54.0.tar.gz \
+          https://sbo.t-rg.ws/buf-1.54.0-vendored-sources.tar.xz"
+MD5SUM="2869866e74036e973a60cd782f4fd178 \
+        89084ec201a2af87f60968e297609d18"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Vladislav 'fsLeg' Borisov"
+EMAIL="fsleg@t-rg.ws"
diff --git a/buf/slack-desc b/buf/slack-desc
new file mode 100644 (file)
index 0000000..e253d9a
--- /dev/null
@@ -0,0 +1,19 @@
+# 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------------------------------------------------------|
+buf: buf (The best way of working with Protocol Buffers.)
+buf:
+buf: The buf CLI is the best tool for working with Protocol Buffers. It
+buf: provides a linter, a breaking change detector, a generator,
+buf: a formatter, integration with the Buf Schema Registry, including full
+buf: dependency management.
+buf:
+buf: Homepage: https://buf.build/
+buf:
+buf:
+buf: