mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-19 16:45:49 +01:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
61 lines
1.7 KiB
Nix
61 lines
1.7 KiB
Nix
{ stdenv, lib, fetchurl, fetchFromGitHub
|
|
, jre, makeWrapper, bash, gnused }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "confluent-platform";
|
|
version = "5.3.0";
|
|
scalaVersion = "2.12";
|
|
|
|
src = fetchurl {
|
|
url = "http://packages.confluent.io/archive/${lib.versions.majorMinor version}/confluent-${version}-${scalaVersion}.tar.gz";
|
|
sha256 = "14cilq63fib5yvj40504aj6wssi7xw4f7c2jadlzdmdxzh4ixqmp";
|
|
};
|
|
|
|
confluentCli = fetchFromGitHub {
|
|
owner = "confluentinc";
|
|
repo = "confluent-cli";
|
|
rev = "v${version}";
|
|
sha256 = "18yvp56b8l074qfkgr4afirgd43g8b023n9ija6dnk6p6dib1f4j";
|
|
};
|
|
|
|
buildInputs = [ jre makeWrapper bash ];
|
|
|
|
installPhase = ''
|
|
cp -R $confluentCli confluent-cli
|
|
chmod -R +w confluent-cli
|
|
|
|
(
|
|
export CONFLUENT_HOME=$PWD
|
|
cd confluent-cli
|
|
make install
|
|
)
|
|
|
|
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
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://www.confluent.io/";
|
|
description = "Confluent event streaming platform based on Apache Kafka";
|
|
license = licenses.asl20;
|
|
maintainers = [ maintainers.offline ];
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|