all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mathieu Lirzin <mthl@gnu.org>
To: help-guix@gnu.org
Subject: Re: Using Eclipse IDE on GuixSD
Date: Sun, 08 Jul 2018 21:16:21 +0200	[thread overview]
Message-ID: <87lgalk06y.fsf@gnu.org> (raw)
In-Reply-To: <87h8rrjb9j.fsf@gnu.org> (Mathieu Lirzin's message of "Fri, 12 Jan 2018 17:24:24 +0100")

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

Mathieu Lirzin <mthl@gnu.org> writes:

> I would like to have a package definition that uses an official
> prebuilt tarball [1] as origin.  Does anybody has a custom package
> definition in their GUIX_PACKAGE_PATH for doing that?  If not, I will
> try to convert the Nix package definition [2] myself.  But I would be
> pleased not to have to.

Just in case it interests anyone here is my package definition.


[-- Attachment #2: eclipse.scm --]
[-- Type: text/x-script.guile, Size: 3553 bytes --]

;;;; eclipse.scm -- Mthl's eclipse package definition
;;; Copyright © 2018 Mathieu Lirzin <mthl@gnu.org>
;;;
;;; This program is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

(define-module (mthl packages eclipse)
  #:use-module (guix packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages elf)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages java)
  #:use-module (gnu packages xorg)
  #:use-module (guix download)
  #:use-module (guix build-system trivial)
  #:use-module ((guix licenses) #:prefix license:))

(define-public eclipse-java
  ;; XXX: This package is not built from source.
  (package
    (name "eclipse-java")
    (version "oxygen")
    ;; TODO: Handle i686 alternate origin and augment 'supported-systems'.
    (source (origin
	      (method url-fetch)
	      (uri (string-append
		    "https://www.eclipse.org/downloads/download.php?"
		    "r=1&nf=1&file=/technology/epp/downloads/release/"
		    version "/3a/" name "-"
		    version "-3a-linux-gtk-x86_64.tar.gz"))
	      (sha256
	       (base32
		"0m7y7jfm059w01x9j5b5qkinjjmhkyygpjabhjf19fg2smxmwcim"))))
    (build-system trivial-build-system)
    (arguments
     `(#:modules ((guix build utils))
       #:builder
       (begin
	 (use-modules (guix build utils))
	 (let* ((source  (assoc-ref %build-inputs "source"))
		(out     (assoc-ref %outputs "out"))
		(eclipse (string-append out "/eclipse/eclipse")))
	   (mkdir-p (string-append out "/bin"))
	   (set-path-environment-variable "PATH" '("bin")
					  (map cdr %build-inputs))
	   (and
	    (invoke "tar" "xvf" source "-C" out)
	    (let ((ld-so (string-append (assoc-ref %build-inputs "libc")
					"/lib/ld-linux-x86-64.so.2")))
	      (invoke "patchelf" "--set-interpreter" ld-so eclipse))
	    (let ((jdk (assoc-ref %build-inputs "jdk")))
	      (define (libdir input)
		(string-append (assoc-ref %build-inputs input) "/lib"))

	      (wrap-program eclipse
		`("PATH" prefix (,(string-append jdk "/bin")))
		`("LD_LIBRARY_PATH" prefix ,(map libdir
						 '("gtk+" "libxtst" "glib"))))
	      (symlink eclipse (string-append out "/bin/eclipse"))
	      #t))))))
    (native-inputs
     `(("tar" ,tar)
       ("gzip" ,gzip)
       ("patchelf" ,patchelf)))
    (inputs
     `(("bash" ,bash)
       ("glib" ,glib)
       ("gtk+" ,gtk+)
       ("jdk" ,icedtea-8)
       ("libc" ,glibc)
       ("libxtst" ,libxtst)))
    (supported-systems '("x86_64-linux"))
    (synopsis "Java Integrated Development Environment")
    (description
     "Eclipse is an integrated development environment (IDE) used in computer
programming, in particular for Java development.  It contains a base workspace
and an extensible plug-in system for customizing the environment.")
    (home-page "https://www.eclipse.org/")
    (license license:mpl2.0)))

[-- Attachment #3: Type: text/plain, Size: 76 bytes --]


-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

      reply	other threads:[~2018-07-08 19:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 16:24 Using Eclipse IDE on GuixSD Mathieu Lirzin
2018-07-08 19:16 ` Mathieu Lirzin [this message]

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=87lgalk06y.fsf@gnu.org \
    --to=mthl@gnu.org \
    --cc=help-guix@gnu.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

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.