Github messages for voidlinux
 help / color / mirror / Atom feed
From: kedodrill <kedodrill@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: insomnia-2020.4.2
Date: Thu, 03 Dec 2020 21:29:00 +0100	[thread overview]
Message-ID: <20201203202900.wLOfMJPKvKhsbXafNV98FwXCd7a7A64WMZayyeoYEc4@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26647@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1075 bytes --]

There is an updated pull request by kedodrill against master on the void-packages repository

https://github.com/kedodrill/void-packages insomnia
https://github.com/void-linux/void-packages/pull/26647

New package: insomnia-2020.4.2
Closes #11311
Closes void-linux#23948

The patches that I have made are required because the nodejs build script will first try the `preinstall` script. Since the Void nodejs version is `12.18.4` instead of `12.18.3`, it will fail. I think the minor version bump is not worth dealing with `nvm` or `n` to get that specific version, but I can change this if need be.

`ffmpeg` is required for the executable, but it provides this when creating the package.

I have tested this with the `-Q` option.
This is my first package, I mostly tried to build it around the Rocket-Chat package. Please let me know if anything can be better / needs to be changed :)

I use this package almost every day for work so I will be testing it quite frequently.

A patch file from https://github.com/void-linux/void-packages/pull/26647.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-insomnia-26647.patch --]
[-- Type: text/x-diff, Size: 9390 bytes --]

From cce9bca643acc40b8b43f42f535ccb966da3edf0 Mon Sep 17 00:00:00 2001
From: Kenneth Dodrill <kmdodrill@protonmail.com>
Date: Mon, 23 Nov 2020 10:42:54 -0600
Subject: [PATCH 1/2] Ref void-linux/issues#11311

* Add all files and patches
---
 srcpkgs/insomnia/files/insomnia               |  2 ++
 srcpkgs/insomnia/files/insomnia.desktop       | 11 ++++++++
 .../patches/remove-nodejs-version-check.patch | 14 ++++++++++
 .../patches/remove-preinstall-step.patch      | 10 +++++++
 srcpkgs/insomnia/template                     | 28 +++++++++++++++++++
 5 files changed, 65 insertions(+)
 create mode 100644 srcpkgs/insomnia/files/insomnia
 create mode 100644 srcpkgs/insomnia/files/insomnia.desktop
 create mode 100644 srcpkgs/insomnia/patches/remove-nodejs-version-check.patch
 create mode 100644 srcpkgs/insomnia/patches/remove-preinstall-step.patch
 create mode 100644 srcpkgs/insomnia/template

