nixpkgs/pkgs/by-name/an/antiword/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

33 lines
840 B
Nix

{ lib, fetchurl, stdenv }:
stdenv.mkDerivation rec{
pname = "antiword";
version = "0.37";
src = fetchurl {
url = "http://www.winfield.demon.nl/linux/antiword-${version}.tar.gz";
sha256 = "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f";
};
prePatch = ''
sed -i -e "s|/usr/local/bin|$out/bin|g" -e "s|/usr/share|$out/share|g" Makefile antiword.h
substituteInPlace Makefile --replace "gcc" '$(CC)'
'';
patches = [ ./10_fix_buffer_overflow_wordole_c_CVE-2014-8123.patch ];
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
];
installTargets = [ "global_install" ];
meta = {
homepage = "http://www.winfield.demon.nl/";
description = "Convert MS Word documents to plain text or PostScript";
license = lib.licenses.gpl2;
platforms = with lib.platforms; linux ++ darwin;
};
}