diff options
author | tleydxdy | 2021-04-09 08:05:19 +0800 |
---|---|---|
committer | tleydxdy | 2021-04-09 08:05:19 +0800 |
commit | bf1ede2f4524c379c2010a02d9314f3827cf68f9 (patch) | |
tree | 285c842ee9e85fb680f6d869be76585da267296a | |
parent | d390f029d87ffb1d4bdbe9f92ada7021a5b6ddf3 (diff) | |
download | aur-bf1ede2f4524c379c2010a02d9314f3827cf68f9.tar.gz |
use mkinitcpio
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 30 | ||||
-rw-r--r-- | use-mkinitcpio.patch | 22 |
3 files changed, 45 insertions, 14 deletions
@@ -6,12 +6,13 @@ pkgbase = system76-power install = system76-power.install arch = any license = GPL - makedepends = git makedepends = rust depends = dbus depends = systemd depends = system76-dkms - source = system76::git+https://github.com/pop-os/system76-power.git#commit=de596615d3d1037f2377f3736a371b922e9bf0e7 - sha1sums = SKIP + source = https://github.com/pop-os/system76-power/archive/1.0.1.tar.gz + source = use-mkinitcpio.patch + sha1sums = f2e361bf8c42d2453c3c61ddf3c6c7b929dbc4ea + sha1sums = 39969f4afb7bc50c4545f44a79529a62ebb37ef2 pkgname = system76-power @@ -15,31 +15,39 @@ depends=( 'systemd' 'system76-dkms' ) -makedepends=( - 'git' - 'rust' -) +makedepends=('rust') source=( - 'system76::git+https://github.com/pop-os/system76-power.git#commit=de596615d3d1037f2377f3736a371b922e9bf0e7' - ) +"https://github.com/pop-os/${pkgname}/archive/${pkgver}.tar.gz" +'use-mkinitcpio.patch' +) sha1sums=( - 'SKIP' +'f2e361bf8c42d2453c3c61ddf3c6c7b929dbc4ea' +'39969f4afb7bc50c4545f44a79529a62ebb37ef2' ) +prepare() { + cd ${srcdir}/${pkgname}-${pkgver} + + # use mkinitcpio -P inplace of update-initramfs -u + patch --no-backup-if-mismatch -Np1 -i ${srcdir}/use-mkinitcpio.patch +} + build() { - cd ${srcdir}/${_pkgname} + cd ${srcdir}/${pkgname}-${pkgver} # Build and install base package cargo build --release } package() { + cd ${srcdir}/${pkgname}-${pkgver} + # Install daemons - install -Dm755 ${srcdir}/${_pkgname}/target/release/system76-power ${pkgdir}/usr/bin/system76-power + install -Dm755 target/release/system76-power ${pkgdir}/usr/bin/system76-power # Install systemd unit files - install -Dm644 ${srcdir}/${_pkgname}/debian/system76-power.service ${pkgdir}/usr/lib/systemd/system/system76-power.service + install -Dm644 debian/system76-power.service ${pkgdir}/usr/lib/systemd/system/system76-power.service # Install scripts and configuration - install -Dm755 ${srcdir}/${_pkgname}/data/system76-power.conf ${pkgdir}/usr/share/dbus-1/system.d/system76-power.conf + install -Dm755 data/system76-power.conf ${pkgdir}/usr/share/dbus-1/system.d/system76-power.conf } diff --git a/use-mkinitcpio.patch b/use-mkinitcpio.patch new file mode 100644 index 000000000000..68eac9504b5d --- /dev/null +++ b/use-mkinitcpio.patch @@ -0,0 +1,22 @@ +--- a/src/graphics.rs ++++ b/src/graphics.rs +@@ -58,7 +58,7 @@ pub enum GraphicsDeviceError { + Rescan(io::Error), + #[error(display = "failed to unbind {} on PCI driver {}: {}", func, driver, why)] + Unbind { func: String, driver: String, why: io::Error }, +- #[error(display = "update-initramfs failed with {} status", _0)] ++ #[error(display = "mkinitcpio failed with {} status", _0)] + UpdateInitramfs(ExitStatus), + } + +@@ -295,9 +295,9 @@ impl Graphics { + } + + info!("Updating initramfs"); +- const UPDATE_INITRAMFS_CMD: &str = "update-initramfs"; ++ const UPDATE_INITRAMFS_CMD: &str = "mkinitcpio"; + let status = process::Command::new(UPDATE_INITRAMFS_CMD) +- .arg("-u") ++ .arg("-P") + .status() + .map_err(|why| GraphicsDeviceError::Command { cmd: UPDATE_INITRAMFS_CMD, why })?; |