From 21ab9be498cd0205cc714f2d4c7fb6c5e419c727 Mon Sep 17 00:00:00 2001 From: Zane van Iperen Date: Wed, 21 Apr 2021 12:46:44 +1000 Subject: [PATCH] openrussian-cli: init at 1.0.0 --- pkgs/misc/openrussian-cli/default.nix | 61 +++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 63 insertions(+) create mode 100644 pkgs/misc/openrussian-cli/default.nix diff --git a/pkgs/misc/openrussian-cli/default.nix b/pkgs/misc/openrussian-cli/default.nix new file mode 100644 index 000000000000..ce9a9e49c4ca --- /dev/null +++ b/pkgs/misc/openrussian-cli/default.nix @@ -0,0 +1,61 @@ +{ stdenv, lib, fetchFromGitHub, gnumake, pkg-config, wget, unzip, gawk +, sqlite, which, luaPackages, installShellFiles, makeWrapper +}: +stdenv.mkDerivation rec { + pname = "openrussian-cli"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "rhaberkorn"; + repo = "openrussian-cli"; + rev = version; + sha256 = "1ria7s7dpqip2wdwn35wmkry84g8ghdqnxc9cbxzzq63vl6pgvcn"; + }; + + nativeBuildInputs = [ + gnumake pkg-config wget unzip gawk sqlite which installShellFiles makeWrapper + ]; + + buildInputs = with luaPackages; [ lua luasql-sqlite3 luautf8 ]; + + makeFlags = [ + "LUA=${luaPackages.lua}/bin/lua" + "LUAC=${luaPackages.lua}/bin/luac" + ]; + + dontConfigure = true; + + # Disable check as it's too slow. + # doCheck = true; + + #This is needed even though it's the default for some reason. + checkTarget = "check"; + + # Can't use "make install" here + installPhase = '' + runHook preInstall + + mkdir -p $out/bin $out/share/openrussian + cp openrussian-sqlite3.db $out/share/openrussian + cp openrussian $out/bin + + wrapProgram $out/bin/openrussian \ + --prefix LUA_PATH ';' "$LUA_PATH" \ + --prefix LUA_CPATH ';' "$LUA_CPATH" + + runHook postInstall + ''; + + postInstall = '' + installShellCompletion --cmd openrussian --bash ./openrussian-completion.bash + installManPage ./openrussian.1 + ''; + + meta = with lib; { + homepage = "https://github.com/rhaberkorn/openrussian-cli"; + description = "Offline Console Russian Dictionary (based on openrussian.org)"; + license = with licenses; [ gpl3Only mit cc-by-sa-40 ]; + maintainers = with maintainers; [ zane ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 90ab3ca2bc81..ee16baa8044a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7156,6 +7156,8 @@ in openrgb = libsForQt5.callPackage ../applications/misc/openrgb { }; + openrussian-cli = callPackage ../misc/openrussian-cli { }; + opensc = callPackage ../tools/security/opensc { inherit (darwin.apple_sdk.frameworks) Carbon PCSC; };