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
154
pkgs/misc/ghostscript/default.nix
Normal file
154
pkgs/misc/ghostscript/default.nix
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
{ config, stdenv, lib, fetchurl, pkg-config, zlib, expat, openssl, autoconf
|
||||
, libjpeg, libpng, libtiff, freetype, fontconfig, libpaper, jbig2dec
|
||||
, libiconv, ijs, lcms2, callPackage, bash, buildPackages, openjpeg
|
||||
, cupsSupport ? config.ghostscript.cups or (!stdenv.isDarwin), cups
|
||||
, x11Support ? cupsSupport, xlibsWrapper # with CUPS, X11 only adds very little
|
||||
}:
|
||||
|
||||
let
|
||||
fonts = stdenv.mkDerivation {
|
||||
name = "ghostscript-fonts";
|
||||
|
||||
srcs = [
|
||||
(fetchurl {
|
||||
url = "mirror://sourceforge/gs-fonts/ghostscript-fonts-std-8.11.tar.gz";
|
||||
sha256 = "00f4l10xd826kak51wsmaz69szzm2wp8a41jasr4jblz25bg7dhf";
|
||||
})
|
||||
(fetchurl {
|
||||
url = "mirror://gnu/ghostscript/gnu-gs-fonts-other-6.0.tar.gz";
|
||||
sha256 = "1cxaah3r52qq152bbkiyj2f7dx1rf38vsihlhjmrvzlr8v6cqil1";
|
||||
})
|
||||
# ... add other fonts here
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir "$out"
|
||||
mv -v * "$out/"
|
||||
'';
|
||||
};
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ghostscript${lib.optionalString (x11Support) "-with-X"}";
|
||||
version = "9.56.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9${lib.versions.minor version}${lib.versions.patch version}/ghostscript-${version}.tar.xz";
|
||||
sha512 = "22ysgdprh960rxmxyk2fy2my47cdrhfhbrwar1955hvad54iw79l916drp92wh3qzbxw6z40i70wk00vz8bn2ryig7qgpc1q01m2npy";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./urw-font-files.patch
|
||||
./doc-no-ref.diff
|
||||
];
|
||||
|
||||
outputs = [ "out" "man" "doc" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
depsBuildBuild = [
|
||||
buildPackages.stdenv.cc
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ pkg-config autoconf zlib ]
|
||||
++ lib.optional cupsSupport cups;
|
||||
|
||||
buildInputs = [
|
||||
zlib expat openssl
|
||||
libjpeg libpng libtiff freetype fontconfig libpaper jbig2dec
|
||||
libiconv ijs lcms2 bash openjpeg
|
||||
]
|
||||
++ lib.optional x11Support xlibsWrapper
|
||||
++ lib.optional cupsSupport cups
|
||||
;
|
||||
|
||||
preConfigure = ''
|
||||
# https://ghostscript.com/doc/current/Make.htm
|
||||
export CCAUX=$CC_FOR_BUILD
|
||||
${lib.optionalString cupsSupport ''export CUPSCONFIG="${cups.dev}/bin/cups-config"''}
|
||||
|
||||
rm -rf jpeg libpng zlib jasper expat tiff lcms2mt jbig2dec freetype cups/libs ijs openjpeg
|
||||
|
||||
sed "s@if ( test -f \$(INCLUDE)[^ ]* )@if ( true )@; s@INCLUDE=/usr/include@INCLUDE=/no-such-path@" -i base/unix-aux.mak
|
||||
sed "s@^ZLIBDIR=.*@ZLIBDIR=${zlib.dev}/include@" -i configure.ac
|
||||
|
||||
autoconf
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--with-system-libtiff"
|
||||
"--enable-dynamic"
|
||||
"--without-tesseract"
|
||||
]
|
||||
++ lib.optional x11Support "--with-x"
|
||||
++ lib.optionals cupsSupport [
|
||||
"--enable-cups"
|
||||
];
|
||||
|
||||
# make check does nothing useful
|
||||
doCheck = false;
|
||||
|
||||
# don't build/install statically linked bin/gs
|
||||
buildFlags = [ "so" ];
|
||||
installTargets = [ "soinstall" ];
|
||||
|
||||
postInstall = ''
|
||||
ln -s gsc "$out"/bin/gs
|
||||
|
||||
cp -r Resource "$out/share/ghostscript/${version}"
|
||||
|
||||
ln -s "${fonts}" "$out/share/ghostscript/fonts"
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
for file in $out/lib/*.dylib* ; do
|
||||
install_name_tool -id "$file" $file
|
||||
done
|
||||
'';
|
||||
|
||||
# dynamic library name only contains maj.min, eg. '9.53'
|
||||
dylib_version = lib.versions.majorMinor version;
|
||||
preFixup = lib.optionalString stdenv.isDarwin ''
|
||||
install_name_tool -change libgs.dylib.$dylib_version $out/lib/libgs.dylib.$dylib_version $out/bin/gs
|
||||
'';
|
||||
|
||||
# validate dynamic linkage
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
|
||||
$out/bin/gs --version
|
||||
pushd examples
|
||||
for f in *.{ps,eps,pdf}; do
|
||||
echo "Rendering $f"
|
||||
$out/bin/gs \
|
||||
-dNOPAUSE \
|
||||
-dBATCH \
|
||||
-sDEVICE=bitcmyk \
|
||||
-sOutputFile=/dev/null \
|
||||
-r600 \
|
||||
-dBufferSpace=100000 \
|
||||
$f
|
||||
done
|
||||
popd # examples
|
||||
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
passthru.tests.test-corpus-render = callPackage ./test-corpus-render.nix {};
|
||||
|
||||
meta = {
|
||||
homepage = "https://www.ghostscript.com/";
|
||||
description = "PostScript interpreter (mainline version)";
|
||||
longDescription = ''
|
||||
Ghostscript is the name of a set of tools that provides (i) an
|
||||
interpreter for the PostScript language and the PDF file format,
|
||||
(ii) a set of C procedures (the Ghostscript library) that
|
||||
implement the graphics capabilities that appear as primitive
|
||||
operations in the PostScript language, and (iii) a wide variety
|
||||
of output drivers for various file formats and printers.
|
||||
'';
|
||||
license = lib.licenses.agpl3;
|
||||
platforms = lib.platforms.all;
|
||||
maintainers = [ lib.maintainers.viric ];
|
||||
mainProgram = "gs";
|
||||
};
|
||||
}
|
||||
7
pkgs/misc/ghostscript/doc-no-ref.diff
Normal file
7
pkgs/misc/ghostscript/doc-no-ref.diff
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
Kill the reference from libgc.so to the documentation directory.
|
||||
It's bad for closure, and probably not really good for anything.
|
||||
--- a/base/gs.mak
|
||||
+++ b/base/gs.mak
|
||||
@@ -538,1 +538,1 @@
|
||||
- $(EXP)$(ECHOGS_XE) -a $(gconfigd_h) -x 23 define -s -u GS_DOCDIR -x 2022 $(GS_DOCDIR) -x 22
|
||||
+ $(EXP)$(ECHOGS_XE) -a $(gconfigd_h) -x 23 define -s -u GS_DOCDIR -x 2022 /no-path-to-docs -x 22
|
||||
37
pkgs/misc/ghostscript/test-corpus-render.nix
Normal file
37
pkgs/misc/ghostscript/test-corpus-render.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ stdenv
|
||||
, fetchgit
|
||||
, ghostscript
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "ghostscript-test-corpus-render";
|
||||
version = "unstable-2020-02-19";
|
||||
|
||||
src = fetchgit {
|
||||
url = "git://git.ghostscript.com/tests.git";
|
||||
rev = "efdd224340d9a407ed3ec22afa1cb127c8fee73c";
|
||||
sha256 = "1v1iqz897zzrwa8ng22zcf3y61ab5798jdwidgv10w1r9mjrl7ax";
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
doCheck = true;
|
||||
checkPhase = ''
|
||||
find . -iregex '.*\.\(ps\|eps\|pdf\)' | while read f; do
|
||||
echo "Rendering $f"
|
||||
${ghostscript}/bin/gs \
|
||||
-dNOPAUSE \
|
||||
-dBATCH \
|
||||
-sDEVICE=bitcmyk \
|
||||
-sOutputFile=/dev/null \
|
||||
-r600 \
|
||||
-dBufferSpace=100000 \
|
||||
$f
|
||||
done
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
touch $out
|
||||
'';
|
||||
}
|
||||
61
pkgs/misc/ghostscript/urw-font-files.patch
Normal file
61
pkgs/misc/ghostscript/urw-font-files.patch
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
Sometime between 8.62 and 8.64, the fontmap file was changed such that the
|
||||
`.pfb' files of the URW++ fonts no longer appear in 8.64, making it impossible
|
||||
to display/render these fonts.
|
||||
|
||||
--- gnu-ghostscript-8.64/Resource/Init/Fontmap.GS 2009-05-27 02:19:02.000000000 +0200
|
||||
+++ gnu-ghostscript-8.62/Resource/Init/Fontmap.GS 2009-05-27 02:19:09.000000000 +0200
|
||||
@@ -81,6 +81,54 @@
|
||||
% Copyright URW Software, Copyright 1994 by URW.
|
||||
%
|
||||
|
||||
+% Actual fonts
|
||||
+
|
||||
+/URWBookmanL-DemiBold (b018015l.pfb) ;
|
||||
+/URWBookmanL-DemiBoldItal (b018035l.pfb) ;
|
||||
+/URWBookmanL-Ligh (b018012l.pfb) ;
|
||||
+/URWBookmanL-LighItal (b018032l.pfb) ;
|
||||
+
|
||||
+/NimbusMonL-Regu (n022003l.pfb) ;
|
||||
+/NimbusMonL-ReguObli (n022023l.pfb) ;
|
||||
+/NimbusMonL-Bold (n022004l.pfb) ;
|
||||
+/NimbusMonL-BoldObli (n022024l.pfb) ;
|
||||
+
|
||||
+/URWGothicL-Book (a010013l.pfb) ;
|
||||
+/URWGothicL-BookObli (a010033l.pfb) ;
|
||||
+/URWGothicL-Demi (a010015l.pfb) ;
|
||||
+/URWGothicL-DemiObli (a010035l.pfb) ;
|
||||
+
|
||||
+/NimbusSanL-Regu (n019003l.pfb) ;
|
||||
+/NimbusSanL-ReguItal (n019023l.pfb) ;
|
||||
+/NimbusSanL-Bold (n019004l.pfb) ;
|
||||
+/NimbusSanL-BoldItal (n019024l.pfb) ;
|
||||
+
|
||||
+/NimbusSanL-ReguCond (n019043l.pfb) ;
|
||||
+/NimbusSanL-ReguCondItal (n019063l.pfb) ;
|
||||
+/NimbusSanL-BoldCond (n019044l.pfb) ;
|
||||
+/NimbusSanL-BoldCondItal (n019064l.pfb) ;
|
||||
+
|
||||
+/URWPalladioL-Roma (p052003l.pfb) ;
|
||||
+/URWPalladioL-Ital (p052023l.pfb) ;
|
||||
+/URWPalladioL-Bold (p052004l.pfb) ;
|
||||
+/URWPalladioL-BoldItal (p052024l.pfb) ;
|
||||
+
|
||||
+/CenturySchL-Roma (c059013l.pfb) ;
|
||||
+/CenturySchL-Ital (c059033l.pfb) ;
|
||||
+/CenturySchL-Bold (c059016l.pfb) ;
|
||||
+/CenturySchL-BoldItal (c059036l.pfb) ;
|
||||
+
|
||||
+/NimbusRomNo9L-Regu (n021003l.pfb) ;
|
||||
+/NimbusRomNo9L-ReguItal (n021023l.pfb) ;
|
||||
+/NimbusRomNo9L-Medi (n021004l.pfb) ;
|
||||
+/NimbusRomNo9L-MediItal (n021024l.pfb) ;
|
||||
+
|
||||
+/StandardSymL (s050000l.pfb) ;
|
||||
+
|
||||
+/URWChanceryL-MediItal (z003034l.pfb) ;
|
||||
+
|
||||
+/Dingbats (d050000l.pfb) ;
|
||||
+
|
||||
% Aliases
|
||||
|
||||
/Bookman-Demi /URWBookmanL-DemiBold ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue