nixpkgs/pkgs/by-name/ec/ec2-api-tools/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

40 lines
919 B
Nix

{ lib
, stdenv
, fetchurl
, unzip
, makeWrapper
, jre
}:
stdenv.mkDerivation rec {
pname = "ec2-api-tools";
version = "1.7.5.1";
src = fetchurl {
url = "http://s3.amazonaws.com/ec2-downloads/${pname}-${version}.zip";
sha256 = "sha256-hRq+MEA+4chqPr3d9bS//X70tYcRBTD+rfAJVNmuLzo=";
};
nativeBuildInputs = [ makeWrapper unzip ];
installPhase = ''
d=$out/libexec/ec2-api-tools
mkdir -p $d
mv * $d
rm $d/bin/*.cmd # Windows stuff
for i in $d/bin/*; do
b=$(basename $i)
if [ $b = "ec2-cmd" ]; then continue; fi
makeWrapper $i $out/bin/$(basename $i) \
--set EC2_HOME $d \
--set JAVA_HOME ${jre}
done
'';
meta = {
homepage = "http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351";
description = "Command-line tools to create and manage Amazon EC2 virtual machines";
license = lib.licenses.amazonsl;
};
}