at master 15 kB view raw
1{ 2 build-asdf-system, 3 spec, 4 quicklispPackagesFor, 5 stdenv, 6 pkgs, 7 ... 8}: 9 10let 11 12 inherit (pkgs.lib) 13 head 14 makeLibraryPath 15 makeSearchPath 16 setAttr 17 hasAttr 18 optionals 19 optionalAttrs 20 isDerivation 21 hasSuffix 22 splitString 23 remove 24 ; 25 26 # Used by builds that would otherwise attempt to write into storeDir. 27 # 28 # Will run build two times, keeping all files created during the 29 # first run, exept the FASL's. Then using that directory tree as the 30 # source of the second run. 31 # 32 # E.g. cl-unicode creating .txt files during compilation 33 build-with-compile-into-pwd = 34 args: 35 let 36 args' = if isDerivation args then args.drvAttrs else args; 37 build = (build-asdf-system (args' // { version = args'.version + "-build"; })).overrideAttrs (o: { 38 buildPhase = with builtins; '' 39 runHook preBuild 40 41 mkdir __fasls 42 export ASDF_OUTPUT_TRANSLATIONS="$(pwd):$(pwd)/__fasls:${storeDir}:${storeDir}" 43 export CL_SOURCE_REGISTRY=$CL_SOURCE_REGISTRY:$(pwd)// 44 ${o.pkg}/bin/${o.program} ${toString (o.flags or [ ])} < ${o.buildScript} 45 46 runHook postBuild 47 ''; 48 installPhase = '' 49 runHook preInstall 50 51 mkdir -pv $out 52 rm -rf __fasls 53 cp -r * $out 54 55 runHook postInstall 56 ''; 57 }); 58 in 59 build-asdf-system ( 60 args' 61 // { 62 # Patches are already applied in `build` 63 patches = [ ]; 64 postPatch = ""; 65 src = build; 66 } 67 ); 68 69 # Makes it so packages imported from Quicklisp can be re-used as 70 # lispLibs ofpackages in this file. 71 ql = quicklispPackagesFor spec; 72 73 packages = ql.overrideScope ( 74 self: super: 75 { 76 77 cl-unicode = build-with-compile-into-pwd { 78 inherit (super.cl-unicode) 79 pname 80 version 81 src 82 systems 83 ; 84 lispLibs = super.cl-unicode.lispLibs ++ [ self.flexi-streams ]; 85 }; 86 87 jzon = super.com_dot_inuoe_dot_jzon; 88 89 _40ants-routes = super._40ants-routes.overrideLispAttrs (o: { 90 systems = o.systems ++ [ "40ants-routes/handler" ]; 91 }); 92 93 reblocks-ui2 = super.reblocks-ui2.overrideLispAttrs (o: { 94 systems = o.systems ++ [ 95 "reblocks-ui2/themes/color" 96 "reblocks-ui2/themes/tailwind" 97 "reblocks-ui2/utils/padding" 98 "reblocks-ui2/utils/align" 99 "reblocks-ui2/card" 100 "reblocks-ui2/card/view" 101 ]; 102 }); 103 104 april = super.april.overrideLispAttrs (o: { 105 systems = o.systems ++ [ "cape" ]; 106 }); 107 108 cl-notify = build-asdf-system { 109 pname = "cl-notify"; 110 version = "20080904-138ca7038"; 111 src = pkgs.fetchzip { 112 url = "https://repo.or.cz/cl-notify.git/snapshot/138ca703861f4a1fbccbed557f92cf4d213668a1.tar.gz"; 113 sha256 = "0k6ns6fzvjcbpsqgx85r4g5m25fvrdw9481i9vyabwym9q8bbqwx"; 114 }; 115 lispLibs = [ 116 self.cffi 117 ]; 118 nativeLibs = [ 119 pkgs.libnotify 120 ]; 121 }; 122 123 cl-liballegro-nuklear = build-with-compile-into-pwd super.cl-liballegro-nuklear; 124 125 lessp = build-asdf-system { 126 pname = "lessp"; 127 version = "0.2-f8a9e4664"; 128 src = pkgs.fetchzip { 129 url = "https://github.com/facts-db/cl-lessp/archive/632217602b85b679e8d420654a0aa39e798ca3b5.tar.gz"; 130 sha256 = "0i3ia14dzqwjpygd0zn785ff5vqnnmkn75psfpyx0ni3jr71lkq9"; 131 }; 132 }; 133 134 rollback = build-asdf-system { 135 pname = "rollback"; 136 version = "0.1-5d3f21fda"; 137 src = pkgs.fetchzip { 138 url = "https://github.com/facts-db/cl-rollback/archive/5d3f21fda8f04f35c5e9d20ee3b87db767915d15.tar.gz"; 139 sha256 = "12dpxsbm2al633y87i8p784k2dn4bbskz6sl40v9f5ljjmjqjzxf"; 140 }; 141 }; 142 143 facts = build-asdf-system { 144 pname = "facts"; 145 version = "0.1-632217602"; 146 src = pkgs.fetchzip { 147 url = "https://beta.quicklisp.org/archive/cl-facts/2022-11-06/cl-facts-20221106-git.tgz"; 148 sha256 = "sha256-PBpyyJYkq1NjKK9VikSAL4TmrGRwUJlEWRSeKj/f4Sc="; 149 }; 150 lispLibs = [ 151 self.lessp 152 self.rollback 153 self.local-time 154 ]; 155 }; 156 157 cl-fuse = build-with-compile-into-pwd { 158 inherit (super.cl-fuse) 159 pname 160 version 161 src 162 lispLibs 163 ; 164 nativeBuildInputs = [ pkgs.fuse ]; 165 nativeLibs = [ pkgs.fuse ]; 166 }; 167 168 cl-containers = build-asdf-system { 169 inherit (super.cl-containers) pname version src; 170 lispLibs = super.cl-containers.lispLibs ++ [ self.moptilities ]; 171 systems = [ 172 "cl-containers" 173 "cl-containers/with-moptilities" 174 ]; 175 }; 176 177 swank = build-with-compile-into-pwd rec { 178 inherit (super.swank) pname lispLibs; 179 version = "2.29.1"; 180 src = pkgs.fetchFromGitHub { 181 owner = "slime"; 182 repo = "slime"; 183 rev = "v${version}"; 184 hash = "sha256-5hNB5XxbTER4HX3dn4umUGnw6UeiTQkczmggFz4uWoE="; 185 }; 186 systems = [ 187 "swank" 188 "swank/exts" 189 ]; 190 patches = [ ./patches/swank-pure-paths.patch ]; 191 postConfigure = '' 192 substituteAllInPlace swank-loader.lisp 193 ''; 194 }; 195 196 slynk = build-asdf-system { 197 pname = "slynk"; 198 version = "trunk"; 199 src = pkgs.fetchFromGitHub { 200 owner = "joaotavora"; 201 repo = "sly"; 202 rev = "ba40c8f054ec3b7040a6c36a1ef3e9596b936421"; 203 hash = "sha256-hoaCZtyezuXptDPnAvBTT0SZ14M9Ifrmki3beBOwFmI="; 204 }; 205 systems = [ 206 "slynk" 207 "slynk/arglists" 208 "slynk/fancy-inspector" 209 "slynk/package-fu" 210 "slynk/mrepl" 211 "slynk/trace-dialog" 212 "slynk/profiler" 213 "slynk/stickers" 214 "slynk/indentation" 215 "slynk/retro" 216 ]; 217 }; 218 219 cephes = build-with-compile-into-pwd { 220 inherit (super.cephes) 221 pname 222 version 223 src 224 lispLibs 225 ; 226 patches = [ ./patches/cephes-make.patch ]; 227 postPatch = '' 228 find \( -name '*.dll' -o -name '*.dylib' -o -name '*.so' \) -delete 229 ''; 230 postConfigure = '' 231 substituteAllInPlace cephes.asd 232 ''; 233 postInstall = '' 234 find $out -name '*.o' -delete 235 ''; 236 }; 237 238 clx-truetype = build-asdf-system { 239 pname = "clx-truetype"; 240 version = "20160825-git"; 241 src = pkgs.fetchzip { 242 url = "http://beta.quicklisp.org/archive/clx-truetype/2016-08-25/clx-truetype-20160825-git.tgz"; 243 sha256 = "079hyp92cjkdfn6bhkxsrwnibiqbz4y4af6nl31lzw6nm91j5j37"; 244 }; 245 lispLibs = with self; [ 246 alexandria 247 bordeaux-threads 248 cl-aa 249 cl-fad 250 cl-paths 251 cl-paths-ttf 252 cl-store 253 cl-vectors 254 clx 255 trivial-features 256 zpb-ttf 257 ]; 258 }; 259 260 mathkit = build-asdf-system { 261 inherit (super.mathkit) 262 pname 263 version 264 src 265 asds 266 ; 267 lispLibs = super.mathkit.lispLibs ++ [ super.sb-cga ]; 268 }; 269 270 stumpwm = super.stumpwm.overrideLispAttrs { 271 inherit (pkgs.stumpwm) src version; 272 meta = { 273 inherit (pkgs.stumpwm.meta) description license homepage; 274 }; 275 }; 276 277 clfswm = super.clfswm.overrideAttrs (o: { 278 buildScript = pkgs.writeText "build-clfswm.lisp" '' 279 (load "${o.asdfFasl}/asdf.${o.faslExt}") 280 (asdf:load-system 'clfswm) 281 (sb-ext:save-lisp-and-die 282 "clfswm" 283 :executable t 284 #+sb-core-compression :compression 285 #+sb-core-compression t 286 :toplevel #'clfswm:main) 287 ''; 288 installPhase = o.installPhase + '' 289 mkdir -p $out/bin 290 mv $out/clfswm $out/bin 291 ''; 292 }); 293 294 magicl = build-with-compile-into-pwd { 295 inherit (super.magicl) 296 pname 297 version 298 src 299 lispLibs 300 ; 301 nativeBuildInputs = [ pkgs.gfortran ]; 302 nativeLibs = [ pkgs.openblas ]; 303 }; 304 305 cl-gtk4 = build-asdf-system { 306 pname = "cl-gtk4"; 307 version = "1.0.0"; 308 src = pkgs.fetchFromGitHub { 309 owner = "bohonghuang"; 310 repo = "cl-gtk4"; 311 rev = "ff60e3495cdbba5c09d0bb8aa49f3184cc060c8e"; 312 hash = "sha256-06cyPf+5z+GE3YvZEJ67kC281nkwRz/hoaykTISsni0="; 313 }; 314 lispLibs = with self; [ 315 cl-gobject-introspection-wrapper 316 cl-glib 317 cl-gio 318 cl-gobject 319 ]; 320 nativeBuildInputs = [ 321 pkgs.gobject-introspection 322 pkgs.gtk4 323 ]; 324 nativeLibs = [ 325 pkgs.gtk4 326 ]; 327 }; 328 329 cl-gtk4_dot_adw = build-asdf-system { 330 pname = "cl-gtk4.adw"; 331 version = self.cl-gtk4.version; 332 src = self.cl-gtk4.src; 333 lispLibs = with self; [ 334 cl-gobject-introspection-wrapper 335 cl-gtk4 336 ]; 337 nativeBuildInputs = [ 338 pkgs.libadwaita 339 ]; 340 nativeLibs = [ 341 pkgs.libadwaita 342 ]; 343 }; 344 345 cl-gtk4_dot_webkit = build-asdf-system { 346 pname = "cl-gtk4.webkit"; 347 version = self.cl-gtk4.version; 348 src = self.cl-gtk4.src; 349 lispLibs = with self; [ 350 cl-gobject-introspection-wrapper 351 cl-gtk4 352 ]; 353 nativeBuildInputs = [ 354 pkgs.webkitgtk_6_0 355 ]; 356 nativeLibs = [ 357 pkgs.webkitgtk_6_0 358 ]; 359 }; 360 361 cl-avro = build-asdf-system { 362 pname = "cl-avro"; 363 version = "trunk"; 364 src = pkgs.fetchFromGitHub { 365 owner = "SahilKang"; 366 repo = "cl-avro"; 367 rev = "b8fa26320fa0ae88390215140d57f9cca937f691"; 368 hash = "sha256-acXsotvKWuffrLbrG9YJ8yZc5E6WC8N0qCFCAiX6N0Q="; 369 }; 370 lispLibs = with self; [ 371 alexandria 372 babel 373 chipz 374 closer-mop 375 ieee-floats 376 flexi-streams 377 local-time 378 local-time-duration 379 md5 380 salza2 381 st-json 382 time-interval 383 trivial-extensible-sequences 384 ]; 385 }; 386 387 frugal-uuid = super.frugal-uuid.overrideLispAttrs (o: { 388 systems = [ 389 "frugal-uuid" 390 "frugal-uuid/non-frugal" 391 "frugal-uuid/benchmark" 392 "frugal-uuid/test" 393 ]; 394 lispLibs = 395 o.lispLibs 396 ++ (with self; [ 397 ironclad 398 babel 399 trivial-clock 400 trivial-benchmark 401 fiveam 402 ]); 403 }); 404 405 duckdb = super.duckdb.overrideLispAttrs (o: { 406 systems = [ 407 "duckdb" 408 "duckdb/test" 409 "duckdb/benchmark" 410 ]; 411 }); 412 413 polyclot = build-asdf-system { 414 pname = "polyclot"; 415 version = "trunk"; 416 src = pkgs.fetchfossil { 417 url = "https://fossil.turtleware.eu/fossil.turtleware.eu/polyclot"; 418 rev = "18500c968b1fc1e2a915b5c70b8cddc4a2b54de51da4eedc5454e42bfea3b479"; 419 sha256 = "sha256-KgBL1QQN4iG6d8E9GlKAuxSwkrY6Zy7e1ZzEDGKad+A="; 420 }; 421 systems = [ 422 "eu.turtleware.polyclot" 423 "eu.turtleware.polyclot/demo" 424 ]; 425 lispLibs = with self; [ 426 clim 427 mcclim 428 mcclim-layouts 429 ]; 430 }; 431 432 kons-9 = build-asdf-system { 433 pname = "kons-9"; 434 version = "trunk"; 435 src = pkgs.fetchFromGitHub { 436 owner = "kaveh808"; 437 repo = "kons-9"; 438 rev = "08770e7fbb839b91fd035f1cd4a50ecc81b42d57"; 439 sha256 = "sha256-Tit/qmOU5+zp43/ecIXGbh4CtgWzltWM7tHdVWkga0k="; 440 }; 441 systems = [ 442 "kons-9" 443 "kons-9/testsuite" 444 ]; 445 patches = [ ./patches/kons-9-fix-testsuite-compilation.patch ]; 446 lispLibs = with self; [ 447 closer-mop 448 trivial-main-thread 449 trivial-backtrace 450 cffi 451 cl-opengl 452 cl-glu 453 cl-glfw3 454 cl-paths-ttf 455 zpb-ttf 456 cl-vectors 457 origin 458 clobber 459 shasht 460 org_dot_melusina_dot_confidence 461 ]; 462 }; 463 464 nsb-cga = super.nsb-cga.overrideLispAttrs (oa: { 465 lispLibs = oa.lispLibs ++ [ self.sb-cga ]; 466 }); 467 468 qlot-cli = build-asdf-system rec { 469 pname = "qlot"; 470 version = "1.5.2"; 471 472 src = pkgs.fetchFromGitHub { 473 owner = "fukamachi"; 474 repo = "qlot"; 475 rev = "refs/tags/${version}"; 476 hash = "sha256-j9iT25Yz9Z6llCKwwiHlVNKLqwuKvY194LrAzXuljsE="; 477 }; 478 479 lispLibs = with self; [ 480 archive 481 deflate 482 dexador 483 fuzzy-match 484 ironclad 485 lparallel 486 yason 487 ]; 488 489 nativeLibs = [ 490 pkgs.openssl 491 ]; 492 493 nativeBuildInputs = [ 494 pkgs.makeWrapper 495 ]; 496 497 buildScript = pkgs.writeText "build-qlot-cli" '' 498 (load "${self.qlot-cli.asdfFasl}/asdf.${self.qlot-cli.faslExt}") 499 (asdf:load-system :qlot/command) 500 (asdf:load-system :qlot/subcommands) 501 502 ;; Use uiop:dump-image instead of sb-ext:dump-image for the image restore hooks 503 (setf uiop:*image-entry-point* #'qlot/cli:main) 504 (uiop:dump-image "qlot" 505 :executable t 506 #+sb-core-compression :compression 507 #+sb-core-compression t) 508 ''; 509 510 installPhase = '' 511 runHook preInstall 512 513 mkdir -p $out/bin 514 cp qlot.asd $out 515 rm *.asd 516 cp -r * $out 517 518 mv $out/qlot $out/bin 519 wrapProgram $out/bin/qlot \ 520 --prefix LD_LIBRARY_PATH : $LD_LIBRARY_PATH 521 522 runHook postInstall 523 ''; 524 525 meta.mainProgram = "qlot"; 526 }; 527 528 fset = super.fset.overrideLispAttrs (oa: { 529 systems = [ 530 "fset" 531 "fset/test" 532 ]; 533 meta = { 534 description = "Functional collections library"; 535 homepage = "https://gitlab.common-lisp.net/fset/fset/-/wikis/home"; 536 license = pkgs.lib.licenses.llgpl21; 537 }; 538 }); 539 540 thih-coalton = self.coalton; 541 quil-coalton = self.coalton; 542 coalton = super.coalton.overrideLispAttrs (oa: { 543 systems = [ 544 "coalton" 545 "thih-coalton" 546 "quil-coalton" 547 "thih-coalton/tests" 548 "quil-coalton/tests" 549 "coalton/tests" 550 ]; 551 lispLibs = oa.lispLibs ++ [ self.fiasco ]; 552 nativeLibs = [ pkgs.mpfr ]; 553 meta = { 554 description = "Statically typed functional programming language that supercharges Common Lisp"; 555 homepage = "https://coalton-lang.github.io"; 556 license = pkgs.lib.licenses.mit; 557 }; 558 }); 559 560 } 561 // optionalAttrs pkgs.config.allowAliases { 562 cl-glib_dot_gio = throw "cl-glib_dot_gio was replaced by cl-gio"; 563 cl-gtk4_dot_webkit2 = throw "cl-gtk4_dot_webkit2 was replaced by cl-gtk4_dot_webkit"; 564 stumpwm-unwrapped = throw "stumpwm-unwrapped is now just stumpwm"; 565 } 566 ); 567 568in 569packages