Package Details: insomnia 9.3.3-1

Git Clone URL: https://aur.archlinux.org/insomnia.git (read-only, click to copy)
Package Base: insomnia
Description: Cross-platform HTTP and GraphQL Client
Upstream URL: https://github.com/Kong/insomnia
Licenses: MIT
Submitter: kpcyrd
Maintainer: Gobidev
Last Packager: Gobidev
Votes: 23
Popularity: 0.004204
First Submitted: 2020-10-19 17:29 (UTC)
Last Updated: 2024-07-31 17:03 (UTC)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 8 9 Next › Last »

kescherAUR commented on 2020-11-05 18:33 (UTC)

I expected the previous comment to show up soon...

I think the init for the nvm folder can be configured to be inside srcdir.

whynothugo commented on 2020-11-05 18:15 (UTC) (edited on 2020-11-05 18:16 (UTC) by whynothugo)

This package leaves temporary files in $HOME/.nvm for the machine / user that builds the package.

PKGBUILDs should not alter the home directory of the user building, especially not leave litter behind.

kescherAUR commented on 2020-11-05 14:39 (UTC)

@luxcem No, it modifies ~/.nvm, so it interferes with all new shells.

luxcem commented on 2020-11-05 14:11 (UTC) (edited on 2020-11-05 18:46 (UTC) by luxcem)

@kescherAUR I think makepkg uses its own shell so we don't need to restore node version after the build. The env variables are only local.

kescherAUR commented on 2020-11-05 14:07 (UTC)

This fixes the build for people who haven't had nvm sourced before the build() function. Additionally, it only restores if the user hasn't changed the nvm version after the prepare() function.

diff --git a/.SRCINFO b/.SRCINFO
index d97d765..ba198a6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
 pkgbase = insomnia
        pkgdesc = Cross-platform HTTP and GraphQL Client
        pkgver = 2020.4.2
-       pkgrel = 4
+       pkgrel = 5
        url = https://github.com/Kong/insomnia
        arch = any
        license = MIT
diff --git a/PKGBUILD b/PKGBUILD
index 24a23b0..f931ef9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@

 pkgname=insomnia
 pkgver=2020.4.2
-pkgrel=4
+pkgrel=5
 _nodeversion=12.18.3
 pkgdesc="Cross-platform HTTP and GraphQL Client"
 url="https://github.com/Kong/insomnia"
