Skip to content

Commit

Permalink
gz-tools: init
Browse files Browse the repository at this point in the history
  • Loading branch information
Pandapip1 committed Nov 24, 2024
1 parent 06a0f1c commit c6dd1a4
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkgs/development/tools/gz-tools/1.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ callPackage, fetchpatch }:

(callPackage ./generic.nix {
gz-cmake = null;
})
{
version = "1.5.0";
hash = "sha256-HgYT7MARRnOdUuUllxRn9pl7tsWO5RDIFDObzJQgZpc=";
}
13 changes: 13 additions & 0 deletions pkgs/development/tools/gz-tools/2.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
callPackage,
fetchpatch,
gz-cmake_3,
}:

(callPackage ./generic.nix {
gz-cmake = gz-cmake_3;
})
{
version = "2.0.1";
hash = "sha256-sV/T53oVk1fgjwqn/SRTaPTukt+vAlGGxGvTN8+G6Mo=";
}
53 changes: 53 additions & 0 deletions pkgs/development/tools/gz-tools/generic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
ruby,
gz-cmake,
}:

{
version,
hash ? lib.fakeHash,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "gz-tools";
inherit version;

src = fetchFromGitHub rec {
owner = "gazebosim";
repo = "gz-tools";
rev = "refs/tags/${
if lib.versionAtLeast finalAttrs.version "2.0.0" then "gz-tools" else "ignition-tools"
}${
if lib.versions.major finalAttrs.version != "1" then lib.versions.major finalAttrs.version else ""
}_${finalAttrs.version}";
inherit hash;
};

nativeBuildInputs = [
cmake
gz-cmake
];
buildInputs = [
ruby
];

postFixup = ''
patchShebangs --build $out
'';

meta = {
homepage = "https://bitbucket.org/ignitionrobotics/ign-tools";
description = "Ignition entry point for using all the suite of ignition tools";
mainProgram = if lib.versionAtLeast finalAttrs.version "2.0.0" then "gz" else "ign";
license = lib.licenses.asl20;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [
pandapip1
lopsided98
];
};
})
7 changes: 7 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3793,6 +3793,13 @@ with pkgs;
ignition-transport_8
ignition-transport_11;

inherit ({
ignition-tools_1 = callPackage ../development/tools/gz-tools/1.nix { };
gz-tools_2 = callPackage ../development/tools/gz-tools/2.nix { };
})
ignition-tools_1
gz-tools_2;

gzip = callPackage ../tools/compression/gzip { };

pdisk = callPackage ../tools/system/pdisk {
Expand Down

0 comments on commit c6dd1a4

Please sign in to comment.