From edfd0b67c38bbbe5db707a2937afac051f938dfa Mon Sep 17 00:00:00 2001 From: Zack A Date: Mon, 30 Aug 2021 04:25:51 -0700 Subject: [PATCH] lite-xl: init at 2.0.1 Co-authored-by: Bobby Rong Co-authored-by: OPNA2608 Co-authored-by: SuperSandro2000 Co-authored-by: Samuel Ainsworth --- pkgs/applications/editors/lite-xl/default.nix | 65 +++++++++++++++++++ pkgs/development/libraries/agg/default.nix | 12 ++-- pkgs/top-level/all-packages.nix | 4 ++ 3 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 pkgs/applications/editors/lite-xl/default.nix diff --git a/pkgs/applications/editors/lite-xl/default.nix b/pkgs/applications/editors/lite-xl/default.nix new file mode 100644 index 000000000000..3b38004eddba --- /dev/null +++ b/pkgs/applications/editors/lite-xl/default.nix @@ -0,0 +1,65 @@ +{ agg +, fetchFromGitHub +, fetchpatch +, Foundation +, freetype +, lib +, lua5_2 +, meson +, ninja +, pcre2 +, pkg-config +, reproc +, SDL2 +, stdenv +}: + +stdenv.mkDerivation rec { + pname = "lite-xl"; + version = "2.0.1"; + + src = fetchFromGitHub { + owner = "lite-xl"; + repo = "lite-xl"; + rev = "v${version}"; + sha256 = "sha256-+RbmT6H/5Ldhv3qOClxMjCSGMudbkGtkjo2SpGqExao="; + }; + + patches = [ + # Fixes compatibility with Lua5.2, remove patch when PR merged + # https://github.com/lite-xl/lite-xl/pull/435 + (fetchpatch { + name = "0001-replace-unpack-with-table.unpack.patch"; + url = "https://github.com/lite-xl/lite-xl/commit/30ccde896d1ffe37cbd8990e9b8aaef275e18935.patch"; + sha256 = "sha256-IAe3jIyD3OtZtu1V7MtPR4QzFKvU/aV/nLQ4U9nHyIQ="; + }) + # Lets meson fallback to the system reproc if available. + # remove patch when 2.0.2 is proposed. + (fetchpatch { + name = "0002-use-dependency-fallbacks-use-system-reproc-if-available.patch"; + url = "https://github.com/lite-xl/lite-xl/commit/973acb787aacb0164b2f4ae6fe335d250ba80a7b.patch"; + sha256 = "sha256-GmgATsRlj1FePmw3+AoWEMZIo2eujHYewKQCx583qbU="; + }) + ]; + + nativeBuildInputs = [ meson ninja pkg-config ]; + + buildInputs = [ + agg + freetype + lua5_2 + pcre2 + reproc + SDL2 + ] ++ lib.optionals stdenv.isDarwin [ + Foundation + ]; + + meta = with lib; { + description = "A lightweight text editor written in Lua"; + homepage = "https://github.com/lite-xl/lite-xl"; + license = licenses.mit; + maintainers = with maintainers; [ boppyt ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/libraries/agg/default.nix b/pkgs/development/libraries/agg/default.nix index 652a00e05f55..e5ce7537f250 100644 --- a/pkgs/development/libraries/agg/default.nix +++ b/pkgs/development/libraries/agg/default.nix @@ -8,11 +8,13 @@ stdenv.mkDerivation rec { url = "https://www.antigrain.com/${pname}-${version}.tar.gz"; sha256 = "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb"; }; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ + nativeBuildInputs = [ + pkg-config autoconf automake libtool + ]; + buildInputs = [ freetype SDL ] ++ lib.optionals stdenv.isLinux [ @@ -30,12 +32,10 @@ stdenv.mkDerivation rec { sh autogen.sh ''; - configureFlags = [ - (lib.strings.enableFeature stdenv.isLinux "platform") - "--enable-examples=no" - ] ++ lib.optionals stdenv.isLinux [ + configureFlags = lib.optionals stdenv.isLinux [ "--x-includes=${lib.getDev libX11}/include" "--x-libraries=${lib.getLib libX11}/lib" + "--enable-examples=no" ]; # libtool --tag=CXX --mode=link g++ -g -O2 libexamples.la ../src/platform/X11/libaggplatformX11.la ../src/libagg.la -o alpha_mask2 alpha_mask2.o diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b777ba8f7b14..19c166c1d25b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3029,6 +3029,10 @@ with pkgs; lite = callPackage ../applications/editors/lite { }; + lite-xl = callPackage ../applications/editors/lite-xl { + inherit (darwin.apple_sdk.frameworks) Foundation; + }; + loadwatch = callPackage ../tools/system/loadwatch { }; loccount = callPackage ../development/tools/misc/loccount { };