Unverified Commit 0b809abb authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #334670 from philiptaron/issue-333254/gitlab-for-qrtool

qrtool: switch to GitLab
parents fdb981ff 24bf96e2
Loading
Loading
Loading
Loading
+24 −18
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, asciidoctor
, installShellFiles
{
  lib,
  stdenv,
  fetchFromGitLab,
  rustPlatform,
  asciidoctor,
  installShellFiles,
}:

rustPlatform.buildRustPackage rec {
  pname = "qrtool";
  version = "0.11.4";

  src = fetchFromGitHub {
  src = fetchFromGitLab {
    owner = "sorairolake";
    repo = "qrtool";
    rev = "v${version}";
    sha256 = "sha256-lD/xi2k5baZGUUixy/032jTBevr0uQIT/JmX+d+kPyA=";
    hash = "sha256-lD/xi2k5baZGUUixy/032jTBevr0uQIT/JmX+d+kPyA=";
  };

  cargoHash = "sha256-lR/LusIgdA+G7YeSLHjxdcC96tOSqSyalVamS42ORs0=";

  nativeBuildInputs = [ asciidoctor installShellFiles ];
  nativeBuildInputs = [
    asciidoctor
    installShellFiles
  ];

  postInstall = ''
  postInstall =
    ''
      # Built by ./build.rs using `asciidoctor`
      installManPage ./target/*/release/build/qrtool*/out/*.?

  '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    ''
    + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
      installShellCompletion --cmd qrtool \
        --bash <($out/bin/qrtool --generate-completion bash) \
        --fish <($out/bin/qrtool --generate-completion fish) \