Unverified Commit 8f259c9d authored by Yueh-Shun Li's avatar Yueh-Shun Li Committed by GitHub
Browse files

libchewing: 0.6.0 -> 0.9.1 (#403791)

parents c94b3096 16c816d5
Loading
Loading
Loading
Loading
+32 −11
Original line number Diff line number Diff line
@@ -4,31 +4,52 @@
  fetchFromGitHub,
  cmake,
  sqlite,
  corrosion,
  rustPlatform,
  cargo,
  rustc,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "libchewing";
  version = "0.6.0";
  version = "0.9.1";

  src = fetchFromGitHub {
    owner = "chewing";
    repo = "libchewing";
    rev = "v${finalAttrs.version}";
    sha256 = "sha256-X+4Rr5Mfc4qeJxmHczu4MKgHBvQN1rhqUrJSx8SFnDk=";
    tag = "v${finalAttrs.version}";
    hash = "sha256-5aeAsvTiUMTm+ibNfJI57rzSUpJB7luhA/aWmTcnBj4=";
  };

  buildInputs = [ sqlite ];
  # ld: unknown option: -version-script
  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
    substituteInPlace CMakeLists.txt \
      --replace-fail "if(CMAKE_C_COMPILER_ID MATCHES GNU|^Clang)" "if((CMAKE_C_COMPILER_ID MATCHES GNU|^Clang) AND NOT APPLE)"
  '';

  nativeBuildInputs = [ cmake ];
  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit (finalAttrs) src;
    hash = "sha256-LTuUhQ0ZeyGloNvVs+6OGjFvPdBsQNZupwC8QTjUfyk=";
  };

  nativeBuildInputs = [
    cmake
    rustPlatform.cargoSetupHook
    cargo
    rustc
  ];

  meta = with lib; {
  buildInputs = [
    sqlite
    corrosion
  ];

  meta = {
    description = "Intelligent Chinese phonetic input method";
    homepage = "https://chewing.im/";
    license = licenses.lgpl21Only;
    maintainers = with maintainers; [
      ShamrockLee
    ];
    platforms = platforms.all;
    license = lib.licenses.lgpl21Only;
    maintainers = with lib.maintainers; [ ShamrockLee ];
    platforms = lib.platforms.all;
    # compile time tools init_database, dump_database are built for host
    broken = !stdenv.buildPlatform.canExecute stdenv.hostPlatform;
  };