-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swipl: include GUI tools #70724
swipl: include GUI tools #70724
Conversation
adding xorg to a closure can cause it to become huge. I would put in some flags on whether or not to build with xorg in mind. that way we can have a cli and gui package. Something like:
@worldofpeace thoughts? example package: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/build-managers/cmake/default.nix nixpkgs/pkgs/top-level/all-packages.nix Line 9413 in 9acb145
|
@jonringer Jon, I updated the PR. Does this look any better? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a few suggestions, otherwise looks good code wise.
@worldofpeace thoughts?
}: | ||
|
||
let | ||
version = "8.1.4"; | ||
packInstall = swiplPath: pack: | ||
''${swiplPath}/bin/swipl -g "pack_install(${pack}, [package_directory(\"${swiplPath}/lib/swipl/pack\"), silent(true), interactive(false)])." -t "halt." | ||
''; | ||
guiInputs = (if stdenv.isDarwin then [] else [ libXpm libX11 libXext libXft libXinerama libjpeg ]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guiInputs = (if stdenv.isDarwin then [] else [ libXpm libX11 libXext libXft libXinerama libjpeg ]); | |
guiInputs = lib.optionals !stdenv.isDarwin [ libXpm libX11 libXext libXft libXinerama libjpeg ]; |
@@ -25,6 +28,7 @@ stdenv.mkDerivation { | |||
buildInputs = [ cacert git cmake gmp readline openssl | |||
libarchive libyaml db pcre libedit libossp_uuid | |||
zlib pkgconfig ] | |||
++ (if gui then guiInputs else []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally i see a "withXXX" prefix used when passing flags to an expression, that way it's not confused with a package.
++ (if gui then guiInputs else []) | |
++ lib.optionals withGui guiInputs |
@jonringer I've updated the PR. Looks good now? |
hmm, now on darwin, if you do
this way darwin will get a "this is not a supported platform" when trying to build, it will also make hydra avoid building the gui version @worldofpeace thoughts? |
swi-prolog currently misses GUI packages / tools (xpce, prolog_ide) due to missing X dependencies.
@jonringer Makes sense. Updated the PR. |
This is also an interesting alternative @jonringer: diff --git a/pkgs/development/compilers/swi-prolog/default.nix b/pkgs/development/compilers/swi-prolog/default.nix
index 8c79deb9832..ea91ca9b458 100644
--- a/pkgs/development/compilers/swi-prolog/default.nix
+++ b/pkgs/development/compilers/swi-prolog/default.nix
@@ -5,9 +5,11 @@
, libjpeg, libX11, libXext, libXft, libXinerama
, extraLibraries ? [ jdk unixODBC libXpm libSM libXt freetype fontconfig ]
, extraPacks ? []
-, withGui ? false
+, withGui ? false && (!stdenv.isDarwin)
}:
+assert stdenv.lib.assertMsg (withGui -> !stdenv.isDarwin) "swi-prolog cannot be built with gui's on Darwin.";
+
let
version = "8.1.4";
packInstall = swiplPath: pack:
@@ -27,7 +29,7 @@ stdenv.mkDerivation {
buildInputs = [ cacert git cmake gmp readline openssl
libarchive libyaml db pcre libedit libossp_uuid
zlib pkgconfig ]
- ++ stdenv.lib.optionals (withGui && !stdenv.isDarwin) [ libXpm libX11 libXext libXft libXinerama libjpeg ]
+ ++ stdenv.lib.optionals withGui [ libXpm libX11 libXext libXft libXinerama libjpeg ]
++ extraLibraries
++ stdenv.lib.optional stdenv.isDarwin makeWrapper;
@@ -71,7 +73,7 @@ stdenv.mkDerivation {
description = "A Prolog compiler and interpreter";
license = "LGPL";
- platforms = stdenv.lib.platforms.linux ++ stdenv.lib.optionals (!withGui) stdenv.lib.platforms.darwin;
+ platforms = stdenv.lib.platforms.unix;
maintainers = [ stdenv.lib.maintainers.meditans ];
};
} I think either is fine. Though here we get across what's not supported. |
I'm good with either case. As long as darwin users aren't expecting a gui installation and get something else, im good :) |
@jonringer @worldofpeace should I update the PR with the above change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@yrashk I think it's sufficient currently. |
swi-prolog currently misses GUI packages / tools (xpce, prolog_ide)
due to missing X dependencies.
Motivation for this change
SWI-Prolog offers a good range of GUI tools
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @meditans