3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/parsing/ragel/default.nix
Zhong Jianxin e8f3914985 treewide: Replace transfig with fig2dev
Reasons:

- transfig never get upstream update since it was added to nixpkgs 2006,
  according to [fig2dev Debian changelog][1], upstream maintainership
  was taken over at 2016, and renamed to fig2dev.

- [Debian][2], [ArchLinux][3], [HomeBrew][4] all use fig2dev to replace
  transfig.

- transfig builds [failed][5] on aarch64-darwin, fig2dev builds fine.

- One less package to maintain.

[1]: https://salsa.debian.org/debian/fig2dev/-/blob/debian/1%253.2.6_beta-1/debian/changelog
[2]: https://packages.debian.org/bullseye/transfig
[3]: https://archlinux.org/packages/community/x86_64/fig2dev/
[4]: https://formulae.brew.sh/formula/fig2dev
[5]: https://hydra.nixos.org/build/163404782/nixlog/2
2022-02-15 10:13:56 +08:00

52 lines
1.2 KiB
Nix

{ lib, stdenv, fetchurl, fig2dev, tex, ghostscript, colm
, build-manual ? false
}:
let
generic = { version, sha256, license }:
stdenv.mkDerivation rec {
pname = "ragel";
inherit version;
src = fetchurl {
url = "https://www.colm.net/files/ragel/${pname}-${version}.tar.gz";
inherit sha256;
};
buildInputs = lib.optional build-manual [ fig2dev ghostscript tex ];
preConfigure = lib.optionalString build-manual ''
sed -i "s/build_manual=no/build_manual=yes/g" DIST
'';
configureFlags = [ "--with-colm=${colm}" ];
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-std=gnu++98";
doCheck = true;
meta = with lib; {
homepage = "https://www.colm.net/open-source/ragel/";
description = "State machine compiler";
inherit license;
platforms = platforms.unix;
maintainers = with maintainers; [ pSub ];
};
};
in
{
ragelStable = generic {
version = "6.10";
sha256 = "0gvcsl62gh6sg73nwaxav4a5ja23zcnyxncdcdnqa2yjcpdnw5az";
license = lib.licenses.gpl2;
};
ragelDev = generic {
version = "7.0.0.12";
sha256 = "0x3si355lv6q051lgpg8bpclpiq5brpri5lv3p8kk2qhzfbyz69r";
license = lib.licenses.mit;
};
}