push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
Authors: Andrei Rozanski and Grace Dinh
Last-Update: 2022-08-23
Description: fix makefile.u in order to get libamplsover.so (Linux) or libamplsolver.dylib (Mac)
--- a/makefile.u
+++ b/makefile.u
@@ -26,8 +26,9 @@
.SUFFIXES: .c .o
CC = cc
-CFLAGS = -O
+CFLAGS := $(CFLAGS) -pipe -DASL_BUILD -fPIC -DPIC
SHELL=/bin/sh
+OFILES=$(addsuffix .o,$(basename $(a)))
# Add -DNO_RUSAGE to the CFLAGS assignment if your system
# lacks getrusage(). This only matters for compiling xectim.c.
@@ -86,7 +87,7 @@
.c.o:
$(CC) -c $(CFLAGS) $*.c
-all: arith.h stdio1.h amplsolver.a funcadd0.o
+all: arith.h stdio1.h amplsolver.a funcadd0.o libamplsolver@sharedlibext@
a = \
asldate.c \
@@ -189,6 +190,11 @@
# search path, e.g.
# exec true
# or just comment out the ranlib invocation above.
+libamplsolver.so: $(OFILES)
+ $(CC) $^ -shared -Wl,-soname,libamplsolver.so.0 $(LDFLAGS) -o $@.0
+ ln -s $@.0 $@
+libamplsolver.dylib: amplsolver.a
+ $(CC) -fpic -shared -Wl,-all_load amplsolver.a $(LDFLAGS) -o libamplsolver.dylib
Aslh = arith.h asl.h funcadd.h stdio1.h
auxinfo.o libnamsave.o: funcadd.h stdio1.h

View File

@@ -0,0 +1,52 @@
{
lib,
stdenv,
substitute,
fetchurl,
}:
stdenv.mkDerivation {
pname = "libamplsolver";
version = "20211109";
src = fetchurl {
url = "https://ampl.com/netlib/ampl/solvers.tgz";
sha256 = "sha256-LVmScuIvxmZzywPSBl9T9YcUBJP7UFAa3eWs9r4q3JM=";
};
patches = [
(substitute {
src = ./libamplsolver-sharedlib.patch;
substitutions = [
"--replace"
"@sharedlibext@"
"${stdenv.hostPlatform.extensions.sharedLibrary}"
];
})
];
installPhase = ''
runHook preInstall
pushd sys.$(uname -m).$(uname -s)
install -D -m 0644 *.h -t $out/include
install -D -m 0644 *${stdenv.hostPlatform.extensions.sharedLibrary}* -t $out/lib
install -D -m 0644 *.a -t $out/lib
popd
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
install_name_tool -id $out/lib/libamplsolver.dylib $out/lib/libamplsolver.dylib
''
+ ''
runHook postInstall
'';
meta = with lib; {
description = "Library of routines that help solvers work with AMPL";
homepage = "https://ampl.com/netlib/ampl/";
license = [ licenses.mit ];
platforms = platforms.unix;
maintainers = with maintainers; [ aanderse ];
# generates header at compile time
broken = !stdenv.buildPlatform.canExecute stdenv.hostPlatform;
};
}