uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
15
pkgs/applications/misc/xpdf/cmake_version.patch
Normal file
15
pkgs/applications/misc/xpdf/cmake_version.patch
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
Fix "No known features for CXX compiler", see
|
||||
https://cmake.org/pipermail/cmake/2016-December/064733.html and the note at
|
||||
https://cmake.org/cmake/help/v3.10/command/cmake_minimum_required.html
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -8,7 +8,7 @@
|
||||
#
|
||||
#========================================================================
|
||||
|
||||
-cmake_minimum_required(VERSION 2.8.8)
|
||||
+cmake_minimum_required(VERSION 3.1.0)
|
||||
|
||||
project(xpdf)
|
||||
|
||||
80
pkgs/applications/misc/xpdf/default.nix
Normal file
80
pkgs/applications/misc/xpdf/default.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
{ enableGUI ? true
|
||||
, enablePDFtoPPM ? true
|
||||
, enablePrinting ? true
|
||||
, lib, stdenv, fetchzip, cmake, makeDesktopItem
|
||||
, zlib, libpng, cups ? null, freetype ? null
|
||||
, qtbase ? null, qtsvg ? null, wrapQtAppsHook
|
||||
}:
|
||||
|
||||
assert enableGUI -> qtbase != null && qtsvg != null && freetype != null;
|
||||
assert enablePDFtoPPM -> freetype != null;
|
||||
assert enablePrinting -> cups != null;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "xpdf";
|
||||
version = "4.04";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://dl.xpdfreader.com/xpdf-${version}.tar.gz";
|
||||
hash = "sha256-ujH9KDwFRjPIKwdMg79Mab9BfA2HooY5+2PESUgnGDY=";
|
||||
};
|
||||
|
||||
# Fix "No known features for CXX compiler", see
|
||||
# https://cmake.org/pipermail/cmake/2016-December/064733.html and the note at
|
||||
# https://cmake.org/cmake/help/v3.10/command/cmake_minimum_required.html
|
||||
patches = lib.optional stdenv.isDarwin ./cmake_version.patch;
|
||||
|
||||
nativeBuildInputs =
|
||||
[ cmake ]
|
||||
++ lib.optional enableGUI wrapQtAppsHook;
|
||||
|
||||
cmakeFlags = ["-DSYSTEM_XPDFRC=/etc/xpdfrc" "-DA4_PAPER=ON" "-DOPI_SUPPORT=ON"]
|
||||
++ lib.optional (!enablePrinting) "-DXPDFWIDGET_PRINTING=OFF";
|
||||
|
||||
buildInputs = [ zlib libpng ] ++
|
||||
lib.optional enableGUI qtbase ++
|
||||
lib.optional enablePrinting cups ++
|
||||
lib.optional enablePDFtoPPM freetype;
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = "xpdf";
|
||||
desktopName = "Xpdf";
|
||||
comment = "Views Adobe PDF files";
|
||||
icon = "xpdf";
|
||||
exec = "xpdf %f";
|
||||
categories = [ "Office" ];
|
||||
};
|
||||
|
||||
postInstall = lib.optionalString (!stdenv.isDarwin) ''
|
||||
install -Dm644 ${desktopItem}/share/applications/xpdf.desktop -t $out/share/applications
|
||||
install -Dm644 $src/xpdf-qt/xpdf-icon.svg $out/share/pixmaps/xpdf.svg
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.xpdfreader.com";
|
||||
description = "Viewer for Portable Document Format (PDF) files";
|
||||
longDescription = ''
|
||||
XPDF includes multiple tools for viewing and processing PDF files.
|
||||
xpdf: PDF viewer (with Graphical Interface)
|
||||
pdftotext: converts PDF to text
|
||||
pdftops: converts PDF to PostScript
|
||||
pdftoppm: converts PDF pages to netpbm (PPM/PGM/PBM) image files
|
||||
pdftopng: converts PDF pages to PNG image files
|
||||
pdftohtml: converts PDF to HTML
|
||||
pdfinfo: extracts PDF metadata
|
||||
pdfimages: extracts raw images from PDF files
|
||||
pdffonts: lists fonts used in PDF files
|
||||
pdfdetach: extracts attached files from PDF files
|
||||
'';
|
||||
license = with licenses; [ gpl2Only gpl3Only ];
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ sikmir ];
|
||||
knownVulnerabilities = [
|
||||
"CVE-2018-7453: loop in PDF objects"
|
||||
"CVE-2018-16369: loop in PDF objects"
|
||||
"CVE-2019-9587: loop in PDF objects"
|
||||
"CVE-2019-9588: loop in PDF objects"
|
||||
"CVE-2019-16088: loop in PDF objects"
|
||||
];
|
||||
};
|
||||
}
|
||||
60
pkgs/applications/misc/xpdf/libxpdf.nix
Normal file
60
pkgs/applications/misc/xpdf/libxpdf.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "libxpdf";
|
||||
version = "3.02pl5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dl.xpdfreader.com/old/xpdf-3.02.tar.gz";
|
||||
sha256 = "000zq4ddbwyxiki4vdwpmxbnw5n9hsg9hvwra2p33hslyib7sfmk";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(fetchurl {
|
||||
url = "https://dl.xpdfreader.com/old/xpdf-3.02pl1.patch";
|
||||
sha256 = "1wxv9l0d2kkwi961ihpdwi75whdvk7cgqxkbfym8cjj11fq17xjq";
|
||||
})
|
||||
(fetchurl {
|
||||
url = "https://dl.xpdfreader.com/old/xpdf-3.02pl2.patch";
|
||||
sha256 = "1nfrgsh9xj0vryd8h65myzd94bjz117y89gq0hzji9dqn23xihfi";
|
||||
})
|
||||
(fetchurl {
|
||||
url = "https://dl.xpdfreader.com/old/xpdf-3.02pl3.patch";
|
||||
sha256 = "0jskkv8x6dqr9zj4azaglas8cziwqqrkbbnzrpm2kzrvsbxyhk2r";
|
||||
})
|
||||
(fetchurl {
|
||||
url = "https://dl.xpdfreader.com/old/xpdf-3.02pl4.patch";
|
||||
sha256 = "1c48h7aizx0ngmzlzw0mpja1w8vqyy3pg62hyxp7c60k86al715h";
|
||||
})
|
||||
(fetchurl {
|
||||
url = "https://dl.xpdfreader.com/old/xpdf-3.02pl5.patch";
|
||||
sha256 = "1fki66pw56yr6aw38f6amrx7wxwcxbx4704pjqq7pqqr784b7z4j";
|
||||
})
|
||||
./xpdf-3.02-protection.patch
|
||||
./libxpdf.patch
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib/goo
|
||||
mkdir -p $out/lib/fofi
|
||||
mkdir -p $out/lib/xpdf
|
||||
mkdir -p $out/include
|
||||
|
||||
cp -v goo/libGoo.a $out/lib/goo
|
||||
cp -v fofi/libfofi.a $out/lib/fofi
|
||||
cp -v xpdf/libxpdf.a $out/lib/xpdf
|
||||
|
||||
cp -v *.h $out/include
|
||||
cp -v goo/*.h $out/include
|
||||
cp -v fofi/*.h $out/include
|
||||
cp -v xpdf/*.h $out/include
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
platforms = platforms.unix;
|
||||
license = licenses.gpl2Only;
|
||||
};
|
||||
}
|
||||
45
pkgs/applications/misc/xpdf/libxpdf.patch
Normal file
45
pkgs/applications/misc/xpdf/libxpdf.patch
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
diff -rc xpdf-3.02/xpdf/Makefile.in xpdf-3.02-new/xpdf/Makefile.in
|
||||
*** xpdf-3.02/xpdf/Makefile.in 2007-02-27 23:05:52.000000000 +0100
|
||||
--- xpdf-3.02-new/xpdf/Makefile.in 2010-08-25 14:54:14.000000000 +0200
|
||||
***************
|
||||
*** 110,116 ****
|
||||
pdffonts$(EXE) pdftoppm$(EXE) pdfimages$(EXE)
|
||||
|
||||
all-no-x: pdftops$(EXE) pdftotext$(EXE) pdfinfo$(EXE) pdffonts$(EXE) \
|
||||
! pdfimages$(EXE)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
--- 110,116 ----
|
||||
pdffonts$(EXE) pdftoppm$(EXE) pdfimages$(EXE)
|
||||
|
||||
all-no-x: pdftops$(EXE) pdftotext$(EXE) pdfinfo$(EXE) pdffonts$(EXE) \
|
||||
! pdfimages$(EXE) libxpdf.a
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
***************
|
||||
*** 248,253 ****
|
||||
--- 248,269 ----
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
+ PDFTOEPDF_OBJS = \
|
||||
+ Array.o BuiltinFont.o BuiltinFontTables.o CMap.o \
|
||||
+ Catalog.o CharCodeToUnicode.o Decrypt.o Dict.o Error.o \
|
||||
+ FontEncodingTables.o Gfx.o GfxFont.o GfxState.o \
|
||||
+ GlobalParams.o JArithmeticDecoder.o JBIG2Stream.o JPXStream.o Lexer.o Link.o \
|
||||
+ NameToCharCode.o Object.o OutputDev.o Outline.o PDFDoc.o Page.o \
|
||||
+ Parser.o PDFDocEncoding.o Stream.o UnicodeMap.o XRef.o Function.o \
|
||||
+ PSTokenizer.o UnicodeTypeTable.o
|
||||
+
|
||||
+ libxpdf.a: $(PDFTOEPDF_OBJS)
|
||||
+ rm -f $@
|
||||
+ $(AR) $(ARFLAGS) $@ *.o
|
||||
+ ranlib $@
|
||||
+
|
||||
+ #------------------------------------------------------------------------
|
||||
+
|
||||
depend:
|
||||
$(CXX) $(CXXFLAGS) -MM $(CXX_SRC) >Makefile.dep
|
||||
|
||||
74
pkgs/applications/misc/xpdf/xpdf-3.02-protection.patch
Normal file
74
pkgs/applications/misc/xpdf/xpdf-3.02-protection.patch
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
diff -C 3 -r orig/xpdf/pdfimages.cc xpdf-3.02/xpdf/pdfimages.cc
|
||||
*** orig/xpdf/pdfimages.cc 2007-02-27 23:05:52.000000000 +0100
|
||||
--- xpdf-3.02/xpdf/pdfimages.cc 2007-10-31 20:17:22.601449943 +0100
|
||||
***************
|
||||
*** 118,130 ****
|
||||
goto err1;
|
||||
}
|
||||
|
||||
- // check for copy permission
|
||||
- if (!doc->okToCopy()) {
|
||||
- error(-1, "Copying of images from this document is not allowed.");
|
||||
- exitCode = 3;
|
||||
- goto err1;
|
||||
- }
|
||||
-
|
||||
// get page range
|
||||
if (firstPage < 1)
|
||||
firstPage = 1;
|
||||
--- 118,123 ----
|
||||
diff -C 3 -r orig/xpdf/pdftotext.cc xpdf-3.02/xpdf/pdftotext.cc
|
||||
*** orig/xpdf/pdftotext.cc 2007-02-27 23:05:52.000000000 +0100
|
||||
--- xpdf-3.02/xpdf/pdftotext.cc 2007-10-31 20:17:34.392224196 +0100
|
||||
***************
|
||||
*** 160,172 ****
|
||||
goto err2;
|
||||
}
|
||||
|
||||
- // check for copy permission
|
||||
- if (!doc->okToCopy()) {
|
||||
- error(-1, "Copying of text from this document is not allowed.");
|
||||
- exitCode = 3;
|
||||
- goto err2;
|
||||
- }
|
||||
-
|
||||
// construct text file name
|
||||
if (argc == 3) {
|
||||
textFileName = new GString(argv[2]);
|
||||
--- 160,165 ----
|
||||
diff -C 3 -r orig/xpdf/XPDFCore.cc xpdf-3.02/xpdf/XPDFCore.cc
|
||||
*** orig/xpdf/XPDFCore.cc 2007-02-27 23:05:52.000000000 +0100
|
||||
--- xpdf-3.02/xpdf/XPDFCore.cc 2007-10-31 20:18:05.370494431 +0100
|
||||
***************
|
||||
*** 384,394 ****
|
||||
#ifndef NO_TEXT_SELECT
|
||||
if (selectULX != selectLRX &&
|
||||
selectULY != selectLRY) {
|
||||
! if (doc->okToCopy()) {
|
||||
! copySelection();
|
||||
! } else {
|
||||
! error(-1, "Copying of text from this document is not allowed.");
|
||||
! }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
--- 384,390 ----
|
||||
#ifndef NO_TEXT_SELECT
|
||||
if (selectULX != selectLRX &&
|
||||
selectULY != selectLRY) {
|
||||
! copySelection();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
***************
|
||||
*** 407,415 ****
|
||||
int pg;
|
||||
double ulx, uly, lrx, lry;
|
||||
|
||||
- if (!doc->okToCopy()) {
|
||||
- return;
|
||||
- }
|
||||
if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) {
|
||||
//~ for multithreading: need a mutex here
|
||||
if (currentSelection) {
|
||||
--- 403,408 ----
|
||||
Loading…
Add table
Add a link
Reference in a new issue