blacktop / ipsw

iOS/macOS Research Swiss Army Knife
https://blacktop.github.io/ipsw
MIT License
1.98k stars 155 forks source link

AUR package fails to build and other issues #377

Closed Ranguvar closed 10 months ago

Ranguvar commented 11 months ago

What happened?

A number of issues exist with the ipsw-bin PKGBUILD. Currently it fails to build.

==> Starting package()...
install: cannot stat './ipsw': No such file or directory
==> ERROR: A failure occurred in package().
    Aborting...

How can we reproduce this?

makepkg

ipsw version

3.1.440

Search

Code of Conduct

Additional context

Please refer to AUR comments, package() step lacks cd to package folder taking into account version and architecture, and Bigorneau noted source_aarch64 looks to override each other (and has patch). Also, packaging ipswd is discussed - or a package from source should not be much more involved.

Thank you for your time.

blacktop commented 11 months ago

Thanks @Ranguvar let's get this fixed once and for all! 👍

blacktop commented 11 months ago

here are the comments for https://aur.archlinux.org/packages/ipsw-bin

Bigorneau commented on 2023-07-20 16:32 (UTC) Pin comment Hi, I just tried to build but makepkg encounter multiples issues: backup= cannot have a leading / source_aarch64 looks to override each other during package() the folder of the tarball and the LICENCE file look to have changed I tested this (don't know if there is a better way to get the current ARCH than tinkering with CHOST ...)

diff --git a/PKGBUILD b/PKGBUILD     
index 0e299a9..3093324 100644                                                                   
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,33 +3,43 @@

 pkgname='ipsw-bin'
 pkgver=3.1.369
-pkgrel=1                                                                                       
+pkgrel=2
 pkgdesc='iOS/macOS Research Swiss Army Knife'
 url='https://github.com/blacktop/ipsw'                                                         
 arch=('aarch64' 'aarch64' 'x86_64' 'x86_64')                                                   
 license=('MIT')
 provides=('ipsw')
 conflicts=('ipsw')                                                                             
-backup=('/etc/ipsw.conf') 
+backup=('etc/ipsw.conf')

-source_aarch64=("${pkgname}_${pkgver}_aarch64.tar.gz::https://github.com/blacktop/ipsw/releases/download/v3.1.369/ipsw_3.1.369_linux_arm64.tar.gz")
-sha256sums_aarch64=('10ce6a9cd6487e4a206465cdc799ce5c7ffb2459108a61f1022d1b00e117782c')
+source_aarch64=(
+    "ipsw_${pkgver}_aarch64.tar.gz::https://github.com/blacktop/ipsw/releases/download/v3.1.369/ipsw_3.1.369_linux_arm64.tar.gz"
+    "ipswd_${pkgver}_aarch64.tar.gz::https://github.com/blacktop/ipsw/releases/download/v3.1.369/ipswd_3.1.369_linux_arm64.tar.gz"
+)

-source_aarch64=("${pkgname}_${pkgver}_aarch64.tar.gz::https://github.com/blacktop/ipsw/releases/download/v3.1.369/ipswd_3.1.369_linux_arm64.tar.gz")
-sha256sums_aarch64=('9232c97f980b5ea53e96b655e404df2a9b2329bcaf49afb58a8f7bb59c130785')
+sha256sums_aarch64=(
+    '10ce6a9cd6487e4a206465cdc799ce5c7ffb2459108a61f1022d1b00e117782c'
+    '9232c97f980b5ea53e96b655e404df2a9b2329bcaf49afb58a8f7bb59c130785'
+)

-source_x86_64=("${pkgname}_${pkgver}_x86_64.tar.gz::https://github.com/blacktop/ipsw/releases/download/v3.1.369/ipsw_3.1.369_linux_x86_64.tar.gz")
-sha256sums_x86_64=('f182eaa0d7cce5a96079a1b5a485ea8826f03d0b38385e2916fe4a483a8d3b12')
+source_x86_64=(
+    "ipsw_${pkgver}_x86_64.tar.gz::https://github.com/blacktop/ipsw/releases/download/v3.1.369/ipsw_3.1.369_linux_x86_64.tar.gz"
+    "ipswd_${pkgver}_x86_64.tar.gz::https://github.com/blacktop/ipsw/releases/download/v3.1.369/ipswd_3.1.369_linux_x86_64.tar.gz"
+)

-source_x86_64=("${pkgname}_${pkgver}_x86_64.tar.gz::https://github.com/blacktop/ipsw/releases/download/v3.1.369/ipswd_3.1.369_linux_x86_64.tar.gz")
-sha256sums_x86_64=('82a46e11c2d17026599c619a7e1fa327fd82c1cd2a0c9fa96172062534b26f63')
+sha256sums_x86_64=(
+    'f182eaa0d7cce5a96079a1b5a485ea8826f03d0b38385e2916fe4a483a8d3b12'
+    '82a46e11c2d17026599c619a7e1fa327fd82c1cd2a0c9fa96172062534b26f63'
+)

 package() {
+  cd ipsw_${pkgver}_linux_${CHOST%%-*}
+
   # bin
   install -Dm755 "./ipsw" "${pkgdir}/usr/bin/ipsw"

   # license
-  install -Dm644 "./LICENSE.md" "${pkgdir}/usr/share/licenses/ipsw/LICENSE"
+  install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/ipsw/LICENSE"

   # completions
   mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
blacktop commented 11 months ago

Bigorneau commented on 2023-07-26 08:29 (UTC) Pin comment Hi, On 3.1.373-1 the package() step is still missing a way to "cd" inside the subdirectory of the tarball

% makepkg -icf
==> Making package: ipsw-bin 3.1.373-1 (mer. 26 juil. 2023 10:25:40)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found ipsw-bin_3.1.373_x86_64.tar.gz
==> Validating source_x86_64 files with sha256sums...
    ipsw-bin_3.1.373_x86_64.tar.gz ... Passed
==> Extracting sources...
  -> Extracting ipsw-bin_3.1.373_x86_64.tar.gz with bsdtar
==> Entering fakeroot environment...
==> Starting package()...
install: cannot stat './ipsw': No such file or directory
==> ERROR: A failure occurred in package().
    Aborting...

As everything is inside an arch subdirectory


% tar tf /tmp/ipswd_3.1.373_linux_x86_64.tar.gz
ipswd_3.1.373_linux_x86_64/LICENSE
ipswd_3.1.373_linux_x86_64/README.md
ipswd_3.1.373_linux_x86_64/completions/ipswd/_bash
ipswd_3.1.373_linux_x86_64/completions/ipswd/_fish
ipswd_3.1.373_linux_x86_64/completions/ipswd/_powershell
ipswd_3.1.373_linux_x86_64/completions/ipswd/_zsh
ipswd_3.1.373_linux_x86_64/config.example.yml
ipswd_3.1.373_linux_x86_64/ipswd
blacktop commented 11 months ago

This process is automated via @caarlos0 's @goreleaser (sorry to ping you Carlos so early in the triage cycle)

blacktop commented 11 months ago

Here is the responsible config

aurs:
  - ids:
      - default_archive
    homepage: https://github.com/blacktop/ipsw
    description: iOS/macOS Research Swiss Army Knife
    maintainers:
      - "Blacktop <https://github.com/blacktop>"
    license: MIT
    private_key: /Users/blacktop/.ssh/aur
    git_url: "ssh://aur@aur.archlinux.org/ipsw-bin.git"
    backup:
      - etc/ipsw.conf
    package: |-
      # bin
      install -Dm755 "./ipsw" "${pkgdir}/usr/bin/ipsw"

      # license
      install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/ipsw/LICENSE"

      # completions
      mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
      mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
      mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
      install -Dm644 "./completions/ipsw/_bash" "${pkgdir}/usr/share/bash-completion/completions/ipsw"
      install -Dm644 "./completions/ipsw/_zsh" "${pkgdir}/usr/share/zsh/site-functions/_ipsw"
      install -Dm644 "./completions/ipsw/_fish" "${pkgdir}/usr/share/fish/vendor_completions.d/ipsw.fish"

      # man pages
      install -Dm644 "./manpages/ipsw.1.gz" "${pkgdir}/usr/share/man/man1/ipsw.1.gz"

      # config
      mkdir -p "${pkgdir}/etc"
      install -Dm644 "./config.example.yml" "${pkgdir}/etc/ipsw.conf"
blacktop commented 11 months ago

Is there anything that sticks out to you @Ranguvar ?

Ranguvar commented 11 months ago

Thanks for addressing this! Nothing more than Bigorneau's notes. I have to run but I'll have a few minutes over the weekend to look at this, and potentially help create a source-based package of ipsw and the other tools - it'd be nice to help goreleaser work with Arch.

blacktop commented 11 months ago

Here is Carlos' config:

aurs:
  - homepage: https://goreleaser.com
    description: Deliver Go binaries as fast and easily as possible
    maintainers:
      - "Fernandez Ludovic <lfernandez dot dev at gmail dot com>"
      - "Carlos Alexandro Becker <carlos at becker dot software>"
    license: MIT
    private_key: "{{ .Env.AUR_KEY }}"
    git_url: "ssh://aur@aur.archlinux.org/goreleaser-bin.git"
    package: |-
      # bin
      install -Dm755 "./goreleaser" "${pkgdir}/usr/bin/goreleaser"

      # license
      install -Dm644 "./LICENSE.md" "${pkgdir}/usr/share/licenses/goreleaser/LICENSE"

      # completions
      mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
      mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
      mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
      install -Dm644 "./completions/goreleaser.bash" "${pkgdir}/usr/share/bash-completion/completions/goreleaser"
      install -Dm644 "./completions/goreleaser.zsh" "${pkgdir}/usr/share/zsh/site-functions/_goreleaser"
      install -Dm644 "./completions/goreleaser.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/goreleaser.fish"

      # man pages
      install -Dm644 "./manpages/goreleaser.1.gz" "${pkgdir}/usr/share/man/man1/goreleaser.1.gz"

Seems identical to mine 🤔

blacktop commented 11 months ago

I think this is due to me having the:

wrap_in_directory: true for the archives adding an additional folder.

blacktop commented 11 months ago

Created an issue here https://github.com/goreleaser/goreleaser/issues/4500

caarlos0 commented 11 months ago

fixed the issue, but it'll only affect auto-generated aurs.package... you can add the directory to yours, e.g.:

-install -Dm755 "./ipsw" "${pkgdir}/usr/bin/ipsw"
+install -Dm755 "./ipsw/ipsw" "${pkgdir}/usr/bin/ipsw"
blacktop commented 11 months ago

@Ranguvar let me know if that fixed it, if not I'll remove the wrap_in_directory

blacktop commented 10 months ago

@Ranguvar ping :)

Ranguvar commented 10 months ago

Working great for me! Not tested on AArch64 though.