1{
2 lib,
3 stdenv,
4 fetchurl,
5 perl,
6 libtool,
7 pkg-config,
8 gettext,
9 mandoc,
10 ed,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "bsdbuild";
15 version = "3.1";
16
17 src = fetchurl {
18 url = "http://stable.hypertriton.com/bsdbuild/${pname}-${version}.tar.gz";
19 sha256 = "1zrdjh7a6z4khhfw9zrp490afq306cpl5v8wqz2z55ys7k1n5ifl";
20 };
21
22 buildInputs = [
23 perl
24 mandoc
25 ed
26 ];
27 nativeBuildInputs = [
28 pkg-config
29 libtool
30 gettext
31 ];
32
33 prePatch = ''
34 #ignore unfamiliar flags
35 substituteInPlace configure \
36 --replace '--sbindir=*' '--sbindir=* | --includedir=* | --oldincludedir=*'
37 #same for packages using bsdbuild
38 substituteInPlace mkconfigure.pl \
39 --replace '--sbindir=*' '--sbindir=* | --includedir=* | --oldincludedir=*'
40 #insert header for missing NULL macro
41 for f in db4.pm sdl_ttf.pm mysql.pm uim.pm strlcpy.pm getpwuid.pm \
42 getaddrinfo.pm strtoll.pm free_null.pm getpwnam_r.pm \
43 gettimeofday.pm gethostbyname.pm xinerama.pm strsep.pm \
44 fontconfig.pm gettext.pm pthreads.pm strlcat.pm kqueue.pm wgl.pm \
45 alsa.pm crypt.pm cracklib.pm freesg-rg.pm edacious.pm mmap.pm \
46 agar.pm x11.pm x11.pm execvp.pm agar-core.pm dyld.pm getopt.pm \
47 strtold.pm sdl_image.pm shl_load.pm glx.pm percgi.pm timerfd.pm \
48 glob.pm dlopen.pm freesg.pm csidl.pm perl.pm select.pm \
49 portaudio.pm etubestore.pm;
50 do
51 ed -s -v BSDBuild/$f << EOF
52 /#include
53 i
54 #include <stddef.h>
55 .
56 w
57 EOF
58 done
59 '';
60
61 configureFlags = [
62 "--with-libtool=${libtool}/bin/libtool"
63 "--enable-nls=yes"
64 "--with-gettext=${gettext}"
65 "--with-manpages=yes"
66 ];
67
68 meta = {
69 homepage = "http://bsdbuild.hypertriton.com";
70 description = "Cross-platform build system";
71
72 longDescription = ''
73 BSDBuild is a cross-platform build system. Derived from the
74 traditional 4.4BSD make libraries, BSDBuild allows BSD-style
75 Makefiles (without BSD make extensions), and works natively
76 under most operating systems and make flavors. Since BSDBuild
77 is implemented as a library (as opposed to a macro package),
78 Makefiles are edited directly, as opposed to being compiled
79 (however, if the build directory is separate from the source
80 directory, BSDBuild will produce the required Makefiles in place).
81 '';
82
83 license = lib.licenses.bsd3;
84 platforms = lib.platforms.linux;
85 };
86}