Unverified Commit 7c9a659c authored by Zane van Iperen's avatar Zane van Iperen
Browse files

openrussian-cli: fix build & misc cleanups

* Backport patch to fix DB generation after SQLite's removal of "" handling
* Format
* Convert to pkgs/by-name
* Mark broken on Darwin because the mysql2sqlite script hangs.
parent 0643b928
Loading
Loading
Loading
Loading
+83 −0
Original line number Diff line number Diff line
{ stdenv, lib, fetchFromGitHub, pkg-config, wget, unzip
, sqlite, which, lua, installShellFiles, makeWrapper
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch
, pkg-config
, wget
, unzip
, sqlite
, which
, lua5_3
, installShellFiles
, makeWrapper
}:
let
  luaEnv = lua.withPackages(p: with p; [ luasql-sqlite3 luautf8 ]);
  luaEnv = lua5_3.withPackages (p: with p; [ luasql-sqlite3 luautf8 ]);
in
stdenv.mkDerivation rec {
  pname = "openrussian-cli";
@@ -12,11 +22,24 @@ stdenv.mkDerivation rec {
    owner = "rhaberkorn";
    repo = "openrussian-cli";
    rev = version;
    sha256  = "1ria7s7dpqip2wdwn35wmkry84g8ghdqnxc9cbxzzq63vl6pgvcn";
    hash = "sha256-lu13Dd3D4P/7Yol1ixt86BHk86y8DMsbFzfi244+KuY=";
  };

  patches = [
    (fetchpatch {
      url = "https://github.com/rhaberkorn/openrussian-cli/commit/984e555acbadbd1aed7df17ab53e2c586a2f8f68.patch";
      hash = "sha256-/z4YrEeuejtCtwiFXksFREwgQoWvtI0Kl9w75KDQfF8=";
    })
  ];

  nativeBuildInputs = [
    pkg-config wget unzip sqlite which installShellFiles makeWrapper
    pkg-config
    wget
    unzip
    sqlite
    which
    installShellFiles
    makeWrapper
  ];

  buildInputs = [ luaEnv ];
@@ -37,8 +60,8 @@ stdenv.mkDerivation rec {
    cp openrussian $out/bin

    wrapProgram $out/bin/openrussian \
      --prefix LUA_PATH ';' '${lua.pkgs.luaLib.genLuaPathAbsStr luaEnv}' \
      --prefix LUA_CPATH ';' '${lua.pkgs.luaLib.genLuaCPathAbsStr luaEnv}'
      --prefix LUA_PATH ';' '${lua5_3.pkgs.luaLib.genLuaPathAbsStr luaEnv}' \
      --prefix LUA_CPATH ';' '${lua5_3.pkgs.luaLib.genLuaCPathAbsStr luaEnv}'

    runHook postInstall
  '';
@@ -54,6 +77,7 @@ stdenv.mkDerivation rec {
    license = with licenses; [ gpl3Only mit cc-by-sa-40 ];
    maintainers = with maintainers; [ zane ];
    mainProgram = "openrussian";
    broken = stdenv.isDarwin; # FIXME: The mysql2sqlite script hangs on Darwin.
    platforms = platforms.unix;
  };
}
+0 −4
Original line number Diff line number Diff line
@@ -11621,10 +11621,6 @@ with pkgs;
  openrgb-plugin-hardwaresync = libsForQt5.callPackage ../applications/misc/openrgb-plugins/hardwaresync { };
  openrussian-cli = callPackage ../misc/openrussian-cli {
    lua = lua5_3;
  };
  opensbi = callPackage ../misc/opensbi { };
  opensc = callPackage ../tools/security/opensc {