Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 107 lines 3.8 kB view raw
1{ lib 2, rustPlatform 3, fetchFromGitHub 4, pkg-config 5, sqlite 6, zstd 7, stdenv 8, darwin 9, fetchurl 10}: 11 12let 13 apexcharts = fetchurl { 14 url = "https://cdn.jsdelivr.net/npm/apexcharts@3.49.1/dist/apexcharts.min.js"; 15 hash = "sha256-74AuGLJETu9PiPQ69d/gxD3Wy3j10udgC7FQYPQjhyU="; 16 }; 17 tablerCss = fetchurl { 18 url = "https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/css/tabler.min.css"; 19 hash = "sha256-lS3nKxMMZiKIRJG7UgUonOHYuvHgW5eckEjvHMYxb9Q="; 20 }; 21 tablerVendorsCss = fetchurl { 22 url = "https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/css/tabler-vendors.min.css"; 23 hash = "sha256-Aa7AUOaz6hJLiUzQStZTy2VPOZyg0ViSo2MCzpDU1tY="; 24 }; 25 tablerJs = fetchurl { 26 url = "https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/js/tabler.min.js"; 27 hash = "sha256-ygO5OTRUtYxDDkERRwBCfq+fmakhM6ybwfl6gCCPlAQ="; 28 }; 29 listJsFixed = fetchurl { 30 url = "https://cdn.jsdelivr.net/npm/list.js-fixed@2.3.4/dist/list.min.js"; 31 hash = "sha256-sYy7qNJW7RTuaNA0jq6Yrtfs57ypYrItZ3f8T7kqfPM="; 32 }; 33 tablerIcons = fetchurl { 34 url = "https://cdn.jsdelivr.net/npm/@tabler/icons-sprite@3.4.0/dist/tabler-sprite.svg"; 35 hash = "sha256-iYxplXfIhVNBOmEEURN7/53A8Mi0hWCbWWo92BzncUA="; 36 }; 37 tomselect = fetchurl { 38 url = "https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/js/tom-select.popular.min.js"; 39 hash = "sha256-51NcdIM8GseVFFmg8mUWDxfhjLCA+n8kw/Ojyo+6Hjk="; 40 }; 41in 42 43rustPlatform.buildRustPackage rec { 44 pname = "sqlpage"; 45 version = "0.24.0"; 46 47 src = fetchFromGitHub { 48 owner = "lovasoa"; 49 repo = "SQLpage"; 50 rev = "v${version}"; 51 hash = "sha256-1VP5yjyQNBvaAIRhrv1fntZFqSUIAZm5X0J8xQ2HJuM="; 52 }; 53 54 postPatch = '' 55 substituteInPlace sqlpage/apexcharts.js \ 56 --replace-fail '/* !include https://cdn.jsdelivr.net/npm/apexcharts@3.49.1/dist/apexcharts.min.js */' \ 57 "$(cat ${apexcharts})" 58 substituteInPlace sqlpage/sqlpage.css \ 59 --replace-fail '/* !include https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/css/tabler.min.css */' \ 60 "$(cat ${tablerCss})" 61 substituteInPlace sqlpage/sqlpage.css \ 62 --replace-fail '/* !include https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/css/tabler-vendors.min.css */' \ 63 "$(cat ${tablerVendorsCss})" 64 substituteInPlace sqlpage/sqlpage.js \ 65 --replace-fail '/* !include https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/js/tabler.min.js */' \ 66 "$(cat ${tablerJs})" 67 substituteInPlace sqlpage/sqlpage.js \ 68 --replace-fail '/* !include https://cdn.jsdelivr.net/npm/list.js-fixed@2.3.4/dist/list.min.js */' \ 69 "$(cat ${listJsFixed})" 70 substituteInPlace sqlpage/tabler-icons.svg \ 71 --replace-fail '/* !include https://cdn.jsdelivr.net/npm/@tabler/icons-sprite@3.4.0/dist/tabler-sprite.svg */' \ 72 "$(cat ${tablerIcons})" 73 substituteInPlace sqlpage/tomselect.js \ 74 --replace-fail '/* !include https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/js/tom-select.popular.min.js */' \ 75 "$(cat ${tomselect})" 76 ''; 77 78 cargoHash = "sha256-lfiRnaTF1aLs2QU+gv7J48rZSHJdtt8U81odQ1o74R4="; 79 80 nativeBuildInputs = [ 81 pkg-config 82 ]; 83 84 buildInputs = 85 [ 86 sqlite 87 zstd 88 ] 89 ++ lib.optionals stdenv.isDarwin [ 90 darwin.apple_sdk.frameworks.CoreFoundation 91 darwin.apple_sdk.frameworks.Security 92 darwin.apple_sdk.frameworks.SystemConfiguration 93 ]; 94 95 env = { 96 ZSTD_SYS_USE_PKG_CONFIG = true; 97 }; 98 99 meta = { 100 description = "SQL-only webapp builder, empowering data analysts to build websites and applications quickly"; 101 homepage = "https://github.com/lovasoa/SQLpage"; 102 changelog = "https://github.com/lovasoa/SQLpage/blob/${src.rev}/CHANGELOG.md"; 103 license = lib.licenses.mit; 104 maintainers = with lib.maintainers; [ dit7ya ]; 105 mainProgram = "sqlpage"; 106 }; 107}