2023-07-15 17:15:38 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fpc, openssl }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
let
|
|
|
|
flreSrc = fetchFromGitHub {
|
|
|
|
owner = "benibela";
|
|
|
|
repo = "flre";
|
2023-02-16 17:41:37 +00:00
|
|
|
rev = "3e926d45d4352f1b7c7cd411ccd625df117dad5c";
|
|
|
|
hash = "sha256-fs7CIjd3fwD/SORYh5pmJxIdrr8F9e36TNmnKUbUxP0=";
|
2021-08-18 13:19:15 +00:00
|
|
|
};
|
2023-02-16 17:41:37 +00:00
|
|
|
synapseSrc = fetchFromGitHub {
|
|
|
|
owner = "benibela";
|
|
|
|
repo = "ararat-synapse";
|
|
|
|
rev = "7a77db926de66809080bada68b54172da7f84c0e";
|
|
|
|
hash = "sha256-bVLQ0ohGJYtuP88Krxy9a7RnHHrW0OWw8H/uxa3PerU=";
|
2021-08-18 13:19:15 +00:00
|
|
|
};
|
|
|
|
rcmdlineSrc = fetchFromGitHub {
|
|
|
|
owner = "benibela";
|
|
|
|
repo = "rcmdline";
|
2023-02-16 17:41:37 +00:00
|
|
|
rev = "ea02b770c4568717dd7b3b72da191a8bbcb4c751";
|
|
|
|
hash = "sha256-6YtvAf0joRvtCKbUAaLwuwABw1GEIzammFLhboq9aG0=";
|
2021-08-18 13:19:15 +00:00
|
|
|
};
|
|
|
|
internettoolsSrc = fetchFromGitHub {
|
|
|
|
owner = "benibela";
|
|
|
|
repo = "internettools";
|
2023-02-16 17:41:37 +00:00
|
|
|
rev = "dd972caaa4415468fa679ea7262976ead3fd3e38";
|
|
|
|
hash = "sha256-09sADxPiE6ky1EX7dTXRBYVT3IarUcLYf5knzi7+CHU=";
|
|
|
|
};
|
|
|
|
pasdblstrutilsSrc = fetchFromGitHub {
|
|
|
|
owner = "BeRo1985";
|
|
|
|
repo = "pasdblstrutils";
|
|
|
|
rev = "1696f0a2b822fef26c8992f96620f1be129cfa99";
|
|
|
|
hash = "sha256-x0AjOTa1g7gJOR2iBO76yBt1kzcRNujHRUsq5QOlfP0=";
|
2021-08-18 13:19:15 +00:00
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "xidel";
|
2023-02-16 17:41:37 +00:00
|
|
|
version = "unstable-2022-11-01";
|
2021-08-18 13:19:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "benibela";
|
|
|
|
repo = pname;
|
2023-02-16 17:41:37 +00:00
|
|
|
rev = "6d5655c1d73b88ddeb32d2450a35ee36e4762bb8";
|
|
|
|
hash = "sha256-9x2d5AKRBjocRawRHdeI4heIM5nb00/F/EIj+/to7ac=";
|
2021-08-18 13:19:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ fpc ];
|
2022-07-14 12:49:19 +00:00
|
|
|
buildInputs = [ openssl ];
|
|
|
|
|
|
|
|
NIX_LDFLAGS = [ "-lcrypto" ];
|
2021-08-18 13:19:15 +00:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
patchShebangs \
|
|
|
|
build.sh \
|
|
|
|
tests/test.sh \
|
|
|
|
tests/tests-file-module.sh \
|
|
|
|
tests/tests.sh \
|
|
|
|
tests/downloadTest.sh \
|
|
|
|
tests/downloadTests.sh \
|
|
|
|
tests/zorbajsoniq.sh \
|
|
|
|
tests/zorbajsoniq/download.sh
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
preBuildPhase = ''
|
2023-02-16 17:41:37 +00:00
|
|
|
mkdir -p import/{flre,synapse,pasdblstrutils} rcmdline internettools
|
2021-08-18 13:19:15 +00:00
|
|
|
cp -R ${flreSrc}/. import/flre
|
|
|
|
cp -R ${synapseSrc}/. import/synapse
|
2023-02-16 17:41:37 +00:00
|
|
|
cp -R ${pasdblstrutilsSrc}/. import/pasdblstrutils
|
2021-08-18 13:19:15 +00:00
|
|
|
cp -R ${rcmdlineSrc}/. rcmdline
|
|
|
|
cp -R ${internettoolsSrc}/. internettools
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuildPhase
|
|
|
|
./build.sh
|
|
|
|
runHook postBuildPhase
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-08-18 13:19:15 +00:00
|
|
|
mkdir -p "$out/bin" "$out/share/man/man1"
|
|
|
|
cp meta/xidel.1 "$out/share/man/man1/"
|
|
|
|
cp xidel "$out/bin/"
|
|
|
|
'';
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
# disabled, because tests require network
|
2021-08-18 13:19:15 +00:00
|
|
|
checkPhase = ''
|
|
|
|
./tests/tests.sh
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-08-18 13:19:15 +00:00
|
|
|
description = "Command line tool to download and extract data from HTML/XML pages as well as JSON APIs";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "xidel";
|
2021-08-18 13:19:15 +00:00
|
|
|
homepage = "https://www.videlibri.de/xidel.html";
|
|
|
|
license = licenses.gpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|