All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/openlayers: bump to version 7.0.0
@ 2022-08-25 15:12 Thomas Claveirole
  2022-08-27  9:36 ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Claveirole @ 2022-08-25 15:12 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Claveirole

Do not rely on the "dist" archive anymore (or the "legacy" archive as
OpenLayers calls it now).  Build the JavaScript directly from the
source archive instead, using host-nodejs.

Note that the v6.14.1-dist.zip archive for the previous version did
change, hence the hash for previous version is broken.  See
https://github.com/openlayers/openlayers/issues/14053 for details.

Signed-off-by: Thomas Claveirole <thomas.claveirole@green-communications.fr>
---
 package/openlayers/Config.in       |  5 +++++
 package/openlayers/openlayers.hash |  3 ++-
 package/openlayers/openlayers.mk   | 27 ++++++++++++++++-----------
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/package/openlayers/Config.in b/package/openlayers/Config.in
index a7b7f334cf..55ce17ecb7 100644
--- a/package/openlayers/Config.in
+++ b/package/openlayers/Config.in
@@ -1,5 +1,10 @@
 config BR2_PACKAGE_OPENLAYERS
 	bool "openlayers"
+
+	depends on BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS # host-nodejs
+	depends on BR2_HOST_GCC_AT_LEAST_8 # host-nodejs
+	select BR2_PACKAGE_HOST_NODEJS
+
 	help
 	  OpenLayers makes it easy to put a dynamic map in any web
 	  page. It can display map tiles, vector data and markers
diff --git a/package/openlayers/openlayers.hash b/package/openlayers/openlayers.hash
index 1c93b9a729..e1fa859e14 100644
--- a/package/openlayers/openlayers.hash
+++ b/package/openlayers/openlayers.hash
@@ -1,2 +1,3 @@
 # Locally computed:
-sha256  8a9fda6e392688c049ebb88fb2c73b5788b4965b625443de4cca7d4688b1fb82  v6.14.1-dist.zip
+sha256  290568a9f1243fbbf21a1140f1763399a4126cd3e6c308892507c2d5fc9601e7  openlayers-7.0.0.tar.gz
+sha256  6c4347b83a8c9feef18d57b18e3b6c44cf901b3c344a4a1fbd837e421555ab8e  LICENSE.md
diff --git a/package/openlayers/openlayers.mk b/package/openlayers/openlayers.mk
index 4626e7545a..08a58cd796 100644
--- a/package/openlayers/openlayers.mk
+++ b/package/openlayers/openlayers.mk
@@ -4,21 +4,26 @@
 #
 ################################################################################
 
-OPENLAYERS_VERSION = 6.14.1
-OPENLAYERS_SOURCE = v$(OPENLAYERS_VERSION)-dist.zip
-OPENLAYERS_SITE = https://github.com/openlayers/openlayers/releases/download/v$(OPENLAYERS_VERSION)
-OPENLAYERS_LICENSE = BSD-2-Clause
-# There's no separate license file in the archive, only minified files.
+OPENLAYERS_VERSION = 7.0.0
+OPENLAYERS_SITE = $(call github,openlayers,openlayers,v$(OPENLAYERS_VERSION))
 
