20 stdenv.mkDerivation rec {
21 pname = "imgbrd-grabber";
24 src = fetchFromGitHub {
26 repo = "imgbrd-grabber";
28 sha256 = "sha256-AT6pN2do0LlH6xAXKcFQv+oderD88/EiG1JnCw6kOOg=";
29 fetchSubmodules = true;
50 extraOutputsToLink = [ "doc" ];
53 # the package.sh script provides some install helpers
54 # using this might make it easier to maintain/less likely for the
55 # install phase to fail across version bumps
56 patchShebangs ./scripts/package.sh
58 # ensure the script uses the rsync package from nixpkgs
59 substituteInPlace ../scripts/package.sh --replace "rsync" "${rsync}/bin/rsync"
62 # the npm build step only runs typescript
63 # run this step directly so it doesn't try and fail to download the unnecessary node_modules, etc.
64 substituteInPlace ./sites/CMakeLists.txt --replace "npm install" "npm run build"
66 # remove the vendored catch2
67 rm -rf tests/src/vendor/catch
69 # link the catch2 sources from nixpkgs
70 ln -sf ${catch2.src} tests/src/vendor/catch
78 # move the binaries to the share/Grabber folder so
79 # some relative links can be resolved (e.g. settings.ini)
80 mv $out/bin/* $out/share/Grabber/
83 # run the package.sh with $out/share/Grabber as the $APP_DIR
84 sh ./scripts/package.sh $out/share/Grabber
86 # add symlinks for the binaries to $out/bin
87 ln -s $out/share/Grabber/Grabber $out/bin/Grabber
88 ln -s $out/share/Grabber/Grabber-cli $out/bin/Grabber-cli
91 sourceRoot = "${src.name}/src";
94 description = "Very customizable imageboard/booru downloader with powerful filenaming features";
95 license = licenses.asl20;
96 homepage = "https://bionus.github.io/imgbrd-grabber/";
97 mainProgram = "Grabber";
98 maintainers = [ maintainers.evanjs ];