1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-20 21:17:46 +00:00
nixpkgs/pkgs/development/tools/oq/default.nix

47 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, fetchFromGitHub, crystal, jq, libxml2, makeWrapper, fetchpatch }:
2019-12-05 10:56:33 +00:00
crystal.buildCrystalPackage rec {
pname = "oq";
2020-05-10 16:05:51 +01:00
version = "1.1.0";
2019-12-05 10:56:33 +00:00
src = fetchFromGitHub {
owner = "Blacksmoke16";
repo = pname;
rev = "v${version}";
2020-05-10 16:05:51 +01:00
sha256 = "1zg4kxpfi3sap4cwp42zg46j5dv0nf926qdqm7k22ncm6jdrgpgw";
2019-12-05 10:56:33 +00:00
};
patches = [
(fetchpatch {
# remove once we have upgraded to oq 1.1.2+
name = "yaml-test-leniency.patch";
url = "https://github.com/Blacksmoke16/oq/commit/93ed2fe50c9ce3fd8d35427e007790ddaaafce60.patch";
sha256 = "1iyz0c0w0ykz268bkrlqwvh1jnnrja0mqip6y89sbpa14lp0l37n";
})
];
2019-12-05 10:56:33 +00:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jq libxml2 ];
2020-05-10 15:54:34 +01:00
format = "crystal";
2019-12-05 10:56:33 +00:00
crystalBinaries.oq.src = "src/oq_cli.cr";
2020-05-10 15:54:34 +01:00
preCheck = ''
mkdir bin
cp oq bin/oq
'';
2019-12-05 10:56:33 +00:00
postInstall = ''
wrapProgram "$out/bin/oq" \
--prefix PATH : "${lib.makeBinPath [ jq ]}"
'';
meta = with lib; {
description = "A performant, and portable jq wrapper";
homepage = "https://blacksmoke16.github.io/oq/";
license = licenses.mit;
maintainers = with maintainers; [ Br1ght0ne ];
platforms = platforms.unix;
2019-12-05 10:56:33 +00:00
};
}