3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/parsing/ragel/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

52 lines
1.3 KiB
Nix

{ lib, stdenv, fetchurl, transfig, 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 = stdenv.lib.optional build-manual [ transfig ghostscript tex ];
preConfigure = stdenv.lib.optional build-manual ''
sed -i "s/build_manual=no/build_manual=yes/g" DIST
'';
configureFlags = [ "--with-colm=${colm}" ];
NIX_CFLAGS_COMPILE = stdenv.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 = stdenv.lib.licenses.gpl2;
};
ragelDev = generic {
version = "7.0.0.12";
sha256 = "0x3si355lv6q051lgpg8bpclpiq5brpri5lv3p8kk2qhzfbyz69r";
license = stdenv.lib.licenses.mit;
};
}