summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author B. Watson2022-03-04 22:34:15 +0100
committer Willy Sudiarto Raharjo2022-03-07 02:45:22 +0100
commit8873450359dbca2ecdcae0f783bfb4ca7dad34a6 (patch)
treeb78f3eded546cd2422e2fe59bc6d3601a67c644a
parentff5ee4c70c6f32bc93688d08e80ba9b6e334aefe (diff)
downloadslackbuilds-8873450359dbca2ecdcae0f783bfb4ca7dad34a6.tar.gz
network/rtl8821ce: Re-added (fixed build for 15.0).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--network/rtl8821ce/README24
-rw-r--r--network/rtl8821ce/allow-kver-ksrc.patch15
-rw-r--r--network/rtl8821ce/doinst.sh1
-rw-r--r--network/rtl8821ce/git2tarxz.sh66
-rw-r--r--network/rtl8821ce/opt-for-performance.patch11
-rw-r--r--network/rtl8821ce/rtl8821ce.SlackBuild89
-rw-r--r--network/rtl8821ce/rtl8821ce.info10
-rw-r--r--network/rtl8821ce/slack-desc19
8 files changed, 235 insertions, 0 deletions
diff --git a/network/rtl8821ce/README b/network/rtl8821ce/README
new file mode 100644
index 0000000000..0c7cf68af3
--- /dev/null
+++ b/network/rtl8821ce/README
@@ -0,0 +1,24 @@
+Realtek RTL8821CE Driver maintained by Tomás Pinho for Arch Linux.
+Still, can serve Slackers as well!
+
+NOTE:
+
+ Although the driver builds for kernel 4.4.x as found in -14.2,
+ I only tested it in the field on kernel 5.4.x as found in -current.
+ Also, upstream warns that the source is targeting kernels > 4.14.
+
+To build the package for a kernel different from the running one,
+start the script setting the KERNEL variable as in:
+
+ KERNEL=4.4.14 ./rtl8821ce.SlackBuild
+
+NOTE:
+
+1. If you experience problems using this driver (e.g. a non-working
+ WiFi or Bluetooth), visit project's homepage to learn about possible
+ solutions.
+2. If you want to use this driver on -14.2, but with the kernel from
+ -current, you will need to compile the kernel yourself on -14.2.
+ Otherwise, you will run into compilation errors while building
+ the driver. I have no intent of fixing that, unless you provide me
+ with a working patch. ;-)
diff --git a/network/rtl8821ce/allow-kver-ksrc.patch b/network/rtl8821ce/allow-kver-ksrc.patch
new file mode 100644
index 0000000000..0629f749ee
--- /dev/null
+++ b/network/rtl8821ce/allow-kver-ksrc.patch
@@ -0,0 +1,15 @@
+diff --git a/Makefile b/Makefile
+index 5b5dc9a..da26fdd 100755
+--- a/Makefile
++++ b/Makefile
+@@ -1218,8 +1218,8 @@ EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
+ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
+ ARCH ?= $(SUBARCH)
+ CROSS_COMPILE ?=
+-KVER := $(shell uname -r)
+-KSRC := /lib/modules/$(KVER)/build
++KVER ?= $(shell uname -r)
++KSRC ?= /lib/modules/$(KVER)/build
+ MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
+ INSTALL_PREFIX :=
+ STAGINGMODDIR := /lib/modules/$(KVER)/kernel/drivers/staging
diff --git a/network/rtl8821ce/doinst.sh b/network/rtl8821ce/doinst.sh
new file mode 100644
index 0000000000..766ff48186
--- /dev/null
+++ b/network/rtl8821ce/doinst.sh
@@ -0,0 +1 @@
+chroot . /sbin/depmod -a @KERNEL@
diff --git a/network/rtl8821ce/git2tarxz.sh b/network/rtl8821ce/git2tarxz.sh
new file mode 100644
index 0000000000..93cbb5c498
--- /dev/null
+++ b/network/rtl8821ce/git2tarxz.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+# Create source tarball from git repo, with generated version number.
+
+# Takes one optional argument, which is the commit or tag to create a
+# tarball of. With no arg, HEAD is used.
+
+# Version number example: 0.0.1+20200227_ad7ec17
+
+# Notes:
+
+# Do not use this if you're packaging a release.
+
+# This script doesn't need to be run as root. It does need to be able
+# to write to the current directory it's run from.
+
+# Running this script twice for the same commit will NOT give identical
+# tarballs, even if the contents are identical. This is because tar
+# includes the current time in a newly-created tarball (plus there may
+# be other git-related reasons).
+
+# Once you've generated a tarball, you'll still need a place to host it.
+# Ask on the mailing list, if you don't have your own web server to
+# play with.
+
+## Config:
+# Github project and user names:
+PRGNAM=rtl8821ce
+CLONE_URL=https://github.com/tomaspinho/rtl8821ce/
+
+# For non-github projects, you might not need GITUSER, in which case
+# just omit it from the script.
+
+## End of config.
+
+set -e
+
+GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX )
+rm -rf $GITDIR
+git clone $CLONE_URL $GITDIR
+
+CWD="$( pwd )"
+cd $GITDIR
+
+if [ "$1" != "" ]; then
+ git reset --hard "$1" || exit 1
+fi
+
+GIT_SHA=$( git rev-parse --short HEAD )
+
+DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 )
+
+VERSION=${DATE}_${GIT_SHA}
+
+rm -rf .git
+find . -name .gitignore -print0 | xargs -0 rm -f
+
+cd "$CWD"
+rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz
+mv $GITDIR $PRGNAM-$VERSION
+tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION
+
+echo
+echo "Created tarball: $PRGNAM-$VERSION.tar.xz"
+echo "VERSION=\"$VERSION\""
+echo "MD5SUM=\"$( md5sum $PRGNAM-$VERSION.tar.xz | cut -d' ' -f1 )\""
diff --git a/network/rtl8821ce/opt-for-performance.patch b/network/rtl8821ce/opt-for-performance.patch
new file mode 100644
index 0000000000..636bab7f52
--- /dev/null
+++ b/network/rtl8821ce/opt-for-performance.patch
@@ -0,0 +1,11 @@
+diff --git a/Makefile b/Makefile
+index 5b5dc9a..4cfa841 100755
+--- a/Makefile
++++ b/Makefile
+@@ -1,5 +1,5 @@
+ EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
+-EXTRA_CFLAGS += -O1
++EXTRA_CFLAGS += -O2
+ #EXTRA_CFLAGS += -O3
+ #EXTRA_CFLAGS += -Wall
+ #EXTRA_CFLAGS += -Wextra
diff --git a/network/rtl8821ce/rtl8821ce.SlackBuild b/network/rtl8821ce/rtl8821ce.SlackBuild
new file mode 100644
index 0000000000..5c3f74b241
--- /dev/null
+++ b/network/rtl8821ce/rtl8821ce.SlackBuild
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+# Slackware build script for Realtek RTL8821CE Driver
+
+# Copyright 2020 Andrzej Telszewski, Szczecin
+# 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=rtl8821ce
+VERSION=${VERSION:-20211119_ca204c6}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+KERNEL=${KERNEL:-$(uname -r)}
+KERNELPATH=${KERNELPATH:-/lib/modules/${KERNEL}/build}
+PKG_VERS=${VERSION}_$(printf "%s" "${KERNEL}" | tr - _)
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$PKG_VERS-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=${PKG:-$TMP/package-$PRGNAM}
+OUTPUT=${OUTPUT:-/tmp}
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
+cd $PRGNAM-$VERSION
+
+chown -R root:root .
+chmod -R a-st,u+rwX,go-w+rX .
+
+# Optimize with -O2, inline with Slackware.
+
+patch -p1 < $CWD/opt-for-performance.patch
+
+# Allow building for kernels other than the running one.
+
+patch -p1 < $CWD/allow-kver-ksrc.patch
+
+make KVER=${KERNEL} KSRC=${KERNELPATH}
+
+mkdir -p $PKG/lib/modules/$KERNEL/kernel/drivers/net/wireless/realtek/rtlwifi/$PRGNAM
+install -m 0644 8821ce.ko $PKG/lib/modules/$KERNEL/kernel/drivers/net/wireless/realtek/rtlwifi/$PRGNAM
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$PKG_VERS
+cp -a COPYING README.md $PKG/usr/doc/$PRGNAM-$PKG_VERS
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKG_VERS/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+sed $CWD/doinst.sh -e "s%@KERNEL@%$KERNEL%" > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKG_VERS-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/network/rtl8821ce/rtl8821ce.info b/network/rtl8821ce/rtl8821ce.info
new file mode 100644
index 0000000000..d1a0ad4e94
--- /dev/null
+++ b/network/rtl8821ce/rtl8821ce.info
@@ -0,0 +1,10 @@
+PRGNAM="rtl8821ce"
+VERSION="20211119_ca204c6"
+HOMEPAGE="https://github.com/tomaspinho/rtl8821ce/"
+DOWNLOAD="https://slackware.uk/~urchlay/src/rtl8821ce-20211119_ca204c6.tar.xz"
+MD5SUM="5a5a15d526c958e94ff42332a7a15405"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Andrzej Telszewski"
+EMAIL="atelszewski@gmail.com"
diff --git a/network/rtl8821ce/slack-desc b/network/rtl8821ce/slack-desc
new file mode 100644
index 0000000000..70df3960a0
--- /dev/null
+++ b/network/rtl8821ce/slack-desc
@@ -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------------------------------------------------------|
+rtl8821ce: rtl8821ce (Realtek RTL8821CE Driver)
+rtl8821ce:
+rtl8821ce: Realtek RTL8821CE Driver maintained by Tomás Pinho for Arch Linux.
+rtl8821ce: Still, can serve Slackers as well!
+rtl8821ce:
+rtl8821ce: If you experience problems using this driver, please visit
+rtl8821ce: project's homepage to learn about possible solutions.
+rtl8821ce:
+rtl8821ce: Homepage: https://github.com/tomaspinho/rtl8821ce/
+rtl8821ce:
+rtl8821ce: