gildas: 20230801_a -> 20240401_a; fix build on darwin (#304813)
- Use GNU's cpp instead of Apple's (see #304528) - Use clang and clang++ on darwin-aarch64 - Update from 20230801_a -> 20240401_a Closes #304516
This commit is contained in:
parent
92fa114574
commit
ef401a3702
|
@ -1,12 +0,0 @@
|
||||||
diff -ruN gildas-src-jul18a/admin/define-system.sh gildas-src-jul18a.aarch64/admin/define-system.sh
|
|
||||||
--- gildas-src-jul18a/admin/define-system.sh 2018-06-12 15:22:32.000000000 +0200
|
|
||||||
+++ gildas-src-jul18a.aarch64/admin/define-system.sh 2018-07-21 13:05:52.000000000 +0200
|
|
||||||
@@ -174,7 +174,7 @@
|
|
||||||
DEFAULT_CONFIG= # Default config is empty
|
|
||||||
case `uname` in
|
|
||||||
Linux)
|
|
||||||
- if [ `uname -m | grep -c "x86_64"` -ne 0 ]; then
|
|
||||||
+ if [ `uname -m | grep -c "64"` -ne 0 ]; then
|
|
||||||
GAG_MACHINE=x86_64
|
|
||||||
else
|
|
||||||
GAG_MACHINE=pc
|
|
|
@ -1,22 +1,77 @@
|
||||||
diff -ruN gildas-src-jun18a/admin/define-system.sh gildas-src-jun18a.clang/admin/define-system.sh
|
diff --git a/admin/Makefile.def b/admin/Makefile.def
|
||||||
--- gildas-src-jun18a/admin/define-system.sh 2018-03-12 11:07:57.000000000 +0100
|
index 932d18f102..309114e339 100644
|
||||||
+++ gildas-src-jun18a.clang/admin/define-system.sh 2018-06-12 14:56:14.000000000 +0200
|
--- a/admin/Makefile.def
|
||||||
@@ -218,13 +218,13 @@
|
+++ b/admin/Makefile.def
|
||||||
|
@@ -310,7 +310,7 @@ endif
|
||||||
|
|
||||||
|
# Apple CLANG flags (identical to GCC)
|
||||||
|
ifeq ($(GAG_COMPILER_CKIND),clang)
|
||||||
|
- GLOBAL_CFLAGS += -pipe -fPIC
|
||||||
|
+ GLOBAL_CFLAGS += -fPIC
|
||||||
|
ifeq ($(RELEASE_MODE),no)
|
||||||
|
OPTION_CFLAGS += -Wall
|
||||||
|
endif
|
||||||
|
@@ -360,7 +360,7 @@ endif
|
||||||
|
|
||||||
|
# GFORTRAN flags
|
||||||
|
ifeq ($(GAG_COMPILER_FKIND),gfortran)
|
||||||
|
- GLOBAL_FFLAGS += -J$(moddir) -pipe -fno-backslash -fno-range-check
|
||||||
|
+ GLOBAL_FFLAGS += -J$(moddir) -fno-backslash -fno-range-check
|
||||||
|
ifeq ($(GAG_USE_SANITIZE),yes)
|
||||||
|
GLOBAL_FFLAGS += -fsanitize=address -fsanitize=null
|
||||||
|
# Can not be used with our memory(ip):
|
||||||
|
diff --git a/admin/define-system.sh b/admin/define-system.sh
|
||||||
|
index b6eda9fdfd..704050a9ac 100644
|
||||||
|
--- a/admin/define-system.sh
|
||||||
|
+++ b/admin/define-system.sh
|
||||||
|
@@ -272,34 +272,23 @@ EOF
|
||||||
else
|
else
|
||||||
GAG_MACHINE=pc
|
GAG_MACHINE=pc
|
||||||
fi
|
fi
|
||||||
- if which gcc > /dev/null 2>&1; then
|
- if which gcc > /dev/null 2>&1; then
|
||||||
- DEFAULT_CCOMPILER=gcc
|
- DEFAULT_CCOMPILER=gcc
|
||||||
+ if which clang > /dev/null 2>&1; then
|
- fi
|
||||||
+ DEFAULT_CCOMPILER=clang
|
|
||||||
fi
|
|
||||||
- if which g++ > /dev/null 2>&1; then
|
- if which g++ > /dev/null 2>&1; then
|
||||||
- DEFAULT_CXXCOMPILER=g++
|
- DEFAULT_CXXCOMPILER=g++
|
||||||
- elif which clang++ > /dev/null 2>&1; then
|
- elif which clang++ > /dev/null 2>&1; then
|
||||||
+ if which clang++ > /dev/null 2>&1; then
|
- DEFAULT_CXXCOMPILER=clang++
|
||||||
DEFAULT_CXXCOMPILER=clang++
|
- fi
|
||||||
+ elif which g++ > /dev/null 2>&1; then
|
- if which ifort > /dev/null 2>&1; then
|
||||||
+ DEFAULT_CXXCOMPILER=g++
|
- DEFAULT_FCOMPILER=ifort
|
||||||
fi
|
- elif which gfortran > /dev/null 2>&1; then
|
||||||
if which ifort > /dev/null 2>&1; then
|
- DEFAULT_FCOMPILER=gfortran
|
||||||
DEFAULT_FCOMPILER=ifort
|
- fi
|
||||||
|
- elif [ `uname -p` = "arm" ]; then
|
||||||
|
+ elif [ `uname -p` = "arm" ]; then
|
||||||
|
GAG_MACHINE=arm64
|
||||||
|
- if which gcc > /dev/null 2>&1; then
|
||||||
|
- DEFAULT_CCOMPILER=gcc
|
||||||
|
- fi
|
||||||
|
- if which clang++ > /dev/null 2>&1; then
|
||||||
|
- DEFAULT_CXXCOMPILER=clang++
|
||||||
|
- elif which g++ > /dev/null 2>&1; then
|
||||||
|
- DEFAULT_CXXCOMPILER=g++
|
||||||
|
- fi
|
||||||
|
- if which ifort > /dev/null 2>&1; then
|
||||||
|
- DEFAULT_FCOMPILER=ifort
|
||||||
|
- elif which gfortran > /dev/null 2>&1; then
|
||||||
|
- DEFAULT_FCOMPILER=gfortran
|
||||||
|
- fi
|
||||||
|
+ fi
|
||||||
|
+ if which clang > /dev/null 2>&1; then
|
||||||
|
+ DEFAULT_CCOMPILER=clang
|
||||||
|
+ elif which gcc > /dev/null 2>&1; then
|
||||||
|
+ DEFAULT_CCOMPILER=gcc
|
||||||
|
+ fi
|
||||||
|
+ if which clang++ > /dev/null 2>&1; then
|
||||||
|
+ DEFAULT_CXXCOMPILER=clang++
|
||||||
|
+ elif which g++ > /dev/null 2>&1; then
|
||||||
|
+ DEFAULT_CXXCOMPILER=g++
|
||||||
|
+ fi
|
||||||
|
+ if which ifort > /dev/null 2>&1; then
|
||||||
|
+ DEFAULT_FCOMPILER=ifort
|
||||||
|
+ elif which gfortran > /dev/null 2>&1; then
|
||||||
|
+ DEFAULT_FCOMPILER=gfortran
|
||||||
|
fi ;;
|
||||||
|
CYGWIN*)
|
||||||
|
if [ `uname -m | grep -c "x86_64"` -ne 0 ]; then
|
||||||
|
|
17
pkgs/applications/science/astronomy/gildas/cpp-darwin.patch
Normal file
17
pkgs/applications/science/astronomy/gildas/cpp-darwin.patch
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
diff --git a/admin/Makefile.def b/admin/Makefile.def
|
||||||
|
index 0395d9d4f0..932d18f102 100644
|
||||||
|
--- a/admin/Makefile.def
|
||||||
|
+++ b/admin/Makefile.def
|
||||||
|
@@ -228,7 +228,11 @@ GLOBAL_DIRTY = $(builddir) *~ TAGS ChangeLog* Makefile.bak
|
||||||
|
# Fortran preprocessing
|
||||||
|
|
||||||
|
# Preprocessor command
|
||||||
|
-CPP = cpp
|
||||||
|
+ifdef GAG_CPP
|
||||||
|
+ CPP = $(GAG_CPP)
|
||||||
|
+else
|
||||||
|
+ CPP = cpp
|
||||||
|
+endif
|
||||||
|
|
||||||
|
# Preprocessor generic flags
|
||||||
|
GLOBAL_CPPFLAGS += -P -traditional -C
|
|
@ -7,8 +7,8 @@ let
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
srcVersion = "aug23a";
|
srcVersion = "apr24a";
|
||||||
version = "20230801_a";
|
version = "20240401_a";
|
||||||
pname = "gildas";
|
pname = "gildas";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
|
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
|
||||||
# source code of the previous release to a different directory
|
# source code of the previous release to a different directory
|
||||||
urls = [ "http://www.iram.fr/~gildas/dist/gildas-src-${srcVersion}.tar.xz"
|
urls = [ "http://www.iram.fr/~gildas/dist/gildas-src-${srcVersion}.tar.xz"
|
||||||
"http://www.iram.fr/~gildas/dist/archive/gildas/gildas-src-${srcVersion}.tar.xz" ];
|
"http://www.iram.fr/~gildas/dist/archive/gildas/gildas-src-${srcVersion}.tar.xz" ];
|
||||||
sha256 = "sha256-jlyv2K1V+510C4uLek4oofm13d40nGJ46wqjW+tjfq4=";
|
sha256 = "sha256-Eq6S5S8xrhkCo6O2wUaHnoMDVG9WeiSurGvOc+2JKbM=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config groff perl getopt gfortran which ];
|
nativeBuildInputs = [ pkg-config groff perl getopt gfortran which ];
|
||||||
|
@ -24,10 +24,14 @@ stdenv.mkDerivation rec {
|
||||||
buildInputs = [ gtk2-x11 lesstif cfitsio python3Env ncurses ]
|
buildInputs = [ gtk2-x11 lesstif cfitsio python3Env ncurses ]
|
||||||
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation ]);
|
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation ]);
|
||||||
|
|
||||||
patches = [ ./wrapper.patch ./clang.patch ./aarch64.patch ];
|
patches = [ ./wrapper.patch ]
|
||||||
|
++ lib.optionals stdenv.isDarwin ([ ./clang.patch ./cpp-darwin.patch ]);
|
||||||
|
|
||||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
|
||||||
|
|
||||||
|
# Workaround for https://github.com/NixOS/nixpkgs/issues/304528
|
||||||
|
env.GAG_CPP = lib.optionalString stdenv.isDarwin "${gfortran.outPath}/bin/cpp";
|
||||||
|
|
||||||
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks");
|
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks");
|
||||||
|
|
||||||
configurePhase=''
|
configurePhase=''
|
||||||
|
@ -66,7 +70,6 @@ stdenv.mkDerivation rec {
|
||||||
license = lib.licenses.free;
|
license = lib.licenses.free;
|
||||||
maintainers = [ lib.maintainers.bzizou lib.maintainers.smaret ];
|
maintainers = [ lib.maintainers.bzizou lib.maintainers.smaret ];
|
||||||
platforms = lib.platforms.all;
|
platforms = lib.platforms.all;
|
||||||
broken = stdenv.isDarwin && stdenv.isAarch64;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user