2016-09-16 21:57:59 +01:00
{ stdenv , fetchurl , pkgconfig , autoconf , makeDesktopItem
, libX11 , gdk_pixbuf , cairo , libXft , gtk3 , vte
, harfbuzz #substituting glyphs with opentype fonts
, fribidi , m17n_lib #bidi and encoding
, openssl , libssh2 #build-in ssh
2016-09-16 15:40:19 +01:00
} :
2016-06-11 19:54:31 +01:00
stdenv . mkDerivation rec {
name = " m l t e r m - ${ version } " ;
2016-09-16 15:40:19 +01:00
version = " 3 . 7 . 2 " ;
2016-06-11 19:54:31 +01:00
src = fetchurl {
2016-07-20 06:25:25 +01:00
url = " m i r r o r : / / s o u r c e f o r g e / p r o j e c t / m l t e r m / 0 1 r e l e a s e / ${ name } / ${ name } . t a r . g z " ;
2016-09-16 15:40:19 +01:00
sha256 = " 1 b 2 4 w 8 h f c k 1 y l f k d z 9 z 5 5 v l m s b 3 6 q 9 i y f r 0 i 9 q 9 y 9 8 d f k 0 f 0 r r w 8 " ;
2016-06-11 19:54:31 +01:00
} ;
2016-09-16 15:40:19 +01:00
nativeBuildInputs = [ pkgconfig autoconf ] ;
buildInputs = [
2016-09-16 21:57:59 +01:00
libX11 gdk_pixbuf . dev cairo libXft gtk3 vte
harfbuzz fribidi m17n_lib openssl libssh2
2016-09-16 15:40:19 +01:00
] ;
2016-06-11 19:54:31 +01:00
2016-10-05 07:54:40 +01:00
patches = [ ./x_shortcut.c.patch ] ; #fixes numlock in 3.7.2. should be safe to remove by 3.7.3 since it's already in the trunk: https://bitbucket.org/arakiken/mlterm/commits/4820d42c7abfe1760a5ea35492c83be469c642b3
2016-09-16 21:57:59 +01:00
#bad configure.ac and Makefile.in everywhere
2016-06-11 19:54:31 +01:00
preConfigure = ''
2016-09-16 21:57:59 +01:00
sed - ie ' s ; -L/usr/local/lib -R/usr/local/lib ; ; g' \
2016-06-11 19:54:31 +01:00
xwindow/libtype/Makefile.in \
main/Makefile.in \
2016-09-16 15:40:19 +01:00
tool/mlfc/Makefile.in \
2016-06-11 19:54:31 +01:00
tool/mlimgloader/Makefile.in \
2016-09-16 15:40:19 +01:00
tool/mlconfig/Makefile.in \
xwindow/libotl/Makefile.in
sed - ie ' s ; cd . . srcdir . && rm - f . . . lang . . gmo . * ; ; g' \
tool/mlconfig/po/Makefile.in.in
2016-09-16 21:57:59 +01:00
#utmp and mlterm-fb
substituteInPlace configure . in \
- - replace " - m 2 7 5 5 - g u t m p " " " \
- - replace " - m 4 7 5 5 - o r o o t " " "
substituteInPlace configure \
- - replace " - m 2 7 5 5 - g u t m p " " " \
- - replace " - m 4 7 5 5 - o r o o t " " "
2016-06-11 19:54:31 +01:00
'' ;
2016-09-16 21:57:59 +01:00
NIX_LDFLAGS = "
- L $ { stdenv . cc . cc . lib } /lib
- lX11 - lgdk_pixbuf-2 .0 - lcairo - lfontconfig - lfreetype - lXft
- lvte-2 .91 - lgtk-3 - lharfbuzz - lfribidi - lm17n
" + s t d e n v . l i b . o p t i o n a l S t r i n g ( o p e n s s l ! = n u l l ) "
- lcrypto
" + s t d e n v . l i b . o p t i o n a l S t r i n g ( l i b s s h 2 ! = n u l l ) "
- lssh2
" ;
2016-06-11 19:54:31 +01:00
configureFlags = [
2016-09-16 15:40:19 +01:00
" - - w i t h - x = y e s "
2016-09-16 21:57:59 +01:00
" - - w i t h - g u i = x l i b , f b "
" - - w i t h - i m a g e l i b = g d k - p i x b u f " #or mlimgloader depending on your bugs of choice
2016-06-11 19:54:31 +01:00
" - - w i t h - t y p e - e n g i n e s = c a i r o , x f t , x c o r e "
2016-09-16 21:57:59 +01:00
" - - w i t h - g t k = 3 . 0 "
" - - e n a b l e - i n d " #indic scripts
" - - e n a b l e - f r i b i d i " #bidi scripts
" - - e n a b l e - m 1 7 n l i b " #character encodings
2016-09-16 15:40:19 +01:00
" - - w i t h - t o o l s = m l c l i e n t , m l c o n f i g , m l c c , m l t e r m - m e n u , m l i m g l o a d e r , r e g i s t o b m p , m l f c "
2016-09-16 21:57:59 +01:00
#mlterm-menu and mlconfig depend on enabling gnome3.at-spi2-core
#and configuring ~/.mlterm/key correctly.
] ++ stdenv . lib . optional ( libssh2 == null ) [
" - - d i s a b l e - s s h 2 "
2016-06-11 19:54:31 +01:00
] ;
2016-09-16 21:57:59 +01:00
postInstall = ''
mkdir - p " $ o u t / s h a r e / i c o n s / h i c o l o r / s c a l a b l e / a p p s "
cp contrib/icon/mlterm-icon.svg " $ o u t / s h a r e / i c o n s / h i c o l o r / s c a l a b l e / a p p s / m l t e r m . s v g "
mkdir - p " $ o u t / s h a r e / i c o n s / h i c o l o r / 4 8 x 4 8 / a p p s "
cp contrib/icon/mlterm-icon-gnome2.png " $ o u t / s h a r e / i c o n s / h i c o l o r / 4 8 x 4 8 / a p p s / m l t e r m . p n g "
mkdir - p " $ o u t / s h a r e / a p p l i c a t i o n s "
cp $ desktopItem/share/applications /* $ o u t / s h a r e / a p p l i c a t i o n s
'' ;
desktopItem = makeDesktopItem rec {
name = " m l t e r m " ;
exec = " m l t e r m % U " ;
icon = " m l t e r m " ;
type = " A p p l i c a t i o n " ;
comment = " T e r m i n a l e m u l a t o r " ;
desktopName = " m l t e r m " ;
genericName = " T e r m i n a l e m u l a t o r " ;
categories = stdenv . lib . concatStringsSep " ; " [
" A p p l i c a t i o n " " S y s t e m " " T e r m i n a l E m u l a t o r "
] ;
startupNotify = " f a l s e " ;
} ;
2016-06-11 19:54:31 +01:00
meta = with stdenv . lib ; {
2016-10-05 07:54:40 +01:00
homepage = http://mlterm.sourceforge.net/ ;
2016-06-11 19:54:31 +01:00
license = licenses . bsd2 ;
2016-09-16 21:57:59 +01:00
maintainers = with maintainers ; [ vrthra ramkromberg ] ;
2016-06-13 02:36:27 +01:00
platforms = with platforms ; linux ;
2016-06-11 19:54:31 +01:00
} ;
}