From d4625ea63dda3f681a8240ae2a61579f834ba1e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Wed, 18 Jan 2023 07:42:49 +0700 Subject: [PATCH] WoeUSB-cli: update to 5.2.4 --- srcpkgs/WoeUSB-cli | 1 - srcpkgs/WoeUSB-cli/patches/offline.patch | 35 ++++++++++++++++++++++++ srcpkgs/WoeUSB-cli/patches/shebang.patch | 10 +++++++ srcpkgs/WoeUSB-cli/template | 28 +++++++++++++++++++ srcpkgs/WoeUSB/template | 10 ++----- 5 files changed, 76 insertions(+), 8 deletions(-) delete mode 120000 srcpkgs/WoeUSB-cli create mode 100644 srcpkgs/WoeUSB-cli/patches/offline.patch create mode 100644 srcpkgs/WoeUSB-cli/patches/shebang.patch create mode 100644 srcpkgs/WoeUSB-cli/template diff --git a/srcpkgs/WoeUSB-cli b/srcpkgs/WoeUSB-cli deleted file mode 120000 index 69ca6ca2f77..00000000000 --- a/srcpkgs/WoeUSB-cli +++ /dev/null @@ -1 +0,0 @@ -WoeUSB \ No newline at end of file diff --git a/srcpkgs/WoeUSB-cli/patches/offline.patch b/srcpkgs/WoeUSB-cli/patches/offline.patch new file mode 100644 index 00000000000..3884dc455e2 --- /dev/null +++ b/srcpkgs/WoeUSB-cli/patches/offline.patch @@ -0,0 +1,35 @@ +Index: WoeUSB-5.2.4/sbin/woeusb +=================================================================== +--- WoeUSB-5.2.4.orig/sbin/woeusb ++++ WoeUSB-5.2.4/sbin/woeusb +@@ -16,7 +16,8 @@ + # lint: We use indirections and primitive variables, which is false positive of this rule + # shellcheck disable=SC2034 + +-RUFUS_UEFI_NTFS_VERSION="${RUFUS_UEFI_NTFS_VERSION:-b30e3b387a3ca7a5e2fddebcc2c8f9538a89b868}" ++BUNDLED_RUFUS_VERSION=b30e3b387a3ca7a5e2fddebcc2c8f9538a89b868 ++RUFUS_UEFI_NTFS_VERSION="${RUFUS_UEFI_NTFS_VERSION:-${BUNDLED_RUFUS_VERSION}}" + DD_BLOCK_SIZE="${DD_BLOCK_SIZE:-$((4 * 1024 * 1024))}" # 4MiB + + # Entry point of the main code +@@ -1360,9 +1361,20 @@ install_uefi_ntfs_support_partition(){ + local -r download_directory="${1}"; shift + local -r target_device="${1}"; shift + ++ if [ "${rufus_uefi_ntfs_version}" = ${BUNDLED_RUFUS_VERSION} ]; then ++ # Write partition image to partition ++ dd \ ++ if="/usr/share/woeusb/uefi-ntfs.img" \ ++ of="${uefi_ntfs_partition}" ++ return 0 ++ fi ++ + if ! wget \ + --directory-prefix="${download_directory}" \ + "https://cdn.jsdelivr.net/gh/pbatard/rufus@${rufus_uefi_ntfs_version}/res/uefi/uefi-ntfs.img"; then ++ if ! command -v wget >/dev/null; then ++ print_warning 'wget is missing, please install wget!\n' ++ fi + print_warning \ + "Unable to download UEFI:NTFS partition image from GitHub, installation skipped. Target device might not be bootable if the UEFI firmware doesn't support NTFS filesystem.\\n" + return 0 diff --git a/srcpkgs/WoeUSB-cli/patches/shebang.patch b/srcpkgs/WoeUSB-cli/patches/shebang.patch new file mode 100644 index 00000000000..8d926d42093 --- /dev/null +++ b/srcpkgs/WoeUSB-cli/patches/shebang.patch @@ -0,0 +1,10 @@ +Index: WoeUSB-cli-5.2.4/sbin/woeusb +=================================================================== +--- WoeUSB-cli-5.2.4.orig/sbin/woeusb ++++ WoeUSB-cli-5.2.4/sbin/woeusb +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/bin/bash + # A Linux program to create bootable Windows USB stick from a real Windows DVD or an image + # + # This file is part of WoeUSB. diff --git a/srcpkgs/WoeUSB-cli/template b/srcpkgs/WoeUSB-cli/template new file mode 100644 index 00000000000..4c0cecfe8c0 --- /dev/null +++ b/srcpkgs/WoeUSB-cli/template @@ -0,0 +1,28 @@ +# Template file for 'WoeUSB-cli' +pkgname=WoeUSB-cli +version=5.2.4 +revision=1 +_rufus_uefi_ntfs_version=b30e3b387a3ca7a5e2fddebcc2c8f9538a89b868 +depends="bash grub ntfs-3g parted" +short_desc="Create a Windows USB stick installer from a real Windows DVD or image" +maintainer="Orphaned " +license="GPL-3.0-or-later" +homepage="https://github.com/WoeUSB/WoeUSB" +distfiles="https://github.com/WoeUSB/WoeUSB/archive/v${version}.tar.gz + https://cdn.jsdelivr.net/gh/pbatard/rufus@${_rufus_uefi_ntfs_version}/res/uefi/uefi-ntfs.img" +checksum="8305296d49b7b58c200f9d373eac8dd494d03442737183749a0ee166403a7e68 + e159fba61b14b20cc0c1631dcf158fb3811f084a9874d190616cb4740a0ccf9c" + +skip_extraction="uefi-ntfs.img" + +post_patch() { + vsed -i -e "s/@@WOEUSB_VERSION@@/$version/g" \ + sbin/woeusb share/man/man1/woeusb.1 +} + +do_install() { + vbin sbin/woeusb + vman share/man/man1/woeusb.1 + vinstall ${XBPS_SRCDISTDIR}/${sourcepkg}-${version}/uefi-ntfs.img \ + 644 usr/share/woeusb +} diff --git a/srcpkgs/WoeUSB/template b/srcpkgs/WoeUSB/template index 32298bc2f32..b946b52bcc1 100644 --- a/srcpkgs/WoeUSB/template +++ b/srcpkgs/WoeUSB/template @@ -24,11 +24,7 @@ pre_configure() { autoreconf -fi } -WoeUSB-cli_package() { - depends="bash grub ntfs-3g parted wget" - short_desc+=" - command line only" - pkg_install() { - vmove usr/bin/woeusb - vmove usr/share/man/man1/woeusb.1 - } +post_install() { + rm -f ${DESTDIR}/usr/bin/woeusb + rm -f ${DESTDIR}/usr/share/man/man1/woeusb.1 }