diff options
author | Tiago de Paula | 2023-03-01 05:06:08 -0300 |
---|---|---|
committer | Tiago de Paula | 2023-03-01 11:48:05 -0300 |
commit | 67f5d4804887708274a6573f6a229cf3efbf58fb (patch) | |
tree | 096834786d3e86ff6c0b730459b25391cdf116e3 | |
parent | a61697b3d9394dd9d74167fb47ac80a934b58702 (diff) | |
download | aur-67f5d4804887708274a6573f6a229cf3efbf58fb.tar.gz |
Move all source modifications to prepare stage
Apply modifications as patches, which are more robust to source
updates.
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 73 | ||||
-rw-r--r-- | drop-etc-files.patch | 38 | ||||
-rw-r--r-- | rename-marker.patch | 10 |
4 files changed, 95 insertions, 34 deletions
@@ -4,11 +4,15 @@ pkgbase = xpadneo-dkms pkgrel = 2 url = https://github.com/atar-axis/xpadneo arch = any - license = GPL + license = GPL3 depends = dkms depends = bluez depends = bluez-utils - source = xpadneo-dkms-0.9.5.tar.gz::https://github.com/atar-axis/xpadneo/archive/v0.9.5.tar.gz + source = xpadneo-0.9.5.tar.gz::https://github.com/atar-axis/xpadneo/archive/v0.9.5.tar.gz + source = drop-etc-files.patch + source = rename-marker.patch b2sums = d04a3e1b626af1f1a9ec114f0a8ed44c50ec8cde9da71483491d1afd7688611fd7548186ea68ef8a144aecec06acba816e81e9f0708c8dceb96fa1d40985bb44 + b2sums = e300dae73905e3223091fe2428c981ecce4c205262d1a5094e0a0b72e50fa37c85486de2c643e6206bf59cb6add727bf8a66c241e8a4674dab79e3109d673d9b + b2sums = 7f4844b39131d1a8a07a0dc293fc5ef36bc577cc4dbef29479957ae65452191f2f492703e1c90a272f7033895a4df568bb7e716f1ceb6725fc9f84777e43fc03 pkgname = xpadneo-dkms @@ -3,40 +3,49 @@ # Contributor: katt <magunasu.b97@gmail.com> # Contributor: Yangtse Su <i@yangtse.me> -pkgname=xpadneo-dkms +_pkgname=xpadneo +_dkmsname=hid-${_pkgname} +pkgname=${_pkgname}-dkms pkgver=0.9.5 pkgrel=2 -pkgdesc='Advanced Linux Driver for Xbox One Wireless Gamepad' -arch=(any) -url=https://github.com/atar-axis/xpadneo -license=(GPL) -depends=(dkms bluez bluez-utils) -source=("${pkgname}-${pkgver}.tar.gz::https://github.com/atar-axis/xpadneo/archive/v$pkgver.tar.gz") -b2sums=('d04a3e1b626af1f1a9ec114f0a8ed44c50ec8cde9da71483491d1afd7688611fd7548186ea68ef8a144aecec06acba816e81e9f0708c8dceb96fa1d40985bb44') +pkgdesc="Advanced Linux Driver for Xbox One Wireless Gamepad" +arch=('any') +url='https://github.com/atar-axis/xpadneo' +license=('GPL3') +depends=('dkms' 'bluez' 'bluez-utils') +source=("${_pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz" + drop-etc-files.patch + rename-marker.patch) +b2sums=('d04a3e1b626af1f1a9ec114f0a8ed44c50ec8cde9da71483491d1afd7688611fd7548186ea68ef8a144aecec06acba816e81e9f0708c8dceb96fa1d40985bb44' + 'e300dae73905e3223091fe2428c981ecce4c205262d1a5094e0a0b72e50fa37c85486de2c643e6206bf59cb6add727bf8a66c241e8a4674dab79e3109d673d9b' + '7f4844b39131d1a8a07a0dc293fc5ef36bc577cc4dbef29479957ae65452191f2f492703e1c90a272f7033895a4df568bb7e716f1ceb6725fc9f84777e43fc03') + +prepare() { + cd "${_pkgname}-${pkgver}/${_dkmsname}" + + # Upstream uses dkms.post_install to create modprobe and udev files in + # /etc. In Arch, it makes more sense to create these files in /usr/lib + # and let pacman take care of them. + patch -p1 -i "${srcdir}/drop-etc-files.patch" + + # Set the current version in DKMS config file. + patch -p1 -i "${srcdir}/rename-marker.patch" + sed "s/@PACKAGE_VERSION@/${pkgver}/" dkms.conf.in > dkms.conf +} package() { - cd "xpadneo-${pkgver}/hid-xpadneo" - - ## DKMS source files - install -D -m0644 Makefile -t "${pkgdir}"/usr/src/"hid-xpadneo-${pkgver}" - install -D -m0644 src/* -t "${pkgdir}"/usr/src/"hid-xpadneo-${pkgver}"/src - - ## DKMS config file - sed "s/\"@DO_NOT_CHANGE@\"/\"${pkgver}\"/g" dkms.conf.in |\ - install -D -m0644 /dev/stdin "${pkgdir}"/usr/src/"hid-xpadneo-${pkgver}"/dkms.conf - - ## DKMS post scripts - # - # The last 10 lines are removed since they are responsible for copying modprobe and udev files - # at DKMS install time. In Arch Linux, it makes more sense to let pacman handle these files. - head -n -10 dkms.post_install |\ - install -D -m0755 /dev/stdin "${pkgdir}"/usr/src/"hid-xpadneo-${pkgver}"/dkms.post_install - head -n -10 dkms.post_remove |\ - install -D -m0755 /dev/stdin "${pkgdir}"/usr/src/"hid-xpadneo-${pkgver}"/dkms.post_remove - - ## Modprobe and udev rules - # - # No need to reaload rules manually, as pacman already has a hook for that. - install -D -m0644 etc-modprobe.d/*.conf -t "${pkgdir}"/usr/lib/modprobe.d - install -D -m0644 etc-udev-rules.d/*.rules -t "${pkgdir}"/usr/lib/udev/rules.d + cd "${_pkgname}-${pkgver}/${_dkmsname}" + + # Module source + install -Dm0644 -t "${pkgdir}/usr/src/${_dkmsname}-${pkgver}/src" src/* + + # DKMS files + install -Dm0644 -t "${pkgdir}/usr/src/${_dkmsname}-${pkgver}" Makefile dkms.conf dkms.post_install dkms.post_remove + install -Dm0755 -t "${pkgdir}/usr/src/${_dkmsname}-${pkgver}" dkms.post_install dkms.post_remove + + # modprobe aliases + install -Dm0644 -t "${pkgdir}/usr/lib/modprobe.d" etc-modprobe.d/* + + # udev rules + install -Dm0644 -t "${pkgdir}/usr/lib/udev/rules.d" etc-udev-rules.d/* } diff --git a/drop-etc-files.patch b/drop-etc-files.patch new file mode 100644 index 000000000000..2e4d3c831fef --- /dev/null +++ b/drop-etc-files.patch @@ -0,0 +1,38 @@ +diff -crB hid-xpadneo/dkms.post_install hid-xpadneo.new/dkms.post_install +*** hid-xpadneo/dkms.post_install 2023-03-01 02:13:11.483605532 -0300 +--- hid-xpadneo.new/dkms.post_install 2023-03-01 03:21:07.876809434 -0300 +*************** +*** 21,33 **** + echo "Y" >"${DISABLE_ERTM}" + fi + fi +- +- echo "Installing modalias database..." +- install -D -m 0644 -t /etc/modprobe.d etc-modprobe.d/xpadneo.conf +- +- echo "Installing udev rules..." +- install -D -m 0644 -t /etc/udev/rules.d etc-udev-rules.d/50-xpadneo-fixup-steamlink.rules +- install -D -m 0644 -t /etc/udev/rules.d etc-udev-rules.d/60-xpadneo.rules +- +- echo "Reloading udev..." +- udevadm control --reload +--- 21,23 ---- +diff -crB hid-xpadneo/dkms.post_remove hid-xpadneo.new/dkms.post_remove +*** hid-xpadneo/dkms.post_remove 2023-03-01 02:13:11.483605532 -0300 +--- hid-xpadneo.new/dkms.post_remove 2023-03-01 03:21:11.027791943 -0300 +*************** +*** 4,16 **** + ERTM_OVERRIDE="/etc/modprobe.d/99-xpadneo-bluetooth.conf" + + [ -L "${ERTM_OVERRIDE}" ] || { echo "Uninstalling ERTM override..."; rm -f "${ERTM_OVERRIDE}"; } +- +- echo "Uninstalling modalias database..." +- rm -f /etc/modprobe.d/xpadneo.conf +- +- echo "Uninstalling udev rules..." +- rm -f /etc/udev/rules.d/60-xpadneo.rules +- rm -f /etc/udev/rules.d/50-xpadneo-fixup-steamlink.rules +- +- echo "Reloading udev..." +- udevadm control --reload +--- 4,6 ---- diff --git a/rename-marker.patch b/rename-marker.patch new file mode 100644 index 000000000000..07f5d1c6a3fd --- /dev/null +++ b/rename-marker.patch @@ -0,0 +1,10 @@ +diff -aur hid-xpadneo/dkms.conf.in hid-xpadneo.new/dkms.conf.in +--- hid-xpadneo/dkms.conf.in 2022-11-29 23:43:54.472158200 -0300 ++++ hid-xpadneo.new/dkms.conf.in 2023-03-01 03:29:28.753210314 -0300 +@@ -1,5 +1,5 @@ + PACKAGE_NAME="hid-xpadneo" +-PACKAGE_VERSION="@DO_NOT_CHANGE@" ++PACKAGE_VERSION="@PACKAGE_VERSION@" + BUILT_MODULE_NAME[0]="hid-xpadneo" + BUILT_MODULE_LOCATION[0]="src" + DEST_MODULE_LOCATION[0]="/kernel/drivers/hid" |