2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-10-19 03:06:49 +00:00
|
|
|
, cmake
|
2020-10-20 00:29:30 +00:00
|
|
|
, fetchFromGitHub
|
2020-10-19 03:06:49 +00:00
|
|
|
, wrapQtAppsHook
|
2020-10-20 00:29:30 +00:00
|
|
|
, qtmultimedia
|
|
|
|
, qttools
|
|
|
|
, qtdeclarative
|
2021-11-05 03:47:31 +00:00
|
|
|
, qtnetworkauth
|
2020-10-20 00:29:30 +00:00
|
|
|
, qtbase
|
|
|
|
, makeWrapper
|
|
|
|
, catch2
|
|
|
|
, nodejs
|
|
|
|
, libpulseaudio
|
|
|
|
, openssl
|
|
|
|
, rsync
|
|
|
|
, typescript
|
2020-10-19 03:06:49 +00:00
|
|
|
}:
|
2021-11-05 03:47:31 +00:00
|
|
|
|
2020-10-19 03:06:49 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-12-01 20:21:21 +00:00
|
|
|
pname = "imgbrd-grabber";
|
2022-12-16 22:58:49 +00:00
|
|
|
version = "7.10.0";
|
2020-10-20 00:29:30 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Bionus";
|
|
|
|
repo = "imgbrd-grabber";
|
|
|
|
rev = "v${version}";
|
2022-12-16 22:58:49 +00:00
|
|
|
sha256 = "sha256-AT6pN2do0LlH6xAXKcFQv+oderD88/EiG1JnCw6kOOg=";
|
2020-10-20 00:29:30 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2020-10-19 03:06:49 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
2020-10-20 00:29:30 +00:00
|
|
|
libpulseaudio
|
|
|
|
typescript
|
2020-10-19 03:06:49 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2022-04-05 07:34:48 +00:00
|
|
|
makeWrapper
|
2020-10-20 00:29:30 +00:00
|
|
|
qtmultimedia
|
|
|
|
qtbase
|
|
|
|
qtdeclarative
|
|
|
|
qttools
|
2021-11-05 03:47:31 +00:00
|
|
|
qtnetworkauth
|
2020-10-20 00:29:30 +00:00
|
|
|
nodejs
|
|
|
|
cmake
|
2020-10-19 03:06:49 +00:00
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
2020-10-20 00:29:30 +00:00
|
|
|
extraOutputsToLink = [ "doc" ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# the package.sh script provides some install helpers
|
|
|
|
# using this might make it easier to maintain/less likely for the
|
|
|
|
# install phase to fail across version bumps
|
|
|
|
patchShebangs ./scripts/package.sh
|
|
|
|
|
|
|
|
# ensure the script uses the rsync package from nixpkgs
|
|
|
|
substituteInPlace ../scripts/package.sh --replace "rsync" "${rsync}/bin/rsync"
|
|
|
|
|
2020-10-19 03:06:49 +00:00
|
|
|
|
2020-10-20 00:29:30 +00:00
|
|
|
# the npm build step only runs typescript
|
|
|
|
# run this step directly so it doesn't try and fail to download the unnecessary node_modules, etc.
|
|
|
|
substituteInPlace ./sites/CMakeLists.txt --replace "npm install" "npm run build"
|
2020-10-19 03:06:49 +00:00
|
|
|
|
2020-10-20 00:29:30 +00:00
|
|
|
# remove the vendored catch2
|
|
|
|
rm -rf tests/src/vendor/catch
|
2020-10-19 03:06:49 +00:00
|
|
|
|
2020-10-20 00:29:30 +00:00
|
|
|
# link the catch2 sources from nixpkgs
|
|
|
|
ln -sf ${catch2.src} tests/src/vendor/catch
|
2022-12-16 22:58:49 +00:00
|
|
|
'';
|
2021-11-05 03:47:31 +00:00
|
|
|
|
2022-12-16 22:58:49 +00:00
|
|
|
preBuild = ''
|
|
|
|
export HOME=$TMPDIR
|
2020-10-19 03:06:49 +00:00
|
|
|
'';
|
|
|
|
|
2020-10-20 00:29:30 +00:00
|
|
|
postInstall = ''
|
2020-10-20 00:52:25 +00:00
|
|
|
# move the binaries to the share/Grabber folder so
|
2020-10-20 00:29:30 +00:00
|
|
|
# some relative links can be resolved (e.g. settings.ini)
|
|
|
|
mv $out/bin/* $out/share/Grabber/
|
2020-10-20 00:52:25 +00:00
|
|
|
|
2020-10-20 00:29:30 +00:00
|
|
|
cd ../..
|
2020-10-20 02:42:34 +00:00
|
|
|
# run the package.sh with $out/share/Grabber as the $APP_DIR
|
2020-10-20 00:29:30 +00:00
|
|
|
sh ./scripts/package.sh $out/share/Grabber
|
2020-10-19 03:06:49 +00:00
|
|
|
|
2020-10-20 00:29:30 +00:00
|
|
|
# add symlinks for the binaries to $out/bin
|
|
|
|
ln -s $out/share/Grabber/Grabber $out/bin/Grabber
|
|
|
|
ln -s $out/share/Grabber/Grabber-cli $out/bin/Grabber-cli
|
|
|
|
'';
|
|
|
|
|
2023-07-25 13:27:31 +00:00
|
|
|
sourceRoot = "${src.name}/src";
|
2020-12-01 20:21:21 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-12-02 01:03:10 +00:00
|
|
|
description = "Very customizable imageboard/booru downloader with powerful filenaming features";
|
2020-12-01 20:21:21 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://bionus.github.io/imgbrd-grabber/";
|
|
|
|
maintainers = [ maintainers.evanjs ];
|
|
|
|
};
|
2020-10-19 03:06:49 +00:00
|
|
|
}
|