qcmm: fix merge

This commit is contained in:
Robin Gloster 2016-03-28 23:40:52 +00:00
parent b8e0cb3fe7
commit 4c55a0dbc5
3 changed files with 0 additions and 155 deletions

View file

@ -1,29 +0,0 @@
source $stdenv/setup
configureFlags="--with-lua=$lua"
MKFLAGS="-w$lua/include/lauxlib.h,$lua/include/luadebug.h,$lua/include/lua.h,$lua/include/lualib.h"
buildPhase() {
mk timestamps
mk $MKFLAGS all.opt
}
installPhase() {
mk $MKFLAGS install.opt
for file in $out/bin/*.opt; do
mv $file ${file%.opt}
done
find $out/man -type f -exec gzip -9n {} \;
find $out -name \*.a -exec echo stripping {} \; \
-exec strip -S {} \;
patchELF $out
}
checkPhase="mk $MKFLAGS test.opt"
genericBuild

View file

@ -1,121 +0,0 @@
diff -ur qc--20060131.orig/configure qc--20060131/configure
--- qc--20060131.orig/configure 2005-11-05 22:15:24.000000000 +0100
+++ qc--20060131/configure 2006-02-02 14:29:07.000000000 +0100
@@ -93,7 +93,22 @@
# for file in dirs and return, full path, if found, and "" otherwise.
#
-sub search { search_with( sub($) { return (-f shift) }, @_) }
+sub combine {
+ my $base = shift;
+ my $file = shift;
+ return ("$base/$file")
+};
+
+sub search { search_with( sub($) { return (-f shift) }, \&combine, @_) }
+
+sub search_suffix {
+ my $f = sub($) {
+ my $suffix = shift;
+ my $base = shift;
+ return ($base . $suffix);
+ };
+ search_with(sub($) { return (-f shift) }, $f, @_)
+}
sub searchx {
my $f = sub($) {
@@ -105,16 +120,17 @@
}
return (1==2); # how do you write false in perl?
};
- search_with($f, @_)
+ search_with($f, \&combine, @_)
}
sub search_with {
my $p = shift;
+ my $com = shift;
my $file = shift;
- printf(LOG "searching for %-20s", $file);
+ printf(LOG "searching for %-20s ", $file);
while ($f = shift (@_)) {
- my $x = "$f/$file";
+ my $x = &$com($f, $file);
if (&$p($x)) {
print LOG "found $x\n";
return $x
@@ -124,6 +140,20 @@
return "";
}
+#configure lua based on some known installation prefix
+sub config_lua {
+ my $base = shift;
+ @libsuffix = ( ".so", "40.so", ".a", "40.a" );
+
+ $x{lua_h} = "$base/include/lua.h";
+ $x{lualib_h} = "$base/include/lualib.h";
+ $x{liblua} = search_suffix("$base/lib/liblua", @libsuffix);
+ $x{liblualib} = search_suffix("$base/lib/liblualib", @libsuffix);
+ $x{lua_inc} = "-I$base/include";
+ $x{lua_lib} = "-L$base/lib/";
+ $x{lua_libs} = "-llua -llualib";
+}
+
#
# compile and run a small C program to find out about architecture
@@ -183,6 +213,8 @@
./configure [options]
+ --with-lua=/lua/path lua is installed in /lua/path the default
+ is to search for standard locations
--prefix=/usr/local install into the /usr/local hierarchy which
is also the default
-h, --help this summary
@@ -224,15 +256,15 @@
# We start from here with reading the command line
# ------------------------------------------------------------------
+open (LOG, ">$configure_log") || die "cannot write configure.log: $!";
+
foreach (@ARGV) {
if (/^--?prefix=(.*)$/) { $x{prefix}=$1 }
elsif (/^--?h(elp?)$/) { usage(); exit 0 }
+ elsif (/^--?with-lua=(.*)$/) { config_lua($1) }
else { usage(); exit 1 }
}
-
-open (LOG, ">$configure_log") || die "cannot write configure.log: $!";
-
# check for various executables and versions. Only update variable if
# it is not already set.
#
diff -ur qc--20060131.orig/doc/mkfile qc--20060131/doc/mkfile
--- qc--20060131.orig/doc/mkfile 2005-11-07 01:41:21.000000000 +0100
+++ qc--20060131/doc/mkfile 2006-02-02 00:38:00.000000000 +0100
@@ -92,7 +92,7 @@
# and accessible from Lua as This.manual.
qc--.man:D: qc--.1
- GROFF_NO_SGR=1 nroff -man -Tascii qc--.1 | ul -t dump > $target
+ GROFF_NO_SGR=1 nroff -man -Tascii qc--.1 > $target
release.tex:D: release.nw
noweave -delay $prereq > $target
diff -ur qc--20060131.orig/mkfile qc--20060131/mkfile
--- qc--20060131.orig/mkfile 2005-07-01 22:29:52.000000000 +0200
+++ qc--20060131/mkfile 2006-02-02 19:15:53.000000000 +0100
@@ -97,7 +97,7 @@
cd test2 && NPROC=1 mk $MKFLAGS all
test.opt:V: all.opt
- cd test2 && NPROC=1 mk QC=../bin/qc--.opt $MKFLAGS all
+ cd test2 && NPROC=1 mk $MKFLAGS QC=../bin/qc--.opt all
coverage: test2/ocamlprof.dump
rm -f $target

View file

@ -4976,11 +4976,6 @@ in
llvm = llvm_36; llvm = llvm_36;
}; };
qcmm = callPackage ../development/compilers/qcmm {
lua = lua4;
ocaml = ocaml_3_08_0;
};
rgbds = callPackage ../development/compilers/rgbds { }; rgbds = callPackage ../development/compilers/rgbds { };
rtags = callPackage ../development/tools/rtags/default.nix {}; rtags = callPackage ../development/tools/rtags/default.nix {};