Package Details: insomnia 11.2.0-2

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: plp
Last Packager: plp
Votes: 25
Popularity: 1.62
First Submitted: 2020-10-19 17:29 (UTC)
Last Updated: 2025-06-09 12:46 (UTC)

Latest Comments

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

sardaukar commented on 2020-11-06 01:22 (UTC)

Works for me now, thanks!

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

Can confirm that @wereii's fix lets it adhere to guidelines.

However, I will defend yay here, because makepkg can set to only prepare, only build, only package, etc. Environment variables are also not going to carry over from this. This means that in order to make a proper PKGBUILD, it should be possible to build a package with each step seperated. Again, @wereii's gist does make that possible. I smell a pkgrel=7 :)

wereii commented on 2020-11-05 22:21 (UTC) (edited on 2020-11-05 22:23 (UTC) by wereii)

Bad news. Pulling & bulding the package with yay fails with

Incorrect node version installed ...

Current node version -> 14.15.0
Expected node version -> 12.18.3

Now, I made my homework and it seems that yay handles env differently then the rest(?) of aur helpers: https://github.com/Jguer/yay/issues/1004

Whatever you do in prepare with env will not transfer to other steps. With pamac or just makepkg the pkgbuild works as expected.

My solution is there https://gist.github.com/wereii/5b50c2be3f2289009827d5ef95f09708

One other thing is that you don't have to specify node version, insomnia packs .nvmrc with it and bare nvm install will look for that file in current dir.

By the way, electron-builder can also package into pacman and dir which will both produce "portable" binaries of the package (so installation that is expected to live in /opt).

Insomnia isn't using it's own custom electron version so using the system-wide electron (as docs say) seems ok, though I wonder if it's not asking for trouble down the pipe (when your system electron gets updated with breaking changes for example).

whynothugo commented on 2020-11-05 19:09 (UTC)

Thanks for your patience and your efforts maintaining this package!

luxcem commented on 2020-11-05 18:41 (UTC)

It should be good with the new version, sorry for going back and forth, thanks for all the feedbacks.

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() {