From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?QmrDtnJuIEjDtmZsaW5n?= Subject: Re: java: How to patch a jar-sources Date: Mon, 15 Apr 2019 17:11:52 +0200 Message-ID: <20190415171152.4087d25c@alma-ubu> References: <20190415080248.679c6749@alma-ubu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/BFdpuXQCc0R1t2iYLQxZxqk"; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:36940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hG3H3-0008LI-9k for guix-devel@gnu.org; Mon, 15 Apr 2019 11:11:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hG3H2-0001sd-5v for guix-devel@gnu.org; Mon, 15 Apr 2019 11:11:57 -0400 Received: from m4s11.vlinux.de ([83.151.27.109]:34894 helo=bjoernhoefling.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hG3H1-0001ru-Tm for guix-devel@gnu.org; Mon, 15 Apr 2019 11:11:56 -0400 In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: =?UTF-8?B?R8OhYm9y?= Boskovits Cc: Guix-devel --Sig_/BFdpuXQCc0R1t2iYLQxZxqk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, 15 Apr 2019 14:26:41 +0200 G=C3=A1bor Boskovits wrote: > Hello Bj=C3=B6rn, >=20 >=20 >=20 > Bj=C3=B6rn H=C3=B6fling ezt =C3=ADrta= (id=C5=91pont: > 2019. =C3=A1pr. 15., H 8:03): >=20 > > Hi Guix, > > > > I have a problem combining ".jar" sources with patches. > > > > Here is my sources definition: > > > > (define-public java-ecj > > (package (inherit java-ecj-3) > > (version "4.6.3") > > (source (origin > > (method url-fetch) > > (uri (string-append " > > http://archive.eclipse.org/eclipse/downloads/drops4/R-" > > version > > "-201703010400/ecjsrc-" > > version > > ".jar")) [..] > > It looks like guix now wants to extract the jar-sources with "tar", > > no longer with "jar". How can I tell Guix this is a jar-file to > > extract from? Do I need to do that manually in a snippet? Any > > examples?=20 > I have not actually done this, as jar files are usually not sources. > Do we have the source this file was generated from? > Also what we do in the build system is use zip and unzip for > extracting jar files. jar-files can contain sources. The main intended use for this is to show the sources to the developer in the IDE (Eclipse), but we can also use it to build from. As an example, look at the java-jgit package. It downloads from Maven central a ...-sources.jar. In my example the ecjsrc-...jar also contains .java source files, the compiled version with .class files is named without the "src" in the name. Going with zip is an option, this might be a work-around. But actually, I don't want to do everything by hand: I thought in general you can put "whatever" (supported) file-extension you like into the "source" field and by extension of the URI it will select the proper unpacker (i.e. using "tar xvf" for .tar files, "tar xzvf" for .tar.gz", "unzip" for .zip, etc). This seams to work when just using the ".jar" URI, without patches (cmp the java-jgit example). Only after I added the patches, it was trying to use "tar x..", which of cause will fail on the .jar file. If noone has a direct solution, maybe it's time for me to get my fingers dirty and look into the source-extracting code. Thanks, Bj=C3=B6rn --Sig_/BFdpuXQCc0R1t2iYLQxZxqk Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQiGUP0np8nb5SZM4K/KGy2WT5f/QUCXLSfOAAKCRC/KGy2WT5f /dOWAJkBOz02CRNFIWQSEyzKjT9ekYa73gCgpHilxw74mwzVha9/oX81L1MLPgQ= =yiXc -----END PGP SIGNATURE----- --Sig_/BFdpuXQCc0R1t2iYLQxZxqk--