Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #20 from X4/master

Successfully compiles dev-lang/julia on Gentoo and Sabayon
  • Loading branch information...
commit 292fc6910c495e13cce626d25aee64115e53976c 2 parents 189d6fb + cfaf56a
Nicolas Bigaouette authored

Showing 2 changed files with 73 additions and 84 deletions. Show diff stats Hide diff stats

  1. +1 1  dev-lang/julia/Manifest
  2. +72 83 dev-lang/julia/julia-9999.ebuild
2  dev-lang/julia/Manifest
... ... @@ -1 +1 @@
1   -EBUILD julia-9999.ebuild 3806 RMD160 405cb31e798e1e23fede2138f9d0997da35b0b64 SHA1 14544a239e3bf0a1440b1bcd12523927fa151e6e SHA256 a7270cb83dd1ab1c1a99bd230ab8a06ea54def86a0cf46756d0d81bb854878e9
  1 +EBUILD julia-9999.ebuild 2307 SHA256 dac68040311d17c0211e16b3c1d7bf6af281336653be635d6990a2d62f7e14fc SHA512 326a969fb5a418f6cbefa8a2d645c333efc8761c7f8ee3602edfeed1a2dfbb19a9bb206e17bf6a4183e9163add6a1d4fdbfc1a9702973f37cb5fb4fd44eac0e7 WHIRLPOOL 8de2f7cfe73c7cede9f2a5755d0e9ea20ad1a9f2a07ad690fb23528388f229362a26b9a66716de3d7fafa6c9d3f52fc639b3ab373dffd257652c768c0e8a948c
155 dev-lang/julia/julia-9999.ebuild
@@ -6,106 +6,95 @@ EAPI=4
6 6
7 7 EGIT_REPO_URI="git://github.com/JuliaLang/julia.git"
8 8
9   -inherit git-2 eutils
  9 +inherit git-2 elisp-common eutils multilib
10 10
11   -
12   -DESCRIPTION="The Julia Language: a fresh approach to technical computing"
  11 +DESCRIPTION="High-performance dynamic language for technical computing"
13 12 HOMEPAGE="http://julialang.org/"
14 13 SRC_URI=""
15 14
16 15 LICENSE="GPL-2"
17 16 SLOT="0"
18   -KEYWORDS="~amd64 ~x86"
19   -IUSE="+builtin lighttpd"
20   -
21   -RDEPEND="
22   - !builtin? (
23   - >=sys-devel/llvm-3.0
24   - sys-libs/readline
25   - virtual/blas
26   - virtual/lapack
27   - sci-libs/suitesparse
28   - sci-libs/arpack
29   - sci-libs/fftw
30   - dev-libs/gmp
31   - sys-libs/libunwind
32   - dev-libs/libpcre
33   - )
34   - lighttpd? ( www-servers/lighttpd )"
35   -DEPEND="
36   - sys-devel/make
37   - dev-vcs/git
38   - dev-lang/perl
39   - sys-devel/m4
40   - ${RDEPEND}"
  17 +KEYWORDS="~x86"
  18 +IUSE="doc emacs notebook"
  19 +
  20 +RDEPEND=">=sys-devel/llvm-3.0
  21 + sys-libs/readline
  22 + emacs? ( !app-emacs/ess )
  23 + >=sci-libs/suitesparse-4.0
  24 + sci-libs/arpack
  25 + sci-libs/fftw
  26 + dev-libs/gmp
  27 + sys-libs/libunwind
  28 + dev-libs/libpcre
  29 + sci-mathematics/glpk
  30 + sys-libs/zlib
  31 + virtual/blas
  32 + virtual/lapack
  33 + notebook? ( www-servers/lighttpd )"
  34 +
  35 +DEPEND="${RDEPEND}
  36 + virtual/pkgconfig"
