From 79afb0da4f204c45b57f534ebbb6663b28f1e971 Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Tue, 14 Apr 2026 09:20:29 +0000 Subject: [PATCH 1/3] oracle-instantclient: 21.10.0.0.0 -> 23.26.3.0.0 - x86_64-linux: 21.10.0.0.0 -> 23.26.3.0.0 - aarch64-linux: 19.10.0.0.0 -> 23.26.3.0.0 - aarch64-darwin: 23.3.0.23.09 -> 23.26.2.0.0 The 23.x archives ship a top-level META-INF directory, which is now excluded when unpacking. They also no longer use the dbru suffix or per-component release numbers. Signed-off-by: Nikolaos Karaolidis --- .../or/oracle-instantclient/package.nix | 71 ++++++++----------- 1 file changed, 30 insertions(+), 41 deletions(-) diff --git a/pkgs/by-name/or/oracle-instantclient/package.nix b/pkgs/by-name/or/oracle-instantclient/package.nix index 9d1d30d9d04e..8e3416f0520e 100644 --- a/pkgs/by-name/or/oracle-instantclient/package.nix +++ b/pkgs/by-name/or/oracle-instantclient/package.nix @@ -31,17 +31,17 @@ let # determine the version number, there might be different ones per architecture version = { - x86_64-linux = "21.10.0.0.0"; - aarch64-linux = "19.10.0.0.0"; - aarch64-darwin = "23.3.0.23.09"; + x86_64-linux = "23.26.3.0.0"; + aarch64-linux = "23.26.3.0.0"; + aarch64-darwin = "23.26.2.0.0"; } .${stdenv.hostPlatform.system} or throwSystem; directory = { - x86_64-linux = "2110000"; - aarch64-linux = "191000"; - aarch64-darwin = "233023"; + x86_64-linux = "2326300"; + aarch64-linux = "2326300"; + aarch64-darwin = "2326200"; } .${stdenv.hostPlatform.system} or throwSystem; @@ -49,39 +49,29 @@ let hashes = { x86_64-linux = { - basic = "sha256-uo0QBOmx7TQyroD+As60IhjEkz//+0Cm1tWvLI3edaE="; - sdk = "sha256-TIBFi1jHLJh+SUNFvuL7aJpxh61hG6gXhFIhvdPgpts="; - sqlplus = "sha256-mF9kLjhZXe/fasYDfmZrYPL2CzAp3xDbi624RJDA4lM="; - tools = "sha256-ay8ynzo1fPHbCg9GoIT5ja//iZPIZA2yXI/auVExiRY="; - odbc = "sha256-3M6/cEtUrIFzQay8eHNiLGE+L0UF+VTmzp4cSBcrzlk="; + basic = "sha256-/OSFNhMykn+DKOpLaNmJaMaw6hJOYkcN6MnQzviAEw4="; + sdk = "sha256-esE1h7qKc0rnzAbPQnU7v9vmmDna+HvVk1pJyD3szP0="; + sqlplus = "sha256-ZXDXk5hWdnzbtUm1HhQj1qX1MUPFfDDAFWaXBvZaYyo="; + tools = "sha256-aAtubzt64Tly1MOVmz3E870HWgvtUeXVshkV1VNfNQs="; + odbc = "sha256-Jjz8d7uruWSEcg7fF+g6+5bJF9lvBTrnYhhvCrzm9Aw="; }; aarch64-linux = { - basic = "sha256-DNntH20BAmo5kOz7uEgW2NXaNfwdvJ8l8oMnp50BOsY="; - sdk = "sha256-8VpkNyLyFMUfQwbZpSDV/CB95RoXfaMr8w58cRt/syw="; - sqlplus = "sha256-iHcyijHhAvjsAqN9R+Rxo2R47k940VvPbScc2MWYn0Q="; - tools = "sha256-4QY0EwcnctwPm6ZGDZLudOFM4UycLFmRIluKGXVwR0M="; - odbc = "sha256-T+RIIKzZ9xEg/E72pfs5xqHz2WuIWKx/oRfDrQbw3ms="; + basic = "sha256-dLB0TXvxvij2DD2QoTXl2arKGUa6sK3MDI21+8LMl1g="; + sdk = "sha256-X7A7RhXYbKemRTpBozT8J9ysbYOd1+VBF3MiqvOe4xg="; + sqlplus = "sha256-w8Dvwac0ZV5ITHHzFkYEGKBrpapa8AxV0e2h2racbak="; + tools = "sha256-0lzr6PX96IYT7PKcvI99OpMB8SxHPAseFvzTFlLLrME="; + odbc = "sha256-YlsMBi3tSjyGdjb5QRsny58aGJmWvxDKCxbw4UIEbEQ="; }; aarch64-darwin = { - basic = "sha256-G83bWDhw9wwjLVee24oy/VhJcCik7/GtKOzgOXuo1/4="; - sdk = "sha256-PerfzgietrnAkbH9IT7XpmaFuyJkPHx0vl4FCtjPzLs="; - sqlplus = "sha256-khOjmaExAb3rzWEwJ/o4XvRMQruiMw+UgLFtsOGn1nY="; - tools = "sha256-gA+SbgXXpY12TidpnjBzt0oWQ5zLJg6wUpzpSd/N5W4="; - odbc = "sha256-JzoSdH7mJB709cdXELxWzpgaNTjOZhYH/wLkdzKA2N0="; + basic = "sha256-w8T843pVcZIyJxfBqEIv4Jj8gppB84L1eiiLJK1roR4="; + sdk = "sha256-XuDf/n/wrFXuoZjvaWgcxyn8f98XzJCJ+L/V2TxRQT4="; + sqlplus = "sha256-w7EFNxlKUmej7RjQn92uH4ZBkeDeJa14BClAu4JJYpQ="; + tools = "sha256-cEHZFl/jcMxM51mF2xzxT+0heotePiz+nM4GljUns40="; + odbc = "sha256-N3IFU346SndwqjhdSLpOZ7BJUMV7I76IdYdfd+qiyYQ="; }; } .${stdenv.hostPlatform.system} or throwSystem; - # rels per component and architecture, optional - rels = - { - aarch64-darwin = { - basic = "1"; - tools = "1"; - }; - } - .${stdenv.hostPlatform.system} or { }; - # convert platform to oracle architecture names arch = { @@ -103,26 +93,21 @@ let { aarch64-darwin = ".dmg"; } - .${stdenv.hostPlatform.system} or "dbru.zip"; + .${stdenv.hostPlatform.system} or ".zip"; # calculate the filename of a single zip file - srcFilename = - component: arch: version: rel: - "instantclient-${component}-${arch}-${version}" + (optionalString (rel != "") "-${rel}") + suffix; + srcFilename = component: "instantclient-${component}-${arch}-${version}${suffix}"; # fetcher for the non clickthrough artifacts fetcher = srcFilename: hash: fetchurl { url = "https://download.oracle.com/otn_software/${shortArch}/instantclient/${directory}/${srcFilename}"; - sha256 = hash; + inherit hash; }; # assemble srcs - srcs = map ( - component: - (fetcher (srcFilename component arch version rels.${component} or "") hashes.${component} or "") - ) components; + srcs = map (component: fetcher (srcFilename component) hashes.${component}) components; isDarwinAarch64 = stdenv.hostPlatform.system == "aarch64-darwin"; @@ -151,7 +136,11 @@ stdenv.mkDerivation { "lib" ]; - unpackCmd = if isDarwinAarch64 then "7zz x $curSrc -aoa -oinstantclient" else "unzip $curSrc"; + unpackCmd = + if isDarwinAarch64 then + "7zz x $curSrc -aoa -oinstantclient -x!META-INF" + else + "unzip $curSrc -x 'META-INF/*'"; installPhase = '' mkdir -p "$out/"{bin,include,lib,"share/java","share/${pname}-${version}/demo/"} $lib/lib From ce46be1da40c0f2a9bbd932942403be76b994c1f Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Thu, 15 Oct 2026 08:23:40 +0000 Subject: [PATCH 2/3] oracle-instantclient: add update script Move the per-platform versions and hashes into sources.json and add an update script that scrapes Oracle's download pages for the latest release on each platform. Signed-off-by: Nikolaos Karaolidis --- .../or/oracle-instantclient/package.nix | 54 +++------------ .../or/oracle-instantclient/sources.json | 35 ++++++++++ .../by-name/or/oracle-instantclient/update.sh | 65 +++++++++++++++++++ 3 files changed, 108 insertions(+), 46 deletions(-) create mode 100644 pkgs/by-name/or/oracle-instantclient/sources.json create mode 100755 pkgs/by-name/or/oracle-instantclient/update.sh diff --git a/pkgs/by-name/or/oracle-instantclient/package.nix b/pkgs/by-name/or/oracle-instantclient/package.nix index 8e3416f0520e..15500b514e62 100644 --- a/pkgs/by-name/or/oracle-instantclient/package.nix +++ b/pkgs/by-name/or/oracle-instantclient/package.nix @@ -17,8 +17,6 @@ assert odbcSupport -> unixodbc != null; let inherit (lib) optional optionalString; - throwSystem = "unsupported"; - # assemble list of components components = [ "basic" @@ -28,49 +26,11 @@ let ] ++ optional odbcSupport "odbc"; - # determine the version number, there might be different ones per architecture - version = - { - x86_64-linux = "23.26.3.0.0"; - aarch64-linux = "23.26.3.0.0"; - aarch64-darwin = "23.26.2.0.0"; - } - .${stdenv.hostPlatform.system} or throwSystem; + sources = + (lib.importJSON ./sources.json).${stdenv.hostPlatform.system} + or (throw "Unsupported platform: ${stdenv.hostPlatform.system}"); - directory = - { - x86_64-linux = "2326300"; - aarch64-linux = "2326300"; - aarch64-darwin = "2326200"; - } - .${stdenv.hostPlatform.system} or throwSystem; - - # hashes per component and architecture - hashes = - { - x86_64-linux = { - basic = "sha256-/OSFNhMykn+DKOpLaNmJaMaw6hJOYkcN6MnQzviAEw4="; - sdk = "sha256-esE1h7qKc0rnzAbPQnU7v9vmmDna+HvVk1pJyD3szP0="; - sqlplus = "sha256-ZXDXk5hWdnzbtUm1HhQj1qX1MUPFfDDAFWaXBvZaYyo="; - tools = "sha256-aAtubzt64Tly1MOVmz3E870HWgvtUeXVshkV1VNfNQs="; - odbc = "sha256-Jjz8d7uruWSEcg7fF+g6+5bJF9lvBTrnYhhvCrzm9Aw="; - }; - aarch64-linux = { - basic = "sha256-dLB0TXvxvij2DD2QoTXl2arKGUa6sK3MDI21+8LMl1g="; - sdk = "sha256-X7A7RhXYbKemRTpBozT8J9ysbYOd1+VBF3MiqvOe4xg="; - sqlplus = "sha256-w8Dvwac0ZV5ITHHzFkYEGKBrpapa8AxV0e2h2racbak="; - tools = "sha256-0lzr6PX96IYT7PKcvI99OpMB8SxHPAseFvzTFlLLrME="; - odbc = "sha256-YlsMBi3tSjyGdjb5QRsny58aGJmWvxDKCxbw4UIEbEQ="; - }; - aarch64-darwin = { - basic = "sha256-w8T843pVcZIyJxfBqEIv4Jj8gppB84L1eiiLJK1roR4="; - sdk = "sha256-XuDf/n/wrFXuoZjvaWgcxyn8f98XzJCJ+L/V2TxRQT4="; - sqlplus = "sha256-w7EFNxlKUmej7RjQn92uH4ZBkeDeJa14BClAu4JJYpQ="; - tools = "sha256-cEHZFl/jcMxM51mF2xzxT+0heotePiz+nM4GljUns40="; - odbc = "sha256-N3IFU346SndwqjhdSLpOZ7BJUMV7I76IdYdfd+qiyYQ="; - }; - } - .${stdenv.hostPlatform.system} or throwSystem; + inherit (sources) version directory hashes; # convert platform to oracle architecture names arch = @@ -79,7 +39,7 @@ let aarch64-linux = "linux.arm64"; aarch64-darwin = "macos.arm64"; } - .${stdenv.hostPlatform.system} or throwSystem; + .${stdenv.hostPlatform.system}; shortArch = { @@ -87,7 +47,7 @@ let aarch64-linux = "linux"; aarch64-darwin = "mac"; } - .${stdenv.hostPlatform.system} or throwSystem; + .${stdenv.hostPlatform.system}; suffix = { @@ -157,6 +117,8 @@ stdenv.mkDerivation { ln -sfn $out/bin/sqlplus $out/bin/sqlplus64 ''; + passthru.updateScript = ./update.sh; + postFixup = optionalString stdenv.hostPlatform.isDarwin '' for exe in "$out/bin/"* ; do if [ ! -L "$exe" ]; then diff --git a/pkgs/by-name/or/oracle-instantclient/sources.json b/pkgs/by-name/or/oracle-instantclient/sources.json new file mode 100644 index 000000000000..74d4655049ce --- /dev/null +++ b/pkgs/by-name/or/oracle-instantclient/sources.json @@ -0,0 +1,35 @@ +{ + "aarch64-darwin": { + "version": "23.26.2.0.0", + "directory": "2326200", + "hashes": { + "basic": "sha256-w8T843pVcZIyJxfBqEIv4Jj8gppB84L1eiiLJK1roR4=", + "sdk": "sha256-XuDf/n/wrFXuoZjvaWgcxyn8f98XzJCJ+L/V2TxRQT4=", + "sqlplus": "sha256-w7EFNxlKUmej7RjQn92uH4ZBkeDeJa14BClAu4JJYpQ=", + "tools": "sha256-cEHZFl/jcMxM51mF2xzxT+0heotePiz+nM4GljUns40=", + "odbc": "sha256-N3IFU346SndwqjhdSLpOZ7BJUMV7I76IdYdfd+qiyYQ=" + } + }, + "aarch64-linux": { + "version": "23.26.3.0.0", + "directory": "2326300", + "hashes": { + "basic": "sha256-dLB0TXvxvij2DD2QoTXl2arKGUa6sK3MDI21+8LMl1g=", + "sdk": "sha256-X7A7RhXYbKemRTpBozT8J9ysbYOd1+VBF3MiqvOe4xg=", + "sqlplus": "sha256-w8Dvwac0ZV5ITHHzFkYEGKBrpapa8AxV0e2h2racbak=", + "tools": "sha256-0lzr6PX96IYT7PKcvI99OpMB8SxHPAseFvzTFlLLrME=", + "odbc": "sha256-YlsMBi3tSjyGdjb5QRsny58aGJmWvxDKCxbw4UIEbEQ=" + } + }, + "x86_64-linux": { + "version": "23.26.3.0.0", + "directory": "2326300", + "hashes": { + "basic": "sha256-/OSFNhMykn+DKOpLaNmJaMaw6hJOYkcN6MnQzviAEw4=", + "sdk": "sha256-esE1h7qKc0rnzAbPQnU7v9vmmDna+HvVk1pJyD3szP0=", + "sqlplus": "sha256-ZXDXk5hWdnzbtUm1HhQj1qX1MUPFfDDAFWaXBvZaYyo=", + "tools": "sha256-aAtubzt64Tly1MOVmz3E870HWgvtUeXVshkV1VNfNQs=", + "odbc": "sha256-Jjz8d7uruWSEcg7fF+g6+5bJF9lvBTrnYhhvCrzm9Aw=" + } + } +} diff --git a/pkgs/by-name/or/oracle-instantclient/update.sh b/pkgs/by-name/or/oracle-instantclient/update.sh new file mode 100755 index 000000000000..92a471efc801 --- /dev/null +++ b/pkgs/by-name/or/oracle-instantclient/update.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl gnugrep gnused coreutils jq nix git +# shellcheck shell=bash + +# Scrapes the Oracle Instant Client download pages for the latest release on +# each platform and regenerates sources.json. + +set -euo pipefail + +sources="$(git rev-parse --show-toplevel)/pkgs/by-name/or/oracle-instantclient/sources.json" + +components=(basic sdk sqlplus tools odbc) + +# platform -> " " +declare -A platforms=( + [x86_64-linux]="linux-x86-64-downloads linux.x64 zip" + [aarch64-linux]="linux-arm-aarch64-downloads linux.arm64 zip" + [aarch64-darwin]="macos-arm64-downloads macos.arm64 dmg" +) + +result="{}" + +for platform in $(printf '%s\n' "${!platforms[@]}" | sort); do + read -r page arch suffix <<<"${platforms[$platform]}" + + html="$(curl -fsSL -A Mozilla/5.0 "https://www.oracle.com/database/technologies/instant-client/${page}.html")" + + # Pick the newest plain release, skipping the dbru/el9 variants of older series. + # Sort on the version alone, as the directory names vary in length. + url="$( + { grep -oE "https://download\.oracle\.com/otn_software/[a-z]+/instantclient/[0-9]+/instantclient-basic-${arch//./\\.}-[0-9.]+\.${suffix}" <<<"$html" || true; } \ + | sed -E "s|^.*-([0-9.]+)\.${suffix}\$|\1 &|" \ + | sort -uV -k1,1 | tail -1 | cut -d' ' -f2 + )" + + if [[ -z "$url" ]]; then + echo "No release found for $platform" >&2 + exit 1 + fi + + directory="$(basename "$(dirname "$url")")" + version="$(basename "$url" ".${suffix}")" + version="${version#"instantclient-basic-${arch}-"}" + + echo "Updating $platform to $version" + + hashes="{}" + for component in "${components[@]}"; do + componentUrl="$(dirname "$url")/instantclient-${component}-${arch}-${version}.${suffix}" + hash="$(nix-prefetch-url --type sha256 "$componentUrl")" + hash="$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$hash")" + hashes="$(jq --arg c "$component" --arg h "$hash" '. + {($c): $h}' <<<"$hashes")" + done + + result="$( + jq \ + --arg p "$platform" \ + --arg v "$version" \ + --arg d "$directory" \ + --argjson h "$hashes" \ + '. + {($p): {version: $v, directory: $d, hashes: $h}}' <<<"$result" + )" +done + +echo "$result" >"$sources" From 7f2df57b6e3fd7d6ef8cb0594a2682f928f2be22 Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Thu, 15 Oct 2026 08:23:55 +0000 Subject: [PATCH 3/3] oracle-instantclient: install sqlldr and wrc Signed-off-by: Nikolaos Karaolidis --- pkgs/by-name/or/oracle-instantclient/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/or/oracle-instantclient/package.nix b/pkgs/by-name/or/oracle-instantclient/package.nix index 15500b514e62..aee5daa0bf79 100644 --- a/pkgs/by-name/or/oracle-instantclient/package.nix +++ b/pkgs/by-name/or/oracle-instantclient/package.nix @@ -104,7 +104,7 @@ stdenv.mkDerivation { installPhase = '' mkdir -p "$out/"{bin,include,lib,"share/java","share/${pname}-${version}/demo/"} $lib/lib - install -Dm755 {adrci,genezi,uidrvci,sqlplus,exp,expdp,imp,impdp} $out/bin + install -Dm755 {adrci,genezi,uidrvci,sqlplus,exp,expdp,imp,impdp,sqlldr,wrc} $out/bin # cp to preserve symlinks cp -P *${extLib}* $lib/lib