2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-11-24 20:58:05 +00:00
|
|
|
, cmake
|
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapQtAppsHook
|
|
|
|
, qtmultimedia
|
|
|
|
, qttools
|
|
|
|
, qtscript
|
|
|
|
, qtdeclarative
|
2021-12-06 16:07:01 +00:00
|
|
|
, qtnetworkauth
|
2020-11-24 20:58:05 +00:00
|
|
|
, qtbase
|
|
|
|
, autogen
|
|
|
|
, automake
|
|
|
|
, makeWrapper
|
|
|
|
, catch2
|
|
|
|
, nodejs
|
|
|
|
, libpulseaudio
|
|
|
|
, openssl
|
|
|
|
, rsync
|
|
|
|
, typescript
|
|
|
|
}:
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2020-11-24 20:58:05 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-12-03 08:41:04 +00:00
|
|
|
pname = "imgbrd-grabber";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "7.5.1";
|
2020-11-24 20:58:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Bionus";
|
|
|
|
repo = "imgbrd-grabber";
|
|
|
|
rev = "v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-40JCdtRhAQpz2lBGmYh2MgA9rRzHmOZx7lWW0IbfjP4=";
|
2020-11-24 20:58:05 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
makeWrapper
|
|
|
|
libpulseaudio
|
|
|
|
typescript
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
qtmultimedia
|
|
|
|
qtbase
|
|
|
|
qtdeclarative
|
|
|
|
qttools
|
2021-12-06 16:07:01 +00:00
|
|
|
qtnetworkauth
|
2020-11-24 20:58:05 +00:00
|
|
|
nodejs
|
|
|
|
cmake
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
|
|
|
|
# remove the vendored catch2
|
|
|
|
rm -rf tests/src/vendor/catch
|
|
|
|
|
|
|
|
# link the catch2 sources from nixpkgs
|
|
|
|
ln -sf ${catch2.src} tests/src/vendor/catch
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
sed "s|strict\": true|strict\": false|g" -i ./sites/tsconfig.json
|
2020-11-24 20:58:05 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# move the binaries to the share/Grabber folder so
|
|
|
|
# some relative links can be resolved (e.g. settings.ini)
|
|
|
|
mv $out/bin/* $out/share/Grabber/
|
|
|
|
|
|
|
|
cd ../..
|
|
|
|
# run the package.sh with $out/share/Grabber as the $APP_DIR
|
|
|
|
sh ./scripts/package.sh $out/share/Grabber
|
|
|
|
|
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
|
|
|
sourceRoot = "source/src";
|
2020-12-03 08:41:04 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-12-03 08:41:04 +00:00
|
|
|
description = "Very customizable imageboard/booru downloader with powerful filenaming features";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://bionus.github.io/imgbrd-grabber/";
|
|
|
|
maintainers = [ maintainers.evanjs ];
|
|
|
|
};
|
2020-11-24 20:58:05 +00:00
|
|
|
}
|