41 37
42 38 src_prepare() {
43   - # Use system packages instead of included ones
44   - if use !builtin; then
45   - sed \
46   - -e "s|USE_SYSTEM_LLVM=.*|USE_SYSTEM_LLVM=1|g" \
47   - -e "s|USE_SYSTEM_LIBUNWIND=.*|USE_SYSTEM_LIBUNWIND=1|g" \
48   - -e "s|USE_SYSTEM_READLINE=.*|USE_SYSTEM_READLINE=1|g" \
49   - -e "s|USE_SYSTEM_BLAS=.*|USE_SYSTEM_BLAS=1|g" \
50   - -e "s|USE_SYSTEM_LAPACK=.*|USE_SYSTEM_LAPACK=1|g" \
51   - -e "s|USE_SYSTEM_FFTW=.*|USE_SYSTEM_FFTW=1|g" \
52   - -e "s|USE_SYSTEM_GMP=.*|USE_SYSTEM_GMP=1|g" \
53   - -e "s|USE_SYSTEM_ARPACK=.*|USE_SYSTEM_ARPACK=1|g" \
54   - -e "s|USE_SYSTEM_SUITESPARSE=.*|USE_SYSTEM_SUITESPARSE=1|g" \
55   - -e "s|USE_SYSTEM_PCRE=.*|USE_SYSTEM_PCRE=1|g" \
56   - -i Make.inc || die "Can't sed."
57   -
58   - # https://github.com/JuliaLang/julia/issues/450
59   - mkdir -p ${WORKDIR}/${P}/external/root/lib || die "Can't creat external/root/lib folder."
60   - ln -s /$(get_libdir)/libpcre.so.0 ${WORKDIR}/${P}/external/root/lib/libpcre.so || die "Can't add symbolic link to pcre"
61   -
62   - # Folder /usr/include/suitesparse does not exists, everything should be in /usr/include
63   - sed -e "s|SUITESPARSE_INC = -I /usr/include/suitesparse|SUITESPARSE_INC =|g" -i external/Makefile
64   - fi
  39 + # Folder /usr/include/suitesparse does not exists, everything should be in /usr/include
  40 + sed -e "s|SUITESPARSE_INC = -I /usr/include/suitesparse|SUITESPARSE_INC = |g" \
  41 + -i deps/Makefile
  42 +
  43 + blasname=$($(tc-getPKG_CONFIG) --libs blas | \
  44 + sed -e "s/-l\([a-z0-9]*\).*/lib\1/")
  45 + lapackname=$($(tc-getPKG_CONFIG) --libs lapack | \
  46 + sed -e "s/-l\([a-z0-9]*\).*/lib\1/")
  47 +
  48 + sed -i \
  49 + -e 's|\(USE_SYSTEM_.*\)=.*|\1=1|g' \
  50 + -e "s|-lblas|$($(tc-getPKG_CONFIG) --libs blas)|" \
  51 + -e "s|-llapack|$($(tc-getPKG_CONFIG) --libs lapack)|" \
  52 + -e "s|liblapack|${lapackname}|" \
  53 + -e "s|libblas|${blasname}|" Make.inc || die
  54 +
  55 + # do not set the RPATH
  56 + sed -e "/RPATH = /d" -e "/RPATH_ORIGIN = /d" -i Make.inc
65 57 }
66 58
67 59 src_compile() {
68   - cd external || die "Could not enter 'external' directory!"
69   -
70   - # Create libsuitesparse.{so,a} from all sci-libs/suitesparse different libraries
71   - if use builtin; then
72   - LIBLAPACK=external/lapack-*/liblapack.a
73   - LIBBLAS=external/openblas-*/libopenblas.a
74   - else
75   - LIBLAPACK=-llapack
76   - LIBBLAS=-lblas
77   - fi
78   - gfortran -shared ${FFLAGS} \
79   - /usr/$(get_libdir)/libumfpack.so \
80   - /usr/$(get_libdir)/libcholmod.so \
81   - /usr/$(get_libdir)/libspqr.so \
82   - /usr/$(get_libdir)/libamd.so \
83   - /usr/$(get_libdir)/libamdf77.so \
84   - /usr/$(get_libdir)/libcamd.so \
85   - /usr/$(get_libdir)/libccolamd.so \
86   - /usr/$(get_libdir)/libcolamd.so \
87   - /usr/$(get_libdir)/libbtf.so \
88   - /usr/$(get_libdir)/libufconfig.so \
89   - ${LIBLAPACK} ${LIBBLAS} -lstdc++ -o ${WORKDIR}/${P}/external/root/lib/libsuitesparse.so
90   -
91   - cd ${S} || die "Can't cd into ${S}!"
92   - emake
  60 + make -j2
  61 + use doc && make -C doc html
  62 + if use notebook; then
  63 + make -j2 -C ui/webserver
  64 + sed -e "s|etc|/share/julia/etc|" \
  65 + -i usr/bin/launch-julia-webserver ||die
  66 + fi
  67 + use emacs && elisp-compile contrib/julia-mode.el
93 68 }
94 69
95 70 src_install() {
96   - emake install DESTDIR=${D} PREFIX=/usr
97   - dosym ${D}/usr/share/julia/julia /usr/bin/julia
98   - dosym ${D}/usr/share/julia/julia-release-basic /usr/bin/julia-basic
99   - dosym ${D}/usr/share/julia/julia-release-webserver /usr/bin/julia-webserver
  71 + make -j2 install PREFIX="${D}/usr"
  72 + cat > 99julia <<-EOF
  73 + LDPATH=/usr/$(get_libdir)/julia
  74 + EOF
  75 + doenvd 99julia
  76 + if use notebook; then
  77 + cp -R ui/website "${D}/usr/share/julia"
  78 + insinto /usr/share/julia/etc
  79 + doins deps/lighttpd.conf
  80 + fi
  81 + if use emacs; then
  82 + elisp-install "${PN}" contrib/julia-mode.el
  83 + elisp-site-file-install "${FILESDIR}"/63-julia-gentoo.el
  84 + fi
  85 + use doc && dodoc -r doc/_build/html
  86 + dodoc README.md
  87 +}
100 88
101   - # Delete libraries used for compilation
102   - rm -f ${D}/usr/share/julia/lib/libpcre.so
103   - #rm -f ${D}/usr/share/julia/lib/libsuitesparse.so # Until sci-libs/suitesparse creates the file, don't delete it.
  89 +pkg_postinst() {
  90 + use emacs && elisp-site-regen
  91 +}
104 92
105   - ln -s /$(get_libdir)/libpcre.so.0 ${D}/usr/share/julia/lib/libpcre.so || die "Can't add symbolic link to pcre"
  93 +pkg_postrm() {
  94 + use emacs && elisp-site-regen
106 95 }
107 96
108 97 src_test() {
109   - cd ${S}/test || die "Can't cd into test directory"
110   - make || die "Running tests failed"
  98 + make -C test || die "Running tests failed"
111 99 }
  100 +

0 comments on commit 292fc69

Please sign in to comment.
Something went wrong with that request. Please try again.