Opened 20 months ago

Last modified 20 months ago

#58117 new enhancement

Arduino: should fetch files in fetch phase and not in build phase

Reported by: giansalvo (gians) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc:
Port: Arduino

Description

The Arduino port is fetching supplementary files apart from the main tarball during the build phase. This should be avoided. I tried to modify the Portfile using curl in the post-fetch phase:

post-fetch {
    system "curl -O https://downloads.arduino.cc/appbundler-1.0ea-arduino4.jar.zip"
}

but I get this error:

Error: Failed to fetch Arduino: can not find channel named "/opt/local/var/macports/build/_private_var_tmp_Arduino/Arduino/work/Arduino-2b11e94afe85888bd5ebd507de6c6e0220a49bf3"

I'm not sure if using curl is the right way either. Is there any other Portfile I can look at? Please advise about the correct way for downloading extra files in the fetch phase.

Attachments (1)

Portfile (16.8 KB) - added by giansalvo (gians) 20 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 20 months ago by jmroot (Joshua Root)

You would normally append to master_sites and distfiles (possibly using tags to indicate which distfiles are available from which sites) and set extract.only if not all of the distfiles should be extracted into the workdir.

comment:2 Changed 20 months ago by giansalvo (gians)

I found out how to use master_sites-append and distfiles-append to fetch several files. I'm attaching the current Portfile.

The problem now is that Arduino requires to download several files with the same filename but with different master_sites and different final destinations: for example one file named 1.0.6.zip must be fetched from https://github.com/arduino-libraries/GSM/archive/1.0.6.zip and must be moved to .../build/GSM-1.0.6.zip, another file with the same name must be fetched from https://github.com/arduino-libraries/TFT/archive/1.0.6.zip and goes to .../build/TFT-1.0.6.zip.

Is there a way to rename files while fetching or to download them into a path specific to each file?

Changed 20 months ago by giansalvo (gians)

Attachment: Portfile added

comment:3 Changed 20 months ago by ryandesign (Ryan Schmidt)

Yes: Use this recipe.

comment:4 in reply to:  3 Changed 20 months ago by giansalvo (gians)

Replying to ryandesign:

Yes: Use recipe.

Sorry, I don't think this recipe applies to my case.

In my case I need to download two files with the same filename from different sites. Let's say I need to fetch both:

http://site1/myfile.zip
http://site2/myfile.zip

How shold I set master_sites and distfiles and checksumsin this case?

Last edited 20 months ago by giansalvo (gians) (previous) (diff)
Note: See TracTickets for help on using tickets.