summaryrefslogtreecommitdiffstats
path: root/system/acpi_call/acpi_call.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/acpi_call/acpi_call.SlackBuild')
-rw-r--r--system/acpi_call/acpi_call.SlackBuild21
1 files changed, 17 insertions, 4 deletions
diff --git a/system/acpi_call/acpi_call.SlackBuild b/system/acpi_call/acpi_call.SlackBuild
index cbba19ee17..0a64efc3eb 100644
--- a/system/acpi_call/acpi_call.SlackBuild
+++ b/system/acpi_call/acpi_call.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for acpi_call
# Heavily based on virtualbox-kernel.SlackBuild
@@ -23,10 +23,13 @@
# 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=acpi_call
VERSION=${VERSION:-1.1.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
KERNEL=${KERNEL:-$(uname -r)}
KERNELPATH=${KERNELPATH:-/lib/modules/$KERNEL/build}
@@ -44,9 +47,16 @@ fi
PKG_ARCH=$ARCH
-CWD=$(pwd)
+# 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-$PKG_VERS-$PKG_ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
-PKG=${PKG:-$TMP/package-$PRGNAM}
+PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
set -e
@@ -67,6 +77,9 @@ find -L . \
patch -p0 < $CWD/fix-acpi-include.patch
patch -p0 < $CWD/fix-5.x-kernel.patch
+# Fix build with Linux >= 4.12
+sed -i 's|asm/uaccess.h|linux/uaccess.h|' acpi_call.c
+
make KDIR=$KERNELPATH
mkdir -p $PKG/lib/modules/$KERNEL/misc
@@ -81,4 +94,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
sed "s%@KERNEL@%$KERNEL%" $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKG_VERS-$PKG_ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKG_VERS-$PKG_ARCH-$BUILD$TAG.$PKGTYPE