1{ lib, stdenv, fetchurl, fetchpatch }:
2
3stdenv.mkDerivation rec {
4 version = "0.99";
5 pname = "barcode";
6 src = fetchurl {
7 url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
8 sha256 = "1indapql5fjz0bysyc88cmc54y8phqrbi7c76p71fgjp45jcyzp8";
9 };
10 patches = [
11 # Pull upstream patch for -fno-common toolchains.
12 (fetchpatch {
13 name = "fno-common.patch";
14 url = "http://git.savannah.gnu.org/cgit/barcode.git/patch/?id=4654f68706a459c9602d9932b56a56e8930f7d53";
15 sha256 = "15kclzcwlh0ymr7m48vc0m8z98q0wf4xbfcky4g1y8yvvpvvrfgc";
16 })
17 ];
18
19 configureFlags = lib.optional stdenv.isDarwin "ac_cv_func_calloc_0_nonnull=yes";
20
21 hardeningDisable = [ "format" ];
22
23 meta = with lib; {
24 description = "GNU barcode generator";
25 maintainers = with maintainers; [ raskin ];
26 platforms = platforms.unix;
27 downloadPage = "https://ftp.gnu.org/gnu/barcode/";
28 homepage = "https://www.gnu.org/software/barcode/";
29 license = licenses.gpl3;
30 };
31}