Commit 4a757396 authored by Guy Chronister's avatar Guy Chronister
Browse files

zookeeper: refactor to use finalAttrs

- wrap derivation in `stdenv.mkDerivation (finalAttrs: { ... })`
- replace `${pname}`/`${version}` with `${finalAttrs.version}` in `src` URL
- update `meta.changelog` to interpolate `finalAttrs.version`

This removes reliance on `rec` and ensures attribute references are
scoped through `finalAttrs`, improving clarity and consistency with
current Nixpkgs conventions.
parent 28e237f3
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -13,12 +13,12 @@ let
  # https://zookeeper.apache.org/doc/r3.9.2/zookeeperAdmin.html#sc_requiredSoftware
  jre = jdk11_headless;
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "zookeeper";
  version = "3.9.3";

  src = fetchurl {
    url = "mirror://apache/zookeeper/${pname}-${version}/apache-${pname}-${version}-bin.tar.gz";
    url = "mirror://apache/zookeeper/zookeeper-${finalAttrs.version}/apache-zookeeper-${finalAttrs.version}-bin.tar.gz";
    hash = "sha512-1E2HDBaRZi778ai68YWckBuCDcX/Fjs26BvrJ7b7880xtfHwdWl+2q9tPnpMsMyS+STc/2SylO8T1TVYm9rxQw==";
  };

@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
  meta = {
    homepage = "https://zookeeper.apache.org";
    description = "Apache Zookeeper";
    changelog = "https://zookeeper.apache.org/doc/r${version}/releasenotes.html";
    changelog = "https://zookeeper.apache.org/doc/r${finalAttrs.version}/releasenotes.html";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [
      nathan-gs
@@ -62,4 +62,4 @@ stdenv.mkDerivation rec {
    platforms = lib.platforms.unix;
    sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
  };
}
})