diff options
author | Philippe Hürlimann <p@hurlimann.org> | 2021-04-08 01:36:00 +0200 |
---|---|---|
committer | Philippe Hürlimann <p@hurlimann.org> | 2021-04-08 12:37:46 +0200 |
commit | 73d596e3f7cdecec5fb5ec58e535bca3219fd87a (patch) | |
tree | d66de0ad84532377f9cfe8bb55758ecc0183b5f2 /pkgs/applications/misc/foxitreader | |
parent | c131e6286afa0b2217cf3bba4cd2ecdbca7bc98c (diff) |
foxitreader: init at 2.4.4.0911
Diffstat (limited to 'pkgs/applications/misc/foxitreader')
-rw-r--r-- | pkgs/applications/misc/foxitreader/default.nix | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/pkgs/applications/misc/foxitreader/default.nix b/pkgs/applications/misc/foxitreader/default.nix new file mode 100644 index 0000000000000..e69361dbd93e4 --- /dev/null +++ b/pkgs/applications/misc/foxitreader/default.nix @@ -0,0 +1,79 @@ +{ mkDerivation, lib, fetchzip, libarchive, autoPatchelfHook, libsecret, libGL, zlib, openssl, qtbase, qtwebkit, qtxmlpatterns }: + +mkDerivation rec { + pname = "foxitreader"; + version = "2.4.4.0911"; + + src = fetchzip { + url = "https://cdn01.foxitsoftware.com/pub/foxit/reader/desktop/linux/${lib.versions.major version}.x/${lib.versions.majorMinor version}/en_us/FoxitReader.enu.setup.${version}.x64.run.tar.gz"; + sha256 = "0ff4xs9ipc7sswq0czfhpsd7qw7niw0zsf9wgsqhbbgzcpbdhcb7"; + stripRoot = false; + }; + + buildInputs = [ libGL libsecret openssl qtbase qtwebkit qtxmlpatterns zlib ]; + + nativeBuildInputs = [ autoPatchelfHook libarchive ]; + + buildPhase = '' + runHook preBuild + + input_file=$src/*.run + mkdir -p extracted + # Look for all 7z files and extract them + grep --only-matching --byte-offset --binary \ + --text -P '7z\xBC\xAF\x27\x1C\x00\x03' $input_file | cut -d: -f1 | + while read position; do + tail -c +$(($position + 1)) $input_file > file.7z + bsdtar xf file.7z -C extracted + done + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/lib + cd extracted + + cp -r \ + CollectStrategy.txt \ + cpdf_settings \ + fxplugins \ + lang \ + resource \ + run \ + stamps \ + welcome \ + Wrappers \ + $out/lib/ + + patchelf $out/lib/fxplugins/librms.so \ + --replace-needed libssl.so.10 libssl.so \ + --replace-needed libcrypto.so.10 libcrypto.so + + # FIXME: Doing this with one invocation is broken right now + patchelf $out/lib/fxplugins/librmscrypto.so \ + --replace-needed libssl.so.10 libssl.so + patchelf $out/lib/fxplugins/librmscrypto.so \ + --replace-needed libcrypto.so.10 libcrypto.so + + install -D -m 755 FoxitReader -t $out/bin + + # Install icon and desktop files + install -D -m 644 images/FoxitReader.png -t $out/share/pixmaps/ + install -D -m 644 FoxitReader.desktop -t $out/share/applications/ + echo Exec=FoxitReader %F >> $out/share/applications/FoxitReader.desktop + + runHook postInstall + ''; + + qtWrapperArgs = [ "--set appname FoxitReader" "--set selfpath $out/lib" ]; + + meta = with lib; { + description = "A viewer for PDF documents"; + homepage = "https://www.foxitsoftware.com/"; + license = licenses.unfree; + maintainers = with maintainers; [ p-h rhoriguchi ]; + }; +} |