nixpkgs/pkgs/by-name/co/confluent-platform/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

63 lines
1.4 KiB
Nix

{
bash
, fetchurl
, gnused
, jre
, lib
, makeBinaryWrapper
, stdenv
}:
stdenv.mkDerivation (finalAttrs: {
pname = "confluent-platform";
version = "7.7.0";
src = fetchurl {
url = "https://packages.confluent.io/archive/${lib.versions.majorMinor finalAttrs.version}/confluent-${finalAttrs.version}.tar.gz";
hash = "sha256-w5dazjSZTv/zqNcOcmyUUu8z5wftsJtBeU3bO1WhQ6k=";
};
nativeBuildInputs = [
makeBinaryWrapper
];
buildInputs = [
bash
jre
];
installPhase = ''
runHook preInstall
mkdir -p $out
cp -R bin etc share src $out
rm -rf $out/bin/windows
patchShebangs $out/bin
# allow us the specify logging directory using env
substituteInPlace $out/bin/kafka-run-class \
--replace 'LOG_DIR="$base_dir/logs"' 'LOG_DIR="$KAFKA_LOG_DIR"'
substituteInPlace $out/bin/ksql-run-class \
--replace 'LOG_DIR="$base_dir/logs"' 'LOG_DIR="$KAFKA_LOG_DIR"'
for p in $out/bin\/*; do
wrapProgram $p \
--set JAVA_HOME "${jre}" \
--set KAFKA_LOG_DIR "/tmp/apache-kafka-logs" \
--prefix PATH : "${jre}/bin:${bash}/bin:${gnused}/bin"
done
runHook postInstall
'';
meta = {
description = "Confluent event streaming platform based on Apache Kafka";
homepage = "https://www.confluent.io/";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ zoedsoupe autophagy ];
platforms = lib.platforms.unix;
};
})