@@ -39,8 +39,11 @@ build() {
   npm run bootstrap
   GIT_TAG="core@${pkgver}" npm run app-package

-  # Restore the previous node version so as not to interfere with a user's picked node version on each build
-  nvm use "$(cat "/tmp/${pkgname}-nvm-current.tmp")"
+  # Restore the previous node version if user hasn't changed it
+  source /usr/share/nvm/init-nvm.sh || [ -n "$NVM_BIN" ]
+  oldcurrent="$(cat "/tmp/${pkgname}-nvm-current.tmp")"
+  newcurrent="$(nvm current)"
+  [ "$oldcurrent" = "$newcurrent" ] && ( nvm use "$oldcurrent" || true )
 }

 package() {

sardaukar commented on 2020-11-05 13:27 (UTC)

I'll try using the fix in https://github.com/nvm-sh/nvm/issues/303#issuecomment-121086278 for the fish shell

luxcem commented on 2020-11-05 13:24 (UTC)

Thanks @kescherAUR, it seems we still have an issue with fish shell (https://github.com/nvm-sh/nvm/issues/303) but I don't see an alternative right now.

kescherAUR commented on 2020-11-05 13:12 (UTC)

This git diff:

  • Fixes the build issue (for me at least)
  • Restores a user's previously picked node version after build
diff --git a/.SRCINFO b/.SRCINFO
index e27f6a3..d97d765 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
 pkgbase = insomnia
    pkgdesc = Cross-platform HTTP and GraphQL Client
    pkgver = 2020.4.2
-   pkgrel = 3
+   pkgrel = 4
    url = https://github.com/Kong/insomnia
    arch = any
    license = MIT
diff --git a/PKGBUILD b/PKGBUILD
index c6367a1..4563957 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@

 pkgname=insomnia
 pkgver=2020.4.2
-pkgrel=3
+pkgrel=4
 _nodeversion=12.18.3
 pkgdesc="Cross-platform HTTP and GraphQL Client"
 url="https://github.com/Kong/insomnia"
@@ -19,8 +19,7 @@ source=(
 )
 b2sums=('2527045680d99d0321ce9a29f8d3e9302bd07c79d059d0a2e9c3f963d2adb45c9566668faca817a0f4913ee22728ebb8f553463ae6cdc731793520a3371d0953'
         'd2ceeb224fa3a35551b0929648d5e066da93a451a66b73373c13ed0dd89575a2482c2dc8e7499b214d0d62cca2532189dac9a681537751a5a86b592cae5686c7'
-        '7ea4aff2779267bfc5f7be5533d70b07a3da1c8bfed424c9f6cc9806fe6567a4cd40144264a8827b016e51f31c6dbb395c90aac4d333f297070213c77a0b2c9c'
-)
+        '7ea4aff2779267bfc5f7be5533d70b07a3da1c8bfed424c9f6cc9806fe6567a4cd40144264a8827b016e51f31c6dbb395c90aac4d333f297070213c77a0b2c9c')

 prepare() {
   # Use local electron version
@@ -29,14 +28,19 @@ prepare() {
   cd ${pkgname}-core-${pkgver}
   electron_version=$(electron --version | sed s/v//)
   sed -i 's/"electron": ".+"/"electron": "'"$electron_version"'"/g' packages/insomnia-app/package.json
-  source /usr/share/nvm/init-nvm.sh
+  source /usr/share/nvm/init-nvm.sh || [ -n "$NVM_BIN" ]
+  # Backup the nvm version used before
+  nvm current > "/tmp/${pkgname}-nvm-current.tmp"
   nvm install ${_nodeversion}
+  nvm use ${_nodeversion}
 }

 build() {
   cd ${pkgname}-core-${pkgver}
   npm run bootstrap
   GIT_TAG="core@${pkgver}" npm run app-package
+  # Restore the previous node version so as not to interfere with a user's picked node version on each build
+  nvm use "$(cat "/tmp/${pkgname}-nvm-current.tmp")"
 }

 package() {

kescherAUR commented on 2020-11-05 12:44 (UTC) (edited on 2020-11-05 12:44 (UTC) by kescherAUR)

After the PKGBUILD update, it still breaks as soon as nvm-init.sh is sourced.

==> Making package: insomnia 2020.4.2-3 (Do 05 Nov 2020 13:41:44)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found insomnia-2020.4.2.tar.gz
  -> Found insomnia.desktop
  -> Found insomnia.sh
==> Validating source files with b2sums...
    insomnia-2020.4.2.tar.gz ... Passed
    insomnia.desktop ... Passed
    insomnia.sh ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting insomnia-2020.4.2.tar.gz with bsdtar
==> Starting prepare()...
==> ERROR: A failure occurred in prepare().
    Aborting...

If I do the commands in prepare() and build() by hand and just package as before, it works.

dankobgd commented on 2020-11-05 12:43 (UTC)

i get an error during the build

Building insomnia...
==> Making package: insomnia 2020.4.2-3 (Thu Nov  5 13:38:57 2020)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found insomnia-2020.4.2.tar.gz
  -> Found insomnia.desktop
  -> Found insomnia.sh
==> Validating source files with b2sums...
    insomnia-2020.4.2.tar.gz ... Passed
    insomnia.desktop ... Passed
    insomnia.sh ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting insomnia-2020.4.2.tar.gz with bsdtar
bsdtar: Failed to set default locale
==> Starting prepare()...
==> ERROR: A failure occurred in prepare().
    Aborting...