nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 70 lines 2.0 kB view raw
1{ 2 fetchFromGitHub, 3 lib, 4 postgresql, 5 postgresqlBuildExtension, 6}: 7 8let 9 sources = { 10 "18" = { 11 version = "1.8.0"; 12 hash = "sha256-QsDppGN5TE7CSii3mNmwqT/riNNjyRTJk6d6Xcf0JMw="; 13 }; 14 "17" = { 15 version = "1.7.1"; 16 hash = "sha256-9GKqyrNpi80I4WWIiRN8zeXBm5bkRuzOWrZVfpYOzag="; 17 }; 18 "16" = { 19 version = "1.6.2"; 20 hash = "sha256-WMmtnuGOvLwtiEmgHpYURC1k5NmkBiDg+PnQCIZp7Sk="; 21 }; 22 "15" = { 23 version = "1.5.3"; 24 hash = "sha256-jkU0zt1waPTdFrBLAxYNvlo+RwdhCtKQq7iqAuxthNA="; 25 }; 26 "14" = { 27 version = "1.4.4"; 28 hash = "sha256-8rJ4Ck0Axf9zKhOXaJ4EA/M783YZRLuWx+GMGccadVo="; 29 }; 30 "13" = { 31 version = "1.3.11"; 32 hash = "sha256-XTxCw1Uj6rVLcXJuHoT3RkEhdKVLGjOdR7rhFI8YJas="; 33 }; 34 }; 35 36 source = 37 sources.${lib.versions.major postgresql.version} or { 38 version = ""; 39 hash = throw "Source for pg_hint_plan is not available for ${postgresql.version}"; 40 }; 41in 42postgresqlBuildExtension { 43 pname = "pg_hint_plan"; 44 inherit (source) version; 45 46 src = fetchFromGitHub { 47 owner = "ossc-db"; 48 repo = "pg_hint_plan"; 49 tag = "REL${lib.versions.major postgresql.version}_${ 50 builtins.replaceStrings [ "." ] [ "_" ] source.version 51 }"; 52 inherit (source) hash; 53 }; 54 55 postPatch = lib.optionalString (lib.versionOlder postgresql.version "14") '' 56 # https://github.com/ossc-db/pg_hint_plan/commit/e9e564ad59b8bd4a03e0f13b95b5122712e573e6 57 substituteInPlace Makefile --replace "LDFLAGS+=-Wl,--build-id" "" 58 ''; 59 60 enableUpdateScript = false; 61 62 meta = { 63 broken = !builtins.elem (lib.versions.major postgresql.version) (builtins.attrNames sources); 64 description = "Extension to tweak PostgreSQL execution plans using so-called 'hints' in SQL comments"; 65 homepage = "https://github.com/ossc-db/pg_hint_plan"; 66 maintainers = with lib.maintainers; [ _1000101 ]; 67 platforms = postgresql.meta.platforms; 68 license = lib.licenses.bsd3; 69 }; 70}