diff --git a/srcpkgs/insomnia/files/insomnia b/srcpkgs/insomnia/files/insomnia
new file mode 100644
index 00000000000..d9f0e988b9c
--- /dev/null
+++ b/srcpkgs/insomnia/files/insomnia
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec electron9 /usr/lib/insomnia.asar "$@"
\ No newline at end of file
diff --git a/srcpkgs/insomnia/files/insomnia.desktop b/srcpkgs/insomnia/files/insomnia.desktop
new file mode 100644
index 00000000000..73b9540c78e
--- /dev/null
+++ b/srcpkgs/insomnia/files/insomnia.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Insomnia
+Comment=Design and debug APIs like a human, not a robot.
+GenericName=The Desktop API client for REST and GraphQL
+Exec=/usr/bin/insomnia
+Icon=insomnia
+Type=Application
+StartupNotify=false
+StartupWMClass=Insomnia
+Categories=Utility;Development;
+Keywords=rest;graphql;request;
\ No newline at end of file
diff --git a/srcpkgs/insomnia/patches/remove-nodejs-version-check.patch b/srcpkgs/insomnia/patches/remove-nodejs-version-check.patch
new file mode 100644
index 00000000000..7df2dabba07
--- /dev/null
+++ b/srcpkgs/insomnia/patches/remove-nodejs-version-check.patch
@@ -0,0 +1,14 @@
+--- packages/insomnia-app/scripts/build.js	2020-10-21 06:53:51.000000000 -0500
++++ packages/insomnia-app/scripts/build.js	2020-11-22 23:28:58.338186804 -0600
+@@ -56,11 +56,6 @@
+   console.log(`[build] npm: ${childProcess.spawnSync('npm', ['--version']).stdout}`.trim());
+   console.log(`[build] node: ${childProcess.spawnSync('node', ['--version']).stdout}`.trim());
+ 
+-  if (process.version.indexOf('v12.') !== 0) {
+-    console.log('[build] Node v12.x.x is required to build');
+-    process.exit(1);
+-  }
+-
+   // Remove folders first
+   console.log('[build] Removing existing directories');
+   await emptyDir(buildFolder);
diff --git a/srcpkgs/insomnia/patches/remove-preinstall-step.patch b/srcpkgs/insomnia/patches/remove-preinstall-step.patch
new file mode 100644
index 00000000000..232bf31cc8a
--- /dev/null
+++ b/srcpkgs/insomnia/patches/remove-preinstall-step.patch
@@ -0,0 +1,10 @@
+--- package.json	2020-10-21 06:53:51.000000000 -0500
++++ package.json	2020-11-23 00:21:57.194334606 -0600
+@@ -24,7 +24,6 @@
+     "app-release": "npm run release --prefix packages/insomnia-app",
+     "storybook-start": "npm run storybook --prefix packages/insomnia-components",
+     "storybook-legacy-start": "npm run storybook --prefix packages/insomnia-app",
+-    "preinstall": "node ./scripts/check-version.js",
+     "app-build:smoke:core": "cross-env SMOKE_TEST=core npm run app-build",
+     "app-build:smoke:designer": "cross-env SMOKE_TEST=designer npm run app-build",
+     "test:smoke:core": "npm run test:core:build --prefix packages/insomnia-smoke-test",
diff --git a/srcpkgs/insomnia/template b/srcpkgs/insomnia/template
new file mode 100644
index 00000000000..d0af8d3fc1c
--- /dev/null
+++ b/srcpkgs/insomnia/template
@@ -0,0 +1,28 @@
+# Template file for 'insomnia'
+pkgname=insomnia
+version=2020.4.2
+revision=1
+archs="x86_64"
+wrksrc="insomnia-core-${version}"
+hostmakedepends="git nodejs-lts curl tar"
+makedepends="electron9 python3 libcurl-devel make fontconfig-devel"
+depends="electron9 ffmpeg"
+short_desc="Desktop API client for REST and GraphQL"
+maintainer="Kenneth Dodrill <kmdodrill@protonmail.com>"
+license="MIT"
+homepage="https://insomnia.rest"
+distfiles="https://github.com/Kong/insomnia/archive/core@${version}.tar.gz"
+checksum=0b40fc4b347b5142e7a09a6488578ea3e30d050a3efc1146d6f1e0c7aed1de0d
+
+do_build() {
+	npm run bootstrap
+	GIT_TAG="core@${version}" npm run app-package
+}
+
+do_install() {
+	vinstall "${FILESDIR}/insomnia.desktop" 644 usr/share/applications
+	vbin "$FILESDIR/insomnia"
+	vinstall packages/insomnia-app/dist/com.insomnia.app/.icon-set/icon_512.png 644 usr/share/icons/hicolor/512x512/apps insomnia.png
+	vlicense LICENSE
+	vinstall "packages/insomnia-app/dist/com.insomnia.app/linux-unpacked/resources/app.asar" 644 /usr/lib insomnia.asar
+}

From 258f6adc6488a91d4a63c1a2ad1f3929312444b2 Mon Sep 17 00:00:00 2001
From: Kenneth Dodrill <kmdodrill@protonmail.com>
Date: Thu, 3 Dec 2020 14:27:54 -0600
Subject: [PATCH 2/2] Update to 5.0 and switch template to different build
 style

* Using template more similar to Signal-Desktop now
---
 srcpkgs/insomnia/files/insomnia               |  2 --
 srcpkgs/insomnia/files/insomnia.desktop       |  2 +-
 .../patches/remove-preinstall-step.patch      |  6 ++--
 srcpkgs/insomnia/template                     | 33 ++++++++++++++-----
 4 files changed, 29 insertions(+), 14 deletions(-)
 delete mode 100644 srcpkgs/insomnia/files/insomnia

diff --git a/srcpkgs/insomnia/files/insomnia b/srcpkgs/insomnia/files/insomnia
deleted file mode 100644
index d9f0e988b9c..00000000000
--- a/srcpkgs/insomnia/files/insomnia
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec electron9 /usr/lib/insomnia.asar "$@"
\ No newline at end of file
diff --git a/srcpkgs/insomnia/files/insomnia.desktop b/srcpkgs/insomnia/files/insomnia.desktop
index 73b9540c78e..1081093ed04 100644
--- a/srcpkgs/insomnia/files/insomnia.desktop
+++ b/srcpkgs/insomnia/files/insomnia.desktop
@@ -2,7 +2,7 @@
 Name=Insomnia
 Comment=Design and debug APIs like a human, not a robot.
 GenericName=The Desktop API client for REST and GraphQL
-Exec=/usr/bin/insomnia
+Exec=insomnia
 Icon=insomnia
 Type=Application
 StartupNotify=false
diff --git a/srcpkgs/insomnia/patches/remove-preinstall-step.patch b/srcpkgs/insomnia/patches/remove-preinstall-step.patch
index 232bf31cc8a..7db2858f12b 100644
--- a/srcpkgs/insomnia/patches/remove-preinstall-step.patch
+++ b/srcpkgs/insomnia/patches/remove-preinstall-step.patch
@@ -1,5 +1,5 @@
---- package.json	2020-10-21 06:53:51.000000000 -0500
-+++ package.json	2020-11-23 00:21:57.194334606 -0600
+--- package.json	2020-12-02 09:40:05.169126515 -0600
++++ package.json	2020-12-02 09:40:51.452756863 -0600
 @@ -24,7 +24,6 @@
      "app-release": "npm run release --prefix packages/insomnia-app",
      "storybook-start": "npm run storybook --prefix packages/insomnia-components",
@@ -7,4 +7,4 @@
 -    "preinstall": "node ./scripts/check-version.js",
      "app-build:smoke:core": "cross-env SMOKE_TEST=core npm run app-build",
      "app-build:smoke:designer": "cross-env SMOKE_TEST=designer npm run app-build",
-     "test:smoke:core": "npm run test:core:build --prefix packages/insomnia-smoke-test",
+     "app-package:smoke:core": "cross-env SMOKE_TEST=core npm run app-package",
diff --git a/srcpkgs/insomnia/template b/srcpkgs/insomnia/template
index d0af8d3fc1c..f357bd3b0bb 100644
--- a/srcpkgs/insomnia/template
+++ b/srcpkgs/insomnia/template
@@ -1,28 +1,45 @@
 # Template file for 'insomnia'
 pkgname=insomnia
-version=2020.4.2
+version=2020.5.0
 revision=1
 archs="x86_64"
 wrksrc="insomnia-core-${version}"
 hostmakedepends="git nodejs-lts curl tar"
-makedepends="electron9 python3 libcurl-devel make fontconfig-devel"
-depends="electron9 ffmpeg"
+makedepends="python3 libcurl-devel make fontconfig-devel"
+depends="ffmpeg"
 short_desc="Desktop API client for REST and GraphQL"
 maintainer="Kenneth Dodrill <kmdodrill@protonmail.com>"
 license="MIT"
 homepage="https://insomnia.rest"
 distfiles="https://github.com/Kong/insomnia/archive/core@${version}.tar.gz"
-checksum=0b40fc4b347b5142e7a09a6488578ea3e30d050a3efc1146d6f1e0c7aed1de0d
+checksum=743360f5798f8e94c785b778644eaf47bff4c9c9bb0c5ca03969267cea6074c0
+nostrip_files="insomnia"
 
-do_build() {
+pre_build() {
 	npm run bootstrap
+	npm run test
+}
+
+do_build() {
 	GIT_TAG="core@${version}" npm run app-package
 }
 
 do_install() {
+	vmkdir usr/lib/insomnia
+	vcopy packages/insomnia-app/dist/com.insomnia.app/linux-unpacked/* usr/lib/insomnia
+
+    vmkdir usr/bin
+    ln -s /usr/lib/insomnia/insomnia ${DESTDIR}/usr/bin/
+    
 	vinstall "${FILESDIR}/insomnia.desktop" 644 usr/share/applications
-	vbin "$FILESDIR/insomnia"
-	vinstall packages/insomnia-app/dist/com.insomnia.app/.icon-set/icon_512.png 644 usr/share/icons/hicolor/512x512/apps insomnia.png
+
+	for size in 16 32 48 128; do
+		vinstall packages/insomnia-app/dist/com.insomnia.app/.icon-set/icon_${size}x${size}.png 644 usr/share/icons/hicolor/${size}x${size}/apps/ insomnia.png
+	done
+
+	for size in 256 512; do
+		vinstall packages/insomnia-app/dist/com.insomnia.app/.icon-set/icon_${size}.png 644 usr/share/icons/hicolor/${size}x${size}/apps/ insomnia.png
+	done
+
 	vlicense LICENSE
-	vinstall "packages/insomnia-app/dist/com.insomnia.app/linux-unpacked/resources/app.asar" 644 /usr/lib insomnia.asar
 }

  parent reply	other threads:[~2020-12-03 20:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 16:56 [PR PATCH] " kedodrill
2020-12-02 19:05 ` kedodrill
2020-12-03 16:09 ` kedodrill
2020-12-03 20:29 ` kedodrill [this message]
2020-12-03 20:31 ` kedodrill
2020-12-03 20:32 ` [PR PATCH] [Updated] " kedodrill
2020-12-03 21:51 ` kedodrill
2020-12-05  1:24 ` [PR PATCH] [Updated] New package: insomnia-2020.5.0 kedodrill
2020-12-11  0:13 ` [PR PATCH] [Updated] New package: insomnia-2020.5.1 kedodrill
2020-12-11  0:14 ` New package: insomnia-2020.5.2 kedodrill
2021-03-11  2:59 ` [PR PATCH] [Updated] " kedodrill
2021-03-28 17:33 ` [PR PATCH] [Updated] New package: insomnia-2021.1.1 kedodrill
2021-05-20 20:51 ` New package: insomnia-2021.2.1 kedodrill
2021-05-20 20:51 ` [PR PATCH] [Closed]: " kedodrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201203202900.wLOfMJPKvKhsbXafNV98FwXCd7a7A64WMZayyeoYEc4@z \
    --to=kedodrill@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).