2023-08-22 20:05:09 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, sqlite
|
|
|
|
, zstd
|
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
, fetchurl
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
apexcharts = fetchurl {
|
2024-09-19 14:19:46 +00:00
|
|
|
url = "https://cdn.jsdelivr.net/npm/apexcharts@3.52.0/dist/apexcharts.min.js";
|
|
|
|
hash = "sha256-2sxp9+shRA5LMxzhgx+fpeQPIY2ZWgBdt4mp5V2Yn+E=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
tablerCss = fetchurl {
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/css/tabler.min.css";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-lS3nKxMMZiKIRJG7UgUonOHYuvHgW5eckEjvHMYxb9Q=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
tablerVendorsCss = fetchurl {
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/css/tabler-vendors.min.css";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-Aa7AUOaz6hJLiUzQStZTy2VPOZyg0ViSo2MCzpDU1tY=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
tablerJs = fetchurl {
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/js/tabler.min.js";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-ygO5OTRUtYxDDkERRwBCfq+fmakhM6ybwfl6gCCPlAQ=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
listJsFixed = fetchurl {
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://cdn.jsdelivr.net/npm/list.js-fixed@2.3.4/dist/list.min.js";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-sYy7qNJW7RTuaNA0jq6Yrtfs57ypYrItZ3f8T7kqfPM=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
tablerIcons = fetchurl {
|
2024-09-19 14:19:46 +00:00
|
|
|
url = "https://cdn.jsdelivr.net/npm/@tabler/icons-sprite@3.10.0/dist/tabler-sprite.svg";
|
|
|
|
hash = "sha256-lEUAtxI+NffqLDllirLgcCRjEgbeCaz9Gkn3Tu9e9F4=";
|
2024-06-20 14:57:18 +00:00
|
|
|
};
|
|
|
|
tomselect = fetchurl {
|
|
|
|
url = "https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/js/tom-select.popular.min.js";
|
|
|
|
hash = "sha256-51NcdIM8GseVFFmg8mUWDxfhjLCA+n8kw/Ojyo+6Hjk=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "sqlpage";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.28.0";
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lovasoa";
|
|
|
|
repo = "SQLpage";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-veqkHjIbR4qENarmXHakDDG4Rxq9mUD/io+dfwaWAqg=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace sqlpage/apexcharts.js \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail '/* !include https://cdn.jsdelivr.net/npm/apexcharts@3.52.0/dist/apexcharts.min.js */' \
|
2023-08-22 20:05:09 +00:00
|
|
|
"$(cat ${apexcharts})"
|
|
|
|
substituteInPlace sqlpage/sqlpage.css \
|
2024-06-20 14:57:18 +00:00
|
|
|
--replace-fail '/* !include https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/css/tabler.min.css */' \
|
2023-08-22 20:05:09 +00:00
|
|
|
"$(cat ${tablerCss})"
|
|
|
|
substituteInPlace sqlpage/sqlpage.css \
|
2024-06-20 14:57:18 +00:00
|
|
|
--replace-fail '/* !include https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/css/tabler-vendors.min.css */' \
|
2023-08-22 20:05:09 +00:00
|
|
|
"$(cat ${tablerVendorsCss})"
|
|
|
|
substituteInPlace sqlpage/sqlpage.js \
|
2024-06-20 14:57:18 +00:00
|
|
|
--replace-fail '/* !include https://cdn.jsdelivr.net/npm/@tabler/core@1.0.0-beta20/dist/js/tabler.min.js */' \
|
2023-08-22 20:05:09 +00:00
|
|
|
"$(cat ${tablerJs})"
|
|
|
|
substituteInPlace sqlpage/sqlpage.js \
|
2024-06-20 14:57:18 +00:00
|
|
|
--replace-fail '/* !include https://cdn.jsdelivr.net/npm/list.js-fixed@2.3.4/dist/list.min.js */' \
|
2023-08-22 20:05:09 +00:00
|
|
|
"$(cat ${listJsFixed})"
|
|
|
|
substituteInPlace sqlpage/tabler-icons.svg \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail '/* !include https://cdn.jsdelivr.net/npm/@tabler/icons-sprite@3.10.0/dist/tabler-sprite.svg */' \
|
2023-08-22 20:05:09 +00:00
|
|
|
"$(cat ${tablerIcons})"
|
2024-06-20 14:57:18 +00:00
|
|
|
substituteInPlace sqlpage/tomselect.js \
|
|
|
|
--replace-fail '/* !include https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/js/tom-select.popular.min.js */' \
|
|
|
|
"$(cat ${tomselect})"
|
|
|
|
'';
|
2023-08-22 20:05:09 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
cargoHash = "sha256-idX3uU1nSI2a93srlJ1HvKcwVD0C4FmkQKTEYod5qgg=";
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
sqlite
|
|
|
|
zstd
|
|
|
|
]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2023-08-22 20:05:09 +00:00
|
|
|
darwin.apple_sdk.frameworks.CoreFoundation
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
|
|
|
];
|
|
|
|
|
|
|
|
env = {
|
|
|
|
ZSTD_SYS_USE_PKG_CONFIG = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "SQL-only webapp builder, empowering data analysts to build websites and applications quickly";
|
|
|
|
homepage = "https://github.com/lovasoa/SQLpage";
|
|
|
|
changelog = "https://github.com/lovasoa/SQLpage/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ dit7ya ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "sqlpage";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
}
|