@@ -13,8 +13,8 @@
let
srcDeps = lib . singleton (
fetchurl {
url = " h t t p s : / / g i t h u b . c o m / g o o g l e / d e s u g a r _ j d k _ l i b s / a r c h i v e / f d 9 3 7 f 4 1 8 0 c 1 b 5 5 7 8 0 5 2 1 9 a f 4 4 8 2 f 1 a 2 7 e b 0 f f 2 b . z i p " ;
sha256 = " 0 4 h s 3 9 9 3 4 0 x f w c d a j b b c p y w n b 2 s y p 6 z 5 y d w g 9 6 6 i f 3 h q d b 2 z r f 2 3 " ;
url = " h t t p s : / / g i t h u b . c o m / g o o g l e / d e s u g a r _ j d k _ l i b s / a r c h i v e / 9 1 5 f 5 6 6 d 1 d c 2 3 b c 5 a 8 9 7 5 3 2 0 c d 2 f f 7 1 b e 1 0 8 e b 9 c . z i p " ;
sha256 = " 0 b 9 2 6 d f 7 y x y y y i w m 9 c m d i j y 6 k p l f 0 s g h m 2 3 s f 1 6 3 z h 8 w r k 8 7 w f i 7 " ;
}
) ;
@@ -23,12 +23,12 @@ let
f o r i i n ${ builtins . toString srcDeps } ; d o c p $i $o u t / $( s t r i p H a s h $i ) ; d o n e
'' ;
defaultShellPath = lib . makeBinPath [ bash coreutils findutils gnugrep gnused which ] ;
defaultShellPath = lib . makeBinPath [ bash coreutils findutils gnugrep gnused which unzip ] ;
in
stdenv . mkDerivation rec {
version = " 0 . 2 0 . 0 " ;
version = " 0 . 2 1 . 0 " ;
meta = with lib ; {
homepage = " h t t p s : / / g i t h u b . c o m / b a z e l b u i l d / b a z e l / " ;
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = " h t t p s : / / g i t h u b . c o m / b a z e l b u i l d / b a z e l / r e l e a s e s / d o w n l o a d / ${ version } / b a z e l - ${ version } - d i s t . z i p " ;
sha256 = " 1 g 9 h g l l y 5 1 9 9 g c w 9 2 9 f z c 5 f 0 d 0 d w l h a r k h 3 8 7 h 5 8 p 1 f q 9 y l a y i 8 r " ;
sha256 = " 1 d 3 x 0 f 1 h z a i q q 0 0 p d 6 5 b k s 7 v 8 k b v 5 7 m 1 3 j s i n g 7 y 0 y 9 i d 0 g 8 7 j v c " ;
} ;
sourceRoot = " . " ;
@@ -78,6 +78,7 @@ stdenv.mkDerivation rec {
'' ;
postPatch = let
darwinPatches = ''
# D i s a b l e B a z e l ' s X c o d e t o o l c h a i n d e t e c t i o n w h i c h w o u l d c o n f i g u r e c o m p i l e r s
# a n d l i n k e r s f r o m X c o d e i n s t e a d o f f r o m P A T H
@@ -115,27 +116,45 @@ stdenv.mkDerivation rec {
s e d - i - e " s , / u s r / b i n / i n s t a l l _ n a m e _ t o o l , ${ cctools } / b i n / i n s t a l l _ n a m e _ t o o l , g " $w r a p p e r
d o n e
'' ;
genericPatches = ''
f i n d s r c / m a i n / j a v a / c o m / g o o g l e / d e v t o o l s - t y p e f - p r i n t 0 | w h i l e I F S = " " r e a d - r - d " " p a t h ; d o
# s u b s t i t u t e I n P l a c e i s r a t h e r s l o w , s o p r e f i l t e r t h e f i l e s w i t h g r e p
g r e p - r l Z / b i n s r c / m a i n / j a v a / c o m / g o o g l e / d e v t o o l s | w h i l e I F S = " " r e a d - r - d " " p a t h ; d o
# I f y o u a d d m o r e r e p l a c e m e n t s h e r e , y o u m u s t c h a n g e t h e g r e p a b o v e !
# O n l y f i l e s c o n t a i n i n g / b i n a r e t a k e n i n t o a c c o u n t .
s u b s t i t u t e I n P l a c e " $p a t h " \
- - r e p l a c e / b i n / b a s h ${ customBash } / b i n / b a s h \
- - r e p l a c e / u s r / b i n / e n v ${ coreutils } / b i n / e n v \
- - r e p l a c e / b i n / t r u e ${ coreutils } / b i n / t r u e
d o n e
# F i x u p s c r i p t s t h a t g e n e r a t e s c r i p t s . N o t f i x e d u p b y p a t c h S h e b a n g s b e l o w .
s u b s t i t u t e I n P l a c e s c r i p t s / b o o t s t r a p / c o m p i l e . s h \
- - r e p l a c e / b i n / s h ${ customBash } / b i n / b a s h
e c h o " b u i l d - - e x p e r i m e n t a l _ d i s t d i r = ${ distDir } " > > . b a z e l r c
e c h o " f e t c h - - e x p e r i m e n t a l _ d i s t d i r = ${ distDir } " > > . b a z e l r c
e c h o " b u i l d - - c o p t = \ " $( e c h o $N I X _ C F L A G S _ C O M P I L E | s e d - e ' s / / " - - c o p t = \ " / g ' ) \ " " > > . b a z e l r c
e c h o " b u i l d - - h o s t _ c o p t = \ " $( e c h o $N I X _ C F L A G S _ C O M P I L E | s e d - e ' s / / " - - h o s t _ c o p t = \ " / g ' ) \ " " > > . b a z e l r c
e c h o " b u i l d - - l i n k o p t = \ " - W l , $( e c h o $N I X _ L D F L A G S | s e d - e ' s / / " - - l i n k o p t = \ " - W l , / g ' ) \ " " > > . b a z e l r c
e c h o " b u i l d - - h o s t _ l i n k o p t = \ " - W l , $( e c h o $N I X _ L D F L A G S | s e d - e ' s / / " - - h o s t _ l i n k o p t = \ " - W l , / g ' ) \ " " > > . b a z e l r c
s e d - i - e " 4 2 0 a - - c o p t = \ " $( e c h o $N I X _ C F L A G S _ C O M P I L E | s e d - e ' s / / " - - c o p t = \ " / g ' ) \ " \ \ \ \ " s c r i p t s / b o o t s t r a p / c o m p i l e . s h
s e d - i - e " 4 2 0 a - - h o s t _ c o p t = \ " $( e c h o $N I X _ C F L A G S _ C O M P I L E | s e d - e ' s / / " - - h o s t _ c o p t = \ " / g ' ) \ " \ \ \ \ " s c r i p t s / b o o t s t r a p / c o m p i l e . s h
s e d - i - e " 4 2 0 a - - l i n k o p t = \ " - W l , $( e c h o $N I X _ L D F L A G S | s e d - e ' s / / " - - l i n k o p t = \ " - W l , / g ' ) \ " \ \ \ \ " s c r i p t s / b o o t s t r a p / c o m p i l e . s h
s e d - i - e " 4 2 0 a - - h o s t _ l i n k o p t = \ " - W l , $( e c h o $N I X _ L D F L A G S | s e d - e ' s / / " - - h o s t _ l i n k o p t = \ " - W l , / g ' ) \ " \ \ \ \ " s c r i p t s / b o o t s t r a p / c o m p i l e . s h
# W e o n l y b u i l d w i t h J D K 8 f o r n o w , s i n c e J D K 1 1 d o e s n o t c o m p i l e b a z e l
s u b s t i t u t e I n P l a c e t o o l s / j d k / d e f a u l t _ j a v a _ t o o l c h a i n . b z l \
- - r e p l a c e ' " j v m _ o p t s " : J D K 9 _ J V M _ O P T S ' \
' " j v m _ o p t s " : J D K 8 _ J V M _ O P T S '
# a d d n i x e n v i r o n m e n t v a r s t o . b a z e l r c
c a t > > . b a z e l r c < < E O F
b u i l d - - e x p e r i m e n t a l _ d i s t d i r = ${ distDir }
f e t c h - - e x p e r i m e n t a l _ d i s t d i r = ${ distDir }
b u i l d - - c o p t = " $( e c h o $N I X _ C F L A G S _ C O M P I L E | s e d - e ' s / / " - - c o p t = " / g ' ) "
b u i l d - - h o s t _ c o p t = " $( e c h o $N I X _ C F L A G S _ C O M P I L E | s e d - e ' s / / " - - h o s t _ c o p t = " / g ' ) "
b u i l d - - l i n k o p t = " - W l , $( e c h o $N I X _ L D F L A G S | s e d - e ' s / / " - - l i n k o p t = " - W l , / g ' ) "
b u i l d - - h o s t _ l i n k o p t = " - W l , $( e c h o $N I X _ L D F L A G S | s e d - e ' s / / " - - h o s t _ l i n k o p t = " - W l , / g ' ) "
b u i l d - - h o s t _ j a v a b a s e = ' @ l o c a l _ j d k / / : j d k '
E O F
# a d d t h e s a m e e n v i r o n m e n t v a r s t o c o m p i l e . s h
s e d - e " / \ $c o m m a n d \ \ \ \ $/ a - - c o p t = \ " $( e c h o $N I X _ C F L A G S _ C O M P I L E | s e d - e ' s / / " - - c o p t = \ " / g ' ) \ " \ \ \ \ " \
- e " / \ $c o m m a n d \ \ \ \ $/ a - - h o s t _ c o p t = \ " $( e c h o $N I X _ C F L A G S _ C O M P I L E | s e d - e ' s / / " - - h o s t _ c o p t = \ " / g ' ) \ " \ \ \ \ " \
- e " / \ $c o m m a n d \ \ \ \ $/ a - - l i n k o p t = \ " - W l , $( e c h o $N I X _ L D F L A G S | s e d - e ' s / / " - - l i n k o p t = \ " - W l , / g ' ) \ " \ \ \ \ " \
- e " / \ $c o m m a n d \ \ \ \ $/ a - - h o s t _ l i n k o p t = \ " - W l , $( e c h o $N I X _ L D F L A G S | s e d - e ' s / / " - - h o s t _ l i n k o p t = \ " - W l , / g ' ) \ " \ \ \ \ " \
- e " / \ $c o m m a n d \ \ \ \ $/ a - - h o s t _ j a v a b a s e = ' @ l o c a l _ j d k / / : j d k ' \ \ \ \ " \
- i s c r i p t s / b o o t s t r a p / c o m p i l e . s h
# - - e x p e r i m e n t a l _ s t r i c t _ a c t i o n _ e n v ( w h i c h w i l l s o o n b e c o m e t h e
# d e f a u l t , s e e b a z e l b u i l d / b a z e l # 2 5 7 4 ) h a r d c o d e s t h e d e f a u l t
@@ -159,6 +178,8 @@ stdenv.mkDerivation rec {
buildJdk
] ;
# when a command can’ t be found in a bazel build, you might also
# need to add it to `defaultShellPath`.
nativeBuildInputs = [
zip
python