Merge pull request #48727 from spacefrogg/factor
factor-lang: 0.97 -> 0.98
This commit is contained in:
commit
c39fa89db5
|
@ -1,57 +1,58 @@
|
||||||
{ stdenv, fetchurl, fetchFromGitHub, glib, git,
|
{ stdenv, fetchurl, glib, glibc, git,
|
||||||
rlwrap, curl, pkgconfig, perl, makeWrapper, tzdata, ncurses,
|
rlwrap, curl, pkgconfig, perl, makeWrapper, tzdata, ncurses,
|
||||||
libX11, pango, cairo, gtk2, gdk_pixbuf, gtkglext,
|
pango, cairo, gtk2, gdk_pixbuf, gtkglext,
|
||||||
libGLU, libXmu, libXt, libICE, libSM }:
|
mesa, xorg, openssl, unzip }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
|
inherit (stdenv.lib) optional;
|
||||||
|
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
name = "factor-lang-${version}";
|
name = "factor-lang-${version}";
|
||||||
version = "0.97";
|
version = "0.98";
|
||||||
rev = "eb3ca179740e6cfba696b55a999caa13369e6182";
|
rev = "7999e72aecc3c5bc4019d43dc4697f49678cc3b4";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchurl {
|
||||||
owner = "factor";
|
url = http://downloads.factorcode.org/releases/0.98/factor-src-0.98.zip;
|
||||||
repo = "factor";
|
sha256 = "01ip9mbnar4sv60d2wcwfz62qaamdvbykxw3gbhzqa25z36vi3ri";
|
||||||
rev = rev;
|
|
||||||
sha256 = "16zlbxbad3d19jq01nk824i19bypqzn8l3yfxys40z06vjjncapd";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
factorimage = fetchurl {
|
patches = [
|
||||||
url = http://downloads.factorcode.org/releases/0.97/factor-linux-x86-64-0.97.tar.gz;
|
./staging-command-line-0.98-pre.patch
|
||||||
sha256 = "06y125c8vbng54my5fxdr3crpxkvhhcng2n35cxddd3wcg6vhxhp";
|
./workdir-0.98-pre.patch
|
||||||
name = "factorimage";
|
./fuel-dir.patch
|
||||||
};
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
buildInputs = with xorg; [ git rlwrap curl pkgconfig perl makeWrapper
|
||||||
buildInputs = [ git rlwrap curl perl makeWrapper
|
|
||||||
libX11 pango cairo gtk2 gdk_pixbuf gtkglext
|
libX11 pango cairo gtk2 gdk_pixbuf gtkglext
|
||||||
libGLU libXmu libXt libICE libSM ];
|
mesa libXmu libXt libICE libSM openssl unzip ];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
make $(bash ./build-support/factor.sh make-target) GIT_LABEL=heads/master-${rev}
|
sed -ie '4i GIT_LABEL = heads/master-${rev}' GNUmakefile
|
||||||
|
make linux-x86-64
|
||||||
|
# De-memoize xdg-* functions, otherwise they break the image.
|
||||||
|
sed -ie 's/^MEMO:/:/' basis/xdg/xdg.factor
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin $out/lib/factor
|
mkdir -p $out/bin $out/lib/factor
|
||||||
# First, get a workable image. Unfortunately, no boot-image
|
|
||||||
# is available with release info. So fetch a released image.
|
|
||||||
# The released image has library path info embedded, so we
|
# The released image has library path info embedded, so we
|
||||||
# have to first recreate the boot image with Nix paths, and
|
# first have to recreate the boot image with Nix paths, and
|
||||||
# then use it to build the Nix release image.
|
# then use it to build the Nix release image.
|
||||||
zcat ${factorimage} | (cd $out/lib && tar -xvpf - factor/factor.image )
|
cp boot.unix-x86.64.image $out/lib/factor/factor.image
|
||||||
|
|
||||||
cp -r basis core extra unmaintained $out/lib/factor
|
cp -r basis core extra $out/lib/factor
|
||||||
|
|
||||||
# Factor uses the home directory for cache during compilation.
|
# Factor uses XDG_CACHE_HOME for cache during compilation.
|
||||||
# We cant have that. So set it to $TMPDIR/.home
|
# We can't have that. So set it to $TMPDIR/.cache
|
||||||
export HOME=$TMPDIR/.home && mkdir -p $HOME
|
export XDG_CACHE_HOME=$TMPDIR/.cache && mkdir -p $XDG_CACHE_HOME
|
||||||
|
|
||||||
# there is no ld.so.cache in NixOS so we construct one
|
# There is no ld.so.cache in NixOS so we construct one
|
||||||
# out of known libraries. The side effect is that find-lib
|
# out of known libraries. The side effect is that find-lib
|
||||||
# will work only on the known libraries. There does not seem
|
# will work only on the known libraries. There does not seem
|
||||||
# to be a generic solution here.
|
# to be a generic solution here.
|
||||||
find $(echo ${stdenv.lib.makeLibraryPath [
|
find $(echo ${stdenv.lib.makeLibraryPath (with xorg; [
|
||||||
glib libX11 pango cairo gtk2 gdk_pixbuf gtkglext
|
glib libX11 pango cairo gtk2 gdk_pixbuf gtkglext
|
||||||
libGLU libXmu libXt libICE libSM ]} | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst
|
mesa libXmu libXt libICE libSM ])} | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst
|
||||||
|
|
||||||
(echo $(cat $TMPDIR/so.lst | wc -l) "libs found in cache \`/etc/ld.so.cache'";
|
(echo $(cat $TMPDIR/so.lst | wc -l) "libs found in cache \`/etc/ld.so.cache'";
|
||||||
for l in $(<$TMPDIR/so.lst);
|
for l in $(<$TMPDIR/so.lst);
|
||||||
|
@ -70,18 +71,29 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
cp ./factor $out/bin
|
cp ./factor $out/bin
|
||||||
wrapProgram $out/bin/factor --prefix LD_LIBRARY_PATH : \
|
wrapProgram $out/bin/factor --prefix LD_LIBRARY_PATH : \
|
||||||
"${stdenv.lib.makeLibraryPath [ glib
|
"${stdenv.lib.makeLibraryPath (with xorg; [ glib
|
||||||
libX11 pango cairo gtk2 gdk_pixbuf gtkglext
|
libX11 pango cairo gtk2 gdk_pixbuf gtkglext
|
||||||
libGLU libXmu libXt libICE libSM ]}"
|
mesa libXmu libXt libICE libSM openssl])}"
|
||||||
|
|
||||||
sed -ie 's#/bin/.factor-wrapped#/lib/factor/factor#g' $out/bin/factor
|
sed -ie 's#/bin/.factor-wrapped#/lib/factor/factor#g' $out/bin/factor
|
||||||
mv $out/bin/.factor-wrapped $out/lib/factor/factor
|
mv $out/bin/.factor-wrapped $out/lib/factor/factor
|
||||||
|
|
||||||
# make a new bootstrap image
|
# build full factor image from boot image
|
||||||
(cd $out/bin && ./factor -script -e='"unix-x86.64" USING: system bootstrap.image memory ; make-image save 0 exit' )
|
(cd $out/bin && ./factor -script -e='"unix-x86.64" USING: system bootstrap.image memory ; make-image save 0 exit' )
|
||||||
mv $out/lib/factor/boot.unix-x86.64.image $out/lib/factor/factor.image
|
|
||||||
# now make the full system image, it overwrites $out/lib/factor/factor.image
|
# make a new bootstrap image
|
||||||
$out/bin/factor -i=$out/lib/factor/factor.image
|
(cd $out/bin && ./factor -script -e='"unix-x86.64" USING: system tools.deploy.backend ; make-boot-image 0 exit' )
|
||||||
|
|
||||||
|
# rebuild final full factor image to include all patched sources
|
||||||
|
(cd $out/lib/factor && ./factor -i=boot.unix-x86.64.image)
|
||||||
|
|
||||||
|
# install fuel mode for emacs
|
||||||
|
mkdir -p $out/share/emacs/site-lisp
|
||||||
|
# update default paths in factor-listener.el for fuel mode
|
||||||
|
substituteInPlace misc/fuel/fuel-listener.el \
|
||||||
|
--subst-var-by fuel_factor_root_dir $out/lib/factor \
|
||||||
|
--subst-var-by fuel_listener_factor_binary $out/bin/factor
|
||||||
|
cp misc/fuel/*.el $out/share/emacs/site-lisp/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -89,7 +101,7 @@ stdenv.mkDerivation rec {
|
||||||
license = licenses.bsd2;
|
license = licenses.bsd2;
|
||||||
description = "A concatenative, stack-based programming language";
|
description = "A concatenative, stack-based programming language";
|
||||||
|
|
||||||
maintainers = [ maintainers.vrthra ];
|
maintainers = [ maintainers.vrthra maintainers.spacefrogg ];
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = [ "x86_64-linux" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
diff --git a/misc/fuel/fuel-listener.el b/misc/fuel/fuel-listener.el
|
||||||
|
index 2d1b182a75..bf2e573425 100644
|
||||||
|
--- a/misc/fuel/fuel-listener.el
|
||||||
|
+++ b/misc/fuel/fuel-listener.el
|
||||||
|
@@ -30,13 +30,13 @@
|
||||||
|
"Interacting with a Factor listener inside Emacs."
|
||||||
|
:group 'fuel)
|
||||||
|
|
||||||
|
-(defcustom fuel-factor-root-dir nil
|
||||||
|
+(defcustom fuel-factor-root-dir "@fuel_factor_root_dir@"
|
||||||
|
"Full path to the factor root directory when starting a listener."
|
||||||
|
:type 'directory
|
||||||
|
:group 'fuel-listener)
|
||||||
|
|
||||||
|
;;; Is factor.com still valid on Windows...?
|
||||||
|
-(defcustom fuel-listener-factor-binary nil
|
||||||
|
+(defcustom fuel-listener-factor-binary "@fuel_listener_factor_binary@"
|
||||||
|
"Full path to the factor executable to use when starting a listener."
|
||||||
|
:type '(file :must-match t)
|
||||||
|
:group 'fuel-listener)
|
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/basis/tools/deploy/backend/backend.factor b/basis/tools/deploy/backend/backend.factor
|
||||||
|
index ec86089dbe..b146168ec9 100644
|
||||||
|
--- a/basis/tools/deploy/backend/backend.factor
|
||||||
|
+++ b/basis/tools/deploy/backend/backend.factor
|
||||||
|
@@ -69,7 +69,7 @@ ERROR: can't-deploy-library-file library ;
|
||||||
|
[ staging-image-name "-output-image=" prepend , ]
|
||||||
|
[ " " join "-include=" prepend , ] bi
|
||||||
|
] [
|
||||||
|
- input-image-name "-i=" prepend ,
|
||||||
|
+ input-image-name resource-path "-i=" prepend ,
|
||||||
|
"-resource-path=" "" resource-path append ,
|
||||||
|
"-run=tools.deploy.restage" ,
|
||||||
|
] bi
|
|
@ -0,0 +1,24 @@
|
||||||
|
diff --git a/core/io/pathnames/pathnames.factor b/core/io/pathnames/pathnames.factor
|
||||||
|
index 2d382e49d1..d4d9228d6c 100644
|
||||||
|
--- a/core/io/pathnames/pathnames.factor
|
||||||
|
+++ b/core/io/pathnames/pathnames.factor
|
||||||
|
@@ -144,7 +144,10 @@ GENERIC: vocab-path ( path -- newpath )
|
||||||
|
GENERIC: absolute-path ( path -- path' )
|
||||||
|
|
||||||
|
M: string absolute-path
|
||||||
|
- "resource:" ?head [
|
||||||
|
+ "resource:work" ?head [
|
||||||
|
+ trim-head-separators "/var/lib/factor" prepend-path
|
||||||
|
+ absolute-path ]
|
||||||
|
+ [ "resource:" ?head [
|
||||||
|
trim-head-separators resource-path
|
||||||
|
absolute-path
|
||||||
|
] [
|
||||||
|
@@ -158,6 +161,7 @@ M: string absolute-path
|
||||||
|
] [
|
||||||
|
current-directory get prepend-path
|
||||||
|
] if ] if
|
||||||
|
+ ] if
|
||||||
|
] if ;
|
||||||
|
|
||||||
|
M: object normalize-path ( path -- path' )
|
Loading…
Reference in New Issue