From 0f6857d433fd376d357c2d67afb61072187cecce Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 14 Apr 2023 20:50:33 +0300 Subject: mlterm: desktopItem: update attributes to remove warnings Remove deprecated `Application` category and make `comment` different then `name`. --- pkgs/applications/terminal-emulators/mlterm/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/terminal-emulators/mlterm/default.nix b/pkgs/applications/terminal-emulators/mlterm/default.nix index cc26d4eea295d..20fe040a76df7 100644 --- a/pkgs/applications/terminal-emulators/mlterm/default.nix +++ b/pkgs/applications/terminal-emulators/mlterm/default.nix @@ -95,10 +95,10 @@ stdenv.mkDerivation rec { exec = "mlterm %U"; icon = "mlterm"; type = "Application"; - comment = "Terminal emulator"; + comment = "Multi Lingual TERMinal emulator"; desktopName = "mlterm"; genericName = "Terminal emulator"; - categories = [ "Application" "System" "TerminalEmulator" ]; + categories = [ "System" "TerminalEmulator" ]; startupNotify = false; }; -- cgit 1.4.1 From c5a159637d0c97de30ff490e74bea8d8cea1a27a Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sat, 15 Apr 2023 01:51:15 +0300 Subject: mlterm: add doronbehar as maintainer --- pkgs/applications/terminal-emulators/mlterm/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/terminal-emulators/mlterm/default.nix b/pkgs/applications/terminal-emulators/mlterm/default.nix index 20fe040a76df7..66148adde2d2e 100644 --- a/pkgs/applications/terminal-emulators/mlterm/default.nix +++ b/pkgs/applications/terminal-emulators/mlterm/default.nix @@ -108,7 +108,7 @@ stdenv.mkDerivation rec { description = "Multi Lingual TERMinal emulator"; homepage = "https://mlterm.sourceforge.net/"; license = licenses.bsd3; - maintainers = with maintainers; [ ramkromberg atemu ]; + maintainers = with maintainers; [ ramkromberg atemu doronbehar ]; platforms = platforms.all; }; } -- cgit 1.4.1 From a4f65246a09e08246d1eee2c1fad7f537cfb4bd0 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 14 Apr 2023 20:45:58 +0300 Subject: mlterm: cleanup `Cocoa` unused input --- pkgs/applications/terminal-emulators/mlterm/default.nix | 1 - pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/applications/terminal-emulators/mlterm/default.nix b/pkgs/applications/terminal-emulators/mlterm/default.nix index 66148adde2d2e..bc93f167e85dd 100644 --- a/pkgs/applications/terminal-emulators/mlterm/default.nix +++ b/pkgs/applications/terminal-emulators/mlterm/default.nix @@ -5,7 +5,6 @@ , libssh2 #build-in ssh , fcitx5, fcitx5-gtk, ibus, uim #IME , wrapGAppsHook #color picker in mlconfig -, Cocoa #Darwin }: stdenv.mkDerivation rec { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cba86cf44d7fe..b89a588ea051e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2571,9 +2571,7 @@ with pkgs; microcom = callPackage ../applications/terminal-emulators/microcom { }; - mlterm = darwin.apple_sdk_11_0.callPackage ../applications/terminal-emulators/mlterm { - inherit (darwin.apple_sdk_11_0.frameworks) Cocoa; - }; + mlterm = darwin.apple_sdk_11_0.callPackage ../applications/terminal-emulators/mlterm { }; mrxvt = callPackage ../applications/terminal-emulators/mrxvt { }; -- cgit 1.4.1 From 66d6ebe593b7c14b0f071979057347b43bfdf5e3 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 14 Apr 2023 22:49:24 +0300 Subject: mlterm: enable to configure many build features declaratively --- .../terminal-emulators/mlterm/default.nix | 165 +++++++++++++++++---- 1 file changed, 134 insertions(+), 31 deletions(-) diff --git a/pkgs/applications/terminal-emulators/mlterm/default.nix b/pkgs/applications/terminal-emulators/mlterm/default.nix index bc93f167e85dd..217c6552efdd6 100644 --- a/pkgs/applications/terminal-emulators/mlterm/default.nix +++ b/pkgs/applications/terminal-emulators/mlterm/default.nix @@ -1,13 +1,98 @@ -{ stdenv, lib, fetchFromGitHub, pkg-config, autoconf, makeDesktopItem, nixosTests -, libX11, gdk-pixbuf, cairo, libXft, gtk3, vte -, harfbuzz #substituting glyphs with opentype fonts -, fribidi, m17n_lib #bidi and encoding +{ stdenv +, lib +, fetchFromGitHub +, pkg-config +, autoconf +, makeDesktopItem +, nixosTests +, vte +, harfbuzz # can be replaced with libotf +, fribidi +, m17n_lib , libssh2 #build-in ssh -, fcitx5, fcitx5-gtk, ibus, uim #IME +, fcitx5 +, fcitx5-gtk +, ibus +, uim #IME , wrapGAppsHook #color picker in mlconfig +, gdk-pixbuf +, gtk3 +, gtk ? gtk3 +# List of gui libraries to use. According to `./configure --help` ran on +# release 3.9.3, options are: (xlib|win32|fb|quartz|console|wayland|sdl2|beos) +, enableGuis ? { + xlib = enableX11; + fb = stdenv.isLinux; + quartz = stdenv.isDarwin; + wayland = stdenv.isLinux; + sdl2 = true; +} +, libxkbcommon +, wayland # for the "wayland" --with-gui option +, SDL2 # for the "sdl" --with-gui option +# List of typing engines, the default list enables compiling all of the +# available ones, as recorded on release 3.9.3 +, enableTypeEngines ? { + xcore = false; # Considered legacy + xft = enableX11; + cairo = true; +} +, libX11 +, libXft +, cairo +# List of external tools to create, this default list includes all default +# tools, as recorded on release 3.9.3. +, enableTools ? { + mlclient = true; + mlconfig = true; + mlcc = true; + mlterm-menu = true; + # Note that according to upstream's ./configure script, to disable + # mlimgloader you have to disable _all_ tools. See: + # https://github.com/arakiken/mlterm/issues/69 + mlimgloader = true; + registobmp = true; + mlfc = true; +} +# Whether to enable the X window system +, enableX11 ? stdenv.isLinux +# Most of the input methods and other build features are enabled by default, +# the following attribute set can be used to disable some of them. It's parsed +# when we set `configureFlags`. If you find other configure Flags that require +# dependencies, it'd be nice to make that contribution here. +, enableFeatures ? { + uim = !stdenv.isDarwin; + ibus = !stdenv.isDarwin; + fcitx = !stdenv.isDarwin; + m17n = !stdenv.isDarwin; + ssh2 = true; + bidi = true; + # Open Type layout support, (substituting glyphs with opentype fonts) + otl = true; +} +# Configure the Exec directive in the generated .desktop file +, desktopBinary ? ( + if enableGuis.xlib then + "mlterm" + else if enableGuis.wayland then + "mlterm-wl" + else if enableGuis.sdl2 then + "mlterm-sdl2" + else + throw "mlterm: couldn't figure out what desktopBinary to use." + ) }: -stdenv.mkDerivation rec { +let + # Returns a --with-feature=, or `--without-feature` if all attributes are false or don't + # exist. Used later in configureFlags + withFeaturesList = featureName: attrset: let + commaSepList = lib.concatStringsSep "," (builtins.attrNames (lib.filterAttrs (n: v: v) attrset)); + in + lib.withFeatureAs (commaSepList != "") featureName commaSepList + ; +in stdenv.mkDerivation rec { pname = "mlterm"; version = "3.9.3"; @@ -18,25 +103,41 @@ stdenv.mkDerivation rec { sha256 = "sha256-gfs5cdwUUwSBWwJJSaxrQGWJvLkI27RMlk5QvDALEDg="; }; - nativeBuildInputs = [ pkg-config autoconf wrapGAppsHook ]; + nativeBuildInputs = [ + pkg-config + autoconf + ] ++ lib.optionals enableTools.mlconfig [ + wrapGAppsHook + ]; buildInputs = [ + gtk + vte + gdk-pixbuf + ] ++ lib.optionals enableTypeEngines.xcore [ libX11 - gdk-pixbuf.dev - cairo + ] ++ lib.optionals enableTypeEngines.xft [ libXft - gtk3 + ] ++ lib.optionals enableTypeEngines.cairo [ + cairo + ] ++ lib.optionals enableGuis.wayland [ + libxkbcommon + wayland + ] ++ lib.optionals enableGuis.sdl2 [ + SDL2 + ] ++ lib.optionals enableFeatures.otl [ harfbuzz + ] ++ lib.optionals enableFeatures.bidi [ fribidi - vte - + ] ++ lib.optionals enableFeatures.ssh2 [ libssh2 - ] ++ lib.optionals (!stdenv.isDarwin) [ - # Not supported on Darwin + ] ++ lib.optionals enableFeatures.m17n [ m17n_lib - + ] ++ lib.optionals enableFeatures.fcitx [ fcitx5 fcitx5-gtk + ] ++ lib.optionals enableFeatures.ibus [ ibus + ] ++ lib.optionals enableFeatures.uim [ uim ]; @@ -61,20 +162,13 @@ stdenv.mkDerivation rec { ''; 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 - "--with-tools=mlclient,mlconfig,mlcc,mlterm-menu,mlimgloader,registobmp,mlfc" - #mlterm-menu and mlconfig depend on enabling gnome.at-spi2-core - #and configuring ~/.mlterm/key correctly. - ] ++ lib.optionals (!stdenv.isDarwin) [ - "--with-x=yes" - "--with-gui=xlib,fb" - "--enable-m17nlib" #character encodings - ] ++ lib.optionals stdenv.isDarwin [ - "--with-gui=quartz" + (withFeaturesList "type-engines" enableTypeEngines) + (withFeaturesList "tools" enableTools) + (withFeaturesList "gui" enableGuis) + (lib.withFeature enableX11 "x") + ] ++ lib.optionals (gtk != null) [ + "--with-gtk=${lib.versions.major gtk.version}.0" + ] ++ (lib.mapAttrsToList (n: v: lib.enableFeature v n) enableFeatures) ++ [ ]; enableParallelBuilding = true; @@ -91,7 +185,7 @@ stdenv.mkDerivation rec { desktopItem = makeDesktopItem { name = "mlterm"; - exec = "mlterm %U"; + exec = "${desktopBinary} %U"; icon = "mlterm"; type = "Application"; comment = "Multi Lingual TERMinal emulator"; @@ -101,7 +195,15 @@ stdenv.mkDerivation rec { startupNotify = false; }; - passthru.tests.test = nixosTests.terminal-emulators.mlterm; + passthru = { + tests.test = nixosTests.terminal-emulators.mlterm; + inherit + enableTypeEngines + enableTools + enableGuis + enableFeatures + ; + }; meta = with lib; { description = "Multi Lingual TERMinal emulator"; @@ -109,5 +211,6 @@ stdenv.mkDerivation rec { license = licenses.bsd3; maintainers = with maintainers; [ ramkromberg atemu doronbehar ]; platforms = platforms.all; + mainProgram = desktopBinary; }; } -- cgit 1.4.1 From 52016d5cf70bdf0950349f64f9176a8113dc8904 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 18 Apr 2023 16:45:55 +0300 Subject: mlterm-wayland: init --- pkgs/top-level/all-packages.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b89a588ea051e..daccf835f94dc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2572,6 +2572,9 @@ with pkgs; microcom = callPackage ../applications/terminal-emulators/microcom { }; mlterm = darwin.apple_sdk_11_0.callPackage ../applications/terminal-emulators/mlterm { }; + mlterm-wayland = mlterm.override { + enableX11 = false; + }; mrxvt = callPackage ../applications/terminal-emulators/mrxvt { }; -- cgit 1.4.1