Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl, makeFontsConf
2, cacert
3, cairo, coreutils, fontconfig, freefont_ttf
4, glib, gmp
5, gtk3
6, libedit, libffi
7, libiconv
8, libGL
9, libGLU
10, libjpeg
11, libpng, libtool, mpfr, openssl, pango, poppler
12, readline, sqlite
13, disableDocs ? false
14, CoreFoundation
15, gsettings-desktop-schemas
16, wrapGAppsHook
17}:
18
19let
20
21 fontsConf = makeFontsConf {
22 fontDirectories = [ freefont_ttf ];
23 };
24
25 libPath = lib.makeLibraryPath [
26 cairo
27 fontconfig
28 glib
29 gmp
30 gtk3
31 gsettings-desktop-schemas
32 libedit
33 libGL
34 libGLU
35 libjpeg
36 libpng
37 mpfr
38 openssl
39 pango
40 poppler
41 readline
42 sqlite
43 ];
44
45in
46
47stdenv.mkDerivation rec {
48 pname = "racket";
49 version = "7.9"; # always change at once with ./minimal.nix
50
51 src = (lib.makeOverridable ({ name, sha256 }:
52 fetchurl {
53 url = "https://mirror.racket-lang.org/installers/${version}/${name}-src.tgz";
54 inherit sha256;
55 }
56 )) {
57 name = "${pname}-${version}";
58 sha256 = "0gmp2ahmfd97nn9bwpfx9lznjmjkd042slnrrbdmyh59cqh98y2m";
59 };
60
61 FONTCONFIG_FILE = fontsConf;
62 LD_LIBRARY_PATH = libPath;
63 NIX_LDFLAGS = lib.concatStringsSep " " [
64 (lib.optionalString (stdenv.cc.isGNU && ! stdenv.isDarwin) "-lgcc_s")
65 (lib.optionalString stdenv.isDarwin "-framework CoreFoundation")
66 ];
67
68 nativeBuildInputs = [ cacert wrapGAppsHook ];
69
70 buildInputs = [ fontconfig libffi libtool sqlite gsettings-desktop-schemas gtk3 ]
71 ++ lib.optionals stdenv.isDarwin [ libiconv CoreFoundation ];
72
73 preConfigure = ''
74 unset AR
75 for f in src/lt/configure src/cs/c/configure src/bc/src/string.c; do
76 substituteInPlace "$f" --replace /usr/bin/uname ${coreutils}/bin/uname
77 done
78 mkdir src/build
79 cd src/build
80
81 gappsWrapperArgs+=("--prefix" "LD_LIBRARY_PATH" ":" ${LD_LIBRARY_PATH})
82 '';
83
84 shared = if stdenv.isDarwin then "dylib" else "shared";
85 configureFlags = [ "--enable-${shared}" "--enable-lt=${libtool}/bin/libtool" ]
86 ++ lib.optionals disableDocs [ "--disable-docs" ]
87 ++ lib.optionals stdenv.isDarwin [ "--enable-xonx" ];
88
89 configureScript = "../configure";
90
91 enableParallelBuilding = false;
92
93
94 meta = with lib; {
95 description = "A programmable programming language";
96 longDescription = ''
97 Racket is a full-spectrum programming language. It goes beyond
98 Lisp and Scheme with dialects that support objects, types,
99 laziness, and more. Racket enables programmers to link
100 components written in different dialects, and it empowers
101 programmers to create new, project-specific dialects. Racket's
102 libraries support applications from web servers and databases to
103 GUIs and charts.
104 '';
105 homepage = "https://racket-lang.org/";
106 license = with licenses; [ asl20 /* or */ mit ];
107 maintainers = with maintainers; [ henrytill vrthra ];
108 platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-linux" ];
109 broken = stdenv.isDarwin; # No support yet for setting FFI lookup path
110 };
111}