From owner-freebsd-ports@freebsd.org Thu Apr 20 08:02:42 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E132D47EBD for ; Thu, 20 Apr 2017 08:02:42 +0000 (UTC) (envelope-from xavi.garcia@gmail.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66D53B7A for ; Thu, 20 Apr 2017 08:02:42 +0000 (UTC) (envelope-from xavi.garcia@gmail.com) Received: by mail-io0-x234.google.com with SMTP id r16so57840627ioi.2 for ; Thu, 20 Apr 2017 01:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=P9EnbnzOrDMEgpgiiXh169xVFgk/GVQL1CHKQhnnUN8=; b=ZCfEvcKfs51B5/Sen23FTonPPVE1P3zacVq1hypLv0qj10B9t8oxp/R6LqLVeqC7H9 YVFbsop4e/E+49Lpmm2YoPM2TgVf1yZQ2KCnbZV+JmP5w/aeFfcfZmGNW+taD+CD/1aG Q/RakeDVO6P1DTeiG6QjnLnF/tUybahz1SVvmjFQj8+3nR0DARB3mPS7wpVJ4jT52AsL ecXLfN/IeS21WDxCrBFuLo29LU4SimTCQLIwrKb8AY4SCtr9q6OLhaPnPbICOYXvtGva Yo6FbShlYhpI5bi/1Iz5Es7d2lA6y+D0xTNYpU2rIm803iHEyL9R9zsl/yCpFxbNw/KR wVpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=P9EnbnzOrDMEgpgiiXh169xVFgk/GVQL1CHKQhnnUN8=; b=Ox48tYe0FmpNDqBBJqeOZnn7aSNOuEIICzWPn7w3AW4FRXrQ0Cex1xAH+TkfVDhC7E 5KQtmAsIWN1sJ9zEuNoSAsLzVhWtN3jGe0l/897b9j4/A7/AOUmOXrOCJvgqGjLWfZjO EFY6N3gxe54Thgw6AC1l3p/sOYHn6q9ZCQD+UsPMP1yDYtgNRR2kHrm+h8vNF7JUmhcB QujFtzJoWTAPx3r6B66ahP2ZgDmfPNAm7y4OU0z9RvcZRsM8nTPrBO7RLfasIvo+Y/Aw ze7orFHC+inTmmbLDhY8mzfjXg5EvHq8XUqZniJmhWe3AceFGt7MuBGjvBGiUbX3JfJa 4IDw== X-Gm-Message-State: AN3rC/5WWWIbfPk8VV/0R2BUzuoLwxcX39kAl6SAbDzWMwqXX+sKpcGP 2X8RPp1uesW2EJ51wSwp2pltoSzJp48O X-Received: by 10.107.148.3 with SMTP id w3mr7932753iod.60.1492675347416; Thu, 20 Apr 2017 01:02:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.118.205 with HTTP; Thu, 20 Apr 2017 01:02:26 -0700 (PDT) In-Reply-To: <39470c3e111a92fd41ad183a77ccc2ac@posteo.net> References: <39470c3e111a92fd41ad183a77ccc2ac@posteo.net> From: Xavi Garcia Date: Thu, 20 Apr 2017 10:02:26 +0200 Message-ID: Subject: Re: Writing a port that needs to download a large number of files To: Dmytro Bilokha Cc: freebsd-ports@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Apr 2017 08:02:42 -0000 Hi, I'd definitely download a compiled version but the developer is hosting the builds in Amazon S3 and you need to receive a token via e-mail in order to download the files, which is awful in my opinion. The other option is to compile my own builds and host them somewhere in the Internet. Kind regards, Xavier Garcia 2017-04-19 22:29 GMT+02:00 Dmytro Bilokha : > > On 19.04.2017 19:27, Xavi Garcia wrote: > >> Hi all, >> >> We are writing a port for a Java software that downloads a large number of >> jar files (around 200) with Gradle (https://gradle.org/), that is similar >> to other package managers like Pip or Ruby Gems but for Java projects. >> >> What would be the best practice in this scenario? I am aware that we can >> only download files in the fetch phase but I am not sure if my solution is >> clean enough. >> >> We will be deploying this port in our servers via Portshaker and Poudriere >> but we would also like to commit it to the ports tree. >> >> >> In short, I am using the 'pre-fetch' phase together with FETCH_DEPENDS to >> drop the Gradle wrapper in ${DISTDIR}/${PORTNAME} and then I use the >> 'dependencies' task to download all the dependencies. >> >> The 'do-build' stage will run again the Gradle wrapper to build the >> software, but using the offline mode. >> >> You can find attached the Makefile. >> >> Kind regards, >> >> Xavier Garcia >> > > Hi! > If you need examples of the "best practice", > probably, you can take a look at already exsisting > ports of Java software. > > For example, I've checked the Glassfish port and > it was made with different approach: > 1. During fetch phase distribution zip-file with > already compiled Java classes is downloaded. > 2. Then it is unzipped to some directory, like > /usr/local/glassfish. > 3. Some scripts put, package registered, etc. > > So here there is no building of Java app from sources, > mostly fetching already built, some tweaking and putting > to the right place. > I saw similar procedure for some another ports > of Java software. > > I am not sure, but it seems because of such reasons: > 1. With Java you won't gain a lot with building application > from sources. If OS has JVM you can just run already > compiled -- it should work. > 2. For port its better to have as least dependencies, > as possible. So, making your port dependent on > Gradle (which fast evolving itself) and/or another > Java build tooling can make port fragile and not > very stable. > 3. Building the big Java project from sources could be > time and traffic consuming task. Usualy users > don't like this. > > --- > Best regards, > Dmytro Bilokha >