1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/applications/terminal-emulators/mlterm/default.nix

121 lines
3.7 KiB
Nix
Raw Normal View History

2020-09-25 10:40:46 +01:00
{ stdenv, lib, fetchurl, pkgconfig, autoconf, makeDesktopItem
2019-05-22 12:03:39 +01:00
, libX11, gdk-pixbuf, cairo, libXft, gtk3, vte
, harfbuzz #substituting glyphs with opentype fonts
, fribidi, m17n_lib #bidi and encoding
, openssl, libssh2 #build-in ssh
, fcitx, ibus, uim #IME
, wrapGAppsHook #color picker in mlconfig
2020-10-31 11:19:03 +00:00
, Cocoa #Darwin
2016-09-16 15:40:19 +01:00
}:
stdenv.mkDerivation rec {
pname = "mlterm";
2020-11-19 07:25:34 +00:00
version = "3.9.1";
src = fetchurl {
url = "mirror://sourceforge/project/mlterm/01release/${pname}-${version}/${pname}-${version}.tar.gz";
2020-11-19 07:25:34 +00:00
sha256 = "03fnynwv7d1aicwk2rp31sgncv5m65agvygqvsgn59v9di40gnnb";
};
nativeBuildInputs = [ pkgconfig autoconf wrapGAppsHook ];
2016-09-16 15:40:19 +01:00
buildInputs = [
2020-10-31 11:19:03 +00:00
libX11
gdk-pixbuf.dev
cairo
libXft
gtk3
harfbuzz
fribidi
] ++ lib.optionals (!stdenv.isDarwin) [
# need linker magic, not adapted for Darwin yet
openssl
libssh2
# Not supported on Darwin
vte
m17n_lib
fcitx
ibus
uim
2016-09-16 15:40:19 +01:00
];
#bad configure.ac and Makefile.in everywhere
preConfigure = ''
sed -ie 's;-L/usr/local/lib -R/usr/local/lib;;g' \
main/Makefile.in \
2016-09-16 15:40:19 +01:00
tool/mlfc/Makefile.in \
tool/mlimgloader/Makefile.in \
2016-09-16 15:40:19 +01:00
tool/mlconfig/Makefile.in \
2017-02-08 03:35:52 +00:00
uitoolkit/libtype/Makefile.in \
uitoolkit/libotl/Makefile.in
2016-09-16 15:40:19 +01:00
sed -ie 's;cd ..srcdir. && rm -f ...lang..gmo.*;;g' \
tool/mlconfig/po/Makefile.in.in
#utmp and mlterm-fb
substituteInPlace configure.in \
--replace "-m 2755 -g utmp" " " \
--replace "-m 4755 -o root" " "
substituteInPlace configure \
--replace "-m 2755 -g utmp" " " \
--replace "-m 4755 -o root" " "
'';
2020-10-31 11:19:03 +00:00
NIX_LDFLAGS = lib.optionalString (!stdenv.isDarwin) "
-L${stdenv.cc.cc.lib}/lib
-lX11 -lgdk_pixbuf-2.0 -lcairo -lfontconfig -lfreetype -lXft
-lvte-2.91 -lgtk-3 -lharfbuzz -lfribidi -lm17n
2020-09-25 10:40:46 +01:00
" + lib.optionalString (openssl != null) "
-lcrypto
2020-09-25 10:40:46 +01:00
" + lib.optionalString (libssh2 != null) "
-lssh2
";
configureFlags = [
"--with-imagelib=gdk-pixbuf" #or mlimgloader depending on your bugs of choice
"--with-type-engines=cairo,xft,xcore"
"--with-gtk=3.0"
"--enable-ind" #indic scripts
"--enable-fribidi" #bidi scripts
2016-09-16 15:40:19 +01:00
"--with-tools=mlclient,mlconfig,mlcc,mlterm-menu,mlimgloader,registobmp,mlfc"
#mlterm-menu and mlconfig depend on enabling gnome3.at-spi2-core
#and configuring ~/.mlterm/key correctly.
2020-10-31 11:19:03 +00:00
] ++ lib.optionals (!stdenv.isDarwin) [
"--with-x=yes"
"--with-gui=xlib,fb"
"--enable-m17nlib" #character encodings
] ++ lib.optionals stdenv.isDarwin [
"--with-gui=quartz"
] ++ lib.optionals (libssh2 == null) [ " --disable-ssh2" ];
postInstall = ''
2017-02-08 03:35:52 +00:00
install -D contrib/icon/mlterm-icon.svg "$out/share/icons/hicolor/scalable/apps/mlterm.svg"
install -D contrib/icon/mlterm-icon-gnome2.png "$out/share/icons/hicolor/48x48/apps/mlterm.png"
install -D -t $out/share/applications $desktopItem/share/applications/*
2020-10-31 11:19:03 +00:00
'' + lib.optionalString stdenv.isDarwin ''
mkdir -p $out/Applications/
cp -a cocoa/mlterm.app $out/Applications/
install $out/bin/mlterm -Dt $out/Applications/mlterm.app/Contents/MacOS/
'';
2019-08-13 22:52:01 +01:00
desktopItem = makeDesktopItem {
name = "mlterm";
exec = "mlterm %U";
icon = "mlterm";
type = "Application";
comment = "Terminal emulator";
desktopName = "mlterm";
genericName = "Terminal emulator";
2020-09-25 10:40:46 +01:00
categories = lib.concatStringsSep ";" [
"Application" "System" "TerminalEmulator"
];
startupNotify = "false";
};
2020-09-25 10:40:46 +01:00
meta = with lib; {
2020-10-31 11:19:03 +00:00
description = "Multi Lingual TERMinal emulator";
homepage = "http://mlterm.sourceforge.net/";
license = licenses.bsd3;
2020-10-31 11:32:38 +00:00
maintainers = with maintainers; [ vrthra ramkromberg atemu ];
2020-10-31 11:19:03 +00:00
platforms = with platforms; linux ++ darwin;
};
}