-define OPENLAYERS_EXTRACT_CMDS
-	unzip $(OPENLAYERS_DL_DIR)/$(OPENLAYERS_SOURCE) -d $(@D)
-	mv $(@D)/v$(OPENLAYERS_VERSION)-dist/* $(@D)
-	rmdir $(@D)/v$(OPENLAYERS_VERSION)-dist/
+# OpenLayers itself is BSD-2-Clause, but not all of the dependencies
+# it brings in are.  See $(@D)/build/legacy/*.LICENSE.txt after build
+# for details.
+OPENLAYERS_LICENSE = BSD-2-Clause, BSD-3-Clause (ieee754), Apache-2.0
+OPENLAYERS_LICENSE_FILES = LICENSE.md
+
+OPENLAYERS_DEPENDENCIES = host-nodejs
+
+define OPENLAYERS_BUILD_CMDS
+	cd $(@D) && $(NPM) install && $(NPM) run build-legacy
 endef
 
 define OPENLAYERS_INSTALL_TARGET_CMDS
-	$(INSTALL) -D -m 0644 $(@D)/ol.css $(TARGET_DIR)/var/www/ol.css
-	$(INSTALL) -D -m 0644 $(@D)/ol.js $(TARGET_DIR)/var/www/ol.js
+	$(INSTALL) -D -m 0644 \
+		$(@D)/build/legacy/ol.js $(TARGET_DIR)/var/www/ol.js
+	$(INSTALL) -D -m 0644 \
+		$(@D)/build/legacy/ol.css $(TARGET_DIR)/var/www/ol.css
 endef
 
 $(eval $(generic-package))
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/openlayers: bump to version 7.0.0
  2022-08-25 15:12 [Buildroot] [PATCH 1/1] package/openlayers: bump to version 7.0.0 Thomas Claveirole
@ 2022-08-27  9:36 ` Yann E. MORIN
  2022-09-01 13:51   ` Thomas Claveirole
  0 siblings, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2022-08-27  9:36 UTC (permalink / raw)
  To: Thomas Claveirole; +Cc: buildroot

Thomas, All,

On 2022-08-25 17:12 +0200, Thomas Claveirole spake thusly:
> Do not rely on the "dist" archive anymore (or the "legacy" archive as
> OpenLayers calls it now).  Build the JavaScript directly from the
> source archive instead, using host-nodejs.

Ah, another case [0] of building sith host-nodejs, two data-points,
better than one! :-) And see below [1]...

[0] https://lore.kernel.org/buildroot/20220827084732.GR37358@scaer/T/#m4c898e32584721ce8a793bedc6a057dff98cbf3e

> Note that the v6.14.1-dist.zip archive for the previous version did
> change, hence the hash for previous version is broken.  See
> https://github.com/openlayers/openlayers/issues/14053 for details.

Ah, this is bad... :-( "First rule of release management: do not ever
change a release."

So, for master: v6.14.1 is just a fix in the package-lock?json. Since
we were not building the package, but were relying on the pre-build
archive, we should not be imapcted by this change, right? In that case,
we could just revert back to using v6.14.0, so that we can have a hash
that is correct.

Thoughts?

> Signed-off-by: Thomas Claveirole <thomas.claveirole@green-communications.fr>
> ---
[--SNIP--]
> diff --git a/package/openlayers/openlayers.mk b/package/openlayers/openlayers.mk
> index 4626e7545a..08a58cd796 100644
> --- a/package/openlayers/openlayers.mk
> +++ b/package/openlayers/openlayers.mk
> @@ -4,21 +4,26 @@
>  #
>  ################################################################################
>  
> -OPENLAYERS_VERSION = 6.14.1
> -OPENLAYERS_SOURCE = v$(OPENLAYERS_VERSION)-dist.zip
> -OPENLAYERS_SITE = https://github.com/openlayers/openlayers/releases/download/v$(OPENLAYERS_VERSION)
> -OPENLAYERS_LICENSE = BSD-2-Clause
> -# There's no separate license file in the archive, only minified files.
> +OPENLAYERS_VERSION = 7.0.0
> +OPENLAYERS_SITE = $(call github,openlayers,openlayers,v$(OPENLAYERS_VERSION))
>  
> -define OPENLAYERS_EXTRACT_CMDS
> -	unzip $(OPENLAYERS_DL_DIR)/$(OPENLAYERS_SOURCE) -d $(@D)
> -	mv $(@D)/v$(OPENLAYERS_VERSION)-dist/* $(@D)
> -	rmdir $(@D)/v$(OPENLAYERS_VERSION)-dist/
> +# OpenLayers itself is BSD-2-Clause, but not all of the dependencies
> +# it brings in are.  See $(@D)/build/legacy/*.LICENSE.txt after build
> +# for details.
> +OPENLAYERS_LICENSE = BSD-2-Clause, BSD-3-Clause (ieee754), Apache-2.0
> +OPENLAYERS_LICENSE_FILES = LICENSE.md
> +
> +OPENLAYERS_DEPENDENCIES = host-nodejs
> +
> +define OPENLAYERS_BUILD_CMDS
> +	cd $(@D) && $(NPM) install && $(NPM) run build-legacy

[1] As I said in [0], it is weird to see that we need to install before
we can build?

Why build-legacy? a small note in the comit log to explain that would be
nice.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/openlayers: bump to version 7.0.0
  2022-08-27  9:36 ` Yann E. MORIN
@ 2022-09-01 13:51   ` Thomas Claveirole
  2022-09-01 15:56     ` [Buildroot] [PATCH v2 1/1] package/openlayers: bump to version 7.1.0 Thomas Claveirole
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Claveirole @ 2022-09-01 13:51 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 2377 bytes --]

> Ah, another case [0] of building sith host-nodejs, two data-points,
> better than one! :-) And see below [1]...

Yes, I actually work with Johan and he pointed these messages to me already.  
We also plan to use host-nodejs for the vuejs and vuejs-router packages when 
we find time for this...

... and, at this stage, I am thinking this would probably need a dedicated 
architecture.  Unfortunately I am not sure I know enough about Buildroot and 
npm to do this (I know next to nothing about npm, actually...)

> > Note that the v6.14.1-dist.zip archive for the previous version did
> > change, hence the hash for previous version is broken.  [...]
> 
> So, for master: v6.14.1 is just a fix in the package-lock?json. Since
> we were not building the package, but were relying on the pre-build
> archive, we should not be imapcted by this change, right? In that case,
> we could just revert back to using v6.14.0, so that we can have a hash
> that is correct.

I did not look into the details.  If package-lock.json is the only difference 
between v6.14.0 and v6.14.1, then yes, I agree.

> [1] As I said in [0], it is weird to see that we need to install before
> we can build?

npm install does **not** actually install anything into the target file 
system.  If I understood correctly, it just downloads the dependencies 
required to build the package, and installs them in ./node_modules, which is $
(@D)/node_modules in our cases.

This is according to npm -h:

npm <command>

Usage:

npm install        install all the dependencies in your project
npm install <foo>  add the <foo> dependency to your project
[...]

> Why build-legacy? a small note in the comit log to explain that would be
> nice.

The default build generates a lot of JavaScript modules that clients should 
load independently (if I understood correctly) and this is not what we want 
here.  We want a single JavaScript file to process without using modules, that 
will populate a global ol object ("namespace") with the library.  The other 
JavaScript packages that I know of in Buildroot (e.g., jquery, vuejs) work the 
same.

I need to make a new revision of this patch anyway (I will try to do it as 
soon as I can, sorry if I am a bit slow these days...)  So I will add a note 
when I do this.

Thanks for your remarks, cheers,
-- 
Thomas Claveirole <thomas.claveirole@green-communications.fr>

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2 1/1] package/openlayers: bump to version 7.1.0
  2022-09-01 13:51   ` Thomas Claveirole
@ 2022-09-01 15:56     ` Thomas Claveirole
  2022-09-06 15:05       ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Claveirole @ 2022-09-01 15:56 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Claveirole

OpenLayers changed its release format again, only two weeks after the
previous change.  The good news is, though, that they now ship a
single release archive that includes the compiled JavaScript code
together with the source code.  Furthermore, they ship both code with
a single license, which file is part of the archive.

Hence, we still do not need to rely on host-nodejs for this package,
at least not for this version.

Signed-off-by: Thomas Claveirole <thomas.claveirole@green-communications.fr>
---
 package/openlayers/openlayers.hash |  3 ++-
 package/openlayers/openlayers.mk   | 10 ++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/package/openlayers/openlayers.hash b/package/openlayers/openlayers.hash
index 1c93b9a729..1b3f3cce51 100644
--- a/package/openlayers/openlayers.hash
+++ b/package/openlayers/openlayers.hash
@@ -1,2 +1,3 @@
 # Locally computed:
-sha256  8a9fda6e392688c049ebb88fb2c73b5788b4965b625443de4cca7d4688b1fb82  v6.14.1-dist.zip
+sha256  37a0e5fde4df3db6e6c11ed0ceb8e20608121afe5f8f7f91cf03990e89a919ca  v7.1.0-package.zip
+sha256  6c4347b83a8c9feef18d57b18e3b6c44cf901b3c344a4a1fbd837e421555ab8e  LICENSE.md
diff --git a/package/openlayers/openlayers.mk b/package/openlayers/openlayers.mk
index 4626e7545a..7396e38fb9 100644
--- a/package/openlayers/openlayers.mk
+++ b/package/openlayers/openlayers.mk
@@ -4,21 +4,19 @@
 #
 ################################################################################
 
-OPENLAYERS_VERSION = 6.14.1
-OPENLAYERS_SOURCE = v$(OPENLAYERS_VERSION)-dist.zip
+OPENLAYERS_VERSION = 7.1.0
+OPENLAYERS_SOURCE = v$(OPENLAYERS_VERSION)-package.zip
 OPENLAYERS_SITE = https://github.com/openlayers/openlayers/releases/download/v$(OPENLAYERS_VERSION)
 OPENLAYERS_LICENSE = BSD-2-Clause
-# There's no separate license file in the archive, only minified files.
+OPENLAYERS_LICENSE_FILES = LICENSE.md
 
 define OPENLAYERS_EXTRACT_CMDS
 	unzip $(OPENLAYERS_DL_DIR)/$(OPENLAYERS_SOURCE) -d $(@D)
-	mv $(@D)/v$(OPENLAYERS_VERSION)-dist/* $(@D)
-	rmdir $(@D)/v$(OPENLAYERS_VERSION)-dist/
 endef
 
 define OPENLAYERS_INSTALL_TARGET_CMDS
 	$(INSTALL) -D -m 0644 $(@D)/ol.css $(TARGET_DIR)/var/www/ol.css
-	$(INSTALL) -D -m 0644 $(@D)/ol.js $(TARGET_DIR)/var/www/ol.js
+	$(INSTALL) -D -m 0644 $(@D)/dist/ol.js $(TARGET_DIR)/var/www/ol.js
 endef
 
 $(eval $(generic-package))
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH v2 1/1] package/openlayers: bump to version 7.1.0
  2022-09-01 15:56     ` [Buildroot] [PATCH v2 1/1] package/openlayers: bump to version 7.1.0 Thomas Claveirole
@ 2022-09-06 15:05       ` Yann E. MORIN
  0 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2022-09-06 15:05 UTC (permalink / raw)
  To: Thomas Claveirole; +Cc: buildroot

Thomas, All,

On 2022-09-01 17:56 +0200, Thomas Claveirole spake thusly:
> OpenLayers changed its release format again, only two weeks after the
> previous change.  The good news is, though, that they now ship a
> single release archive that includes the compiled JavaScript code
> together with the source code.  Furthermore, they ship both code with
> a single license, which file is part of the archive.

I'd still be more comfortable if we were to do that build, because it
ensures the generated files are actual derived from the source files,
while there is no telling what in the bundled minified ones...

But call me paranoid if you want... ;-)

> Hence, we still do not need to rely on host-nodejs for this package,
> at least not for this version.
> 
> Signed-off-by: Thomas Claveirole <thomas.claveirole@green-communications.fr>

Applied to next, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/openlayers/openlayers.hash |  3 ++-
>  package/openlayers/openlayers.mk   | 10 ++++------
>  2 files changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/package/openlayers/openlayers.hash b/package/openlayers/openlayers.hash
> index 1c93b9a729..1b3f3cce51 100644
> --- a/package/openlayers/openlayers.hash
> +++ b/package/openlayers/openlayers.hash
> @@ -1,2 +1,3 @@
>  # Locally computed:
> -sha256  8a9fda6e392688c049ebb88fb2c73b5788b4965b625443de4cca7d4688b1fb82  v6.14.1-dist.zip
> +sha256  37a0e5fde4df3db6e6c11ed0ceb8e20608121afe5f8f7f91cf03990e89a919ca  v7.1.0-package.zip
> +sha256  6c4347b83a8c9feef18d57b18e3b6c44cf901b3c344a4a1fbd837e421555ab8e  LICENSE.md
> diff --git a/package/openlayers/openlayers.mk b/package/openlayers/openlayers.mk
> index 4626e7545a..7396e38fb9 100644
> --- a/package/openlayers/openlayers.mk
> +++ b/package/openlayers/openlayers.mk
> @@ -4,21 +4,19 @@
>  #
>  ################################################################################
>  
> -OPENLAYERS_VERSION = 6.14.1
> -OPENLAYERS_SOURCE = v$(OPENLAYERS_VERSION)-dist.zip
> +OPENLAYERS_VERSION = 7.1.0
> +OPENLAYERS_SOURCE = v$(OPENLAYERS_VERSION)-package.zip
>  OPENLAYERS_SITE = https://github.com/openlayers/openlayers/releases/download/v$(OPENLAYERS_VERSION)
>  OPENLAYERS_LICENSE = BSD-2-Clause
> -# There's no separate license file in the archive, only minified files.
> +OPENLAYERS_LICENSE_FILES = LICENSE.md
>  
>  define OPENLAYERS_EXTRACT_CMDS
>  	unzip $(OPENLAYERS_DL_DIR)/$(OPENLAYERS_SOURCE) -d $(@D)
> -	mv $(@D)/v$(OPENLAYERS_VERSION)-dist/* $(@D)
> -	rmdir $(@D)/v$(OPENLAYERS_VERSION)-dist/
>  endef
>  
>  define OPENLAYERS_INSTALL_TARGET_CMDS
>  	$(INSTALL) -D -m 0644 $(@D)/ol.css $(TARGET_DIR)/var/www/ol.css
> -	$(INSTALL) -D -m 0644 $(@D)/ol.js $(TARGET_DIR)/var/www/ol.js
> +	$(INSTALL) -D -m 0644 $(@D)/dist/ol.js $(TARGET_DIR)/var/www/ol.js
>  endef
>  
>  $(eval $(generic-package))
> -- 
> 2.35.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-06 15:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25 15:12 [Buildroot] [PATCH 1/1] package/openlayers: bump to version 7.0.0 Thomas Claveirole
2022-08-27  9:36 ` Yann E. MORIN
2022-09-01 13:51   ` Thomas Claveirole
2022-09-01 15:56     ` [Buildroot] [PATCH v2 1/1] package/openlayers: bump to version 7.1.0 Thomas Claveirole
2022-09-06 15:05